diff
stringlengths 41
2.03M
| msg
stringlengths 1
1.5k
⌀ | repo
stringlengths 5
40
| sha
stringlengths 40
40
| time
stringlengths 20
20
|
---|---|---|---|---|
mmm a / configure <nl> ppp b / configure <nl> while true ; do <nl> TF_CUDNN_VERSION = $ { BASH_REMATCH [ 1 ] } <nl> echo " libcudnn . so resolves to libcudnn $ { TF_CUDNN_EXT } " <nl> elif [ [ " $ REALVAL " = ~ ( [ 0 - 9 ] * ) . dylib ] ] ; then <nl> - TF_CUDNN_EXT = $ { BASH_REMATCH [ 1 ] } " . dylib " <nl> + TF_CUDNN_EXT = " . " $ { BASH_REMATCH [ 1 ] } " . dylib " <nl> TF_CUDNN_VERSION = $ { BASH_REMATCH [ 1 ] } <nl> echo " libcudnn . dylib resolves to libcudnn $ { TF_CUDNN_EXT } " <nl> fi <nl>
|
Find correct path of libcudnn . dylib on macOS . ( )
|
tensorflow/tensorflow
|
f6632b29399d34d9e25fedf10bb084284c0a45ba
|
2016-12-14T08:47:14Z
|
mmm a / Engine / Shaders / HWScripts / CryFX / Hair . cfx <nl> ppp b / Engine / Shaders / HWScripts / CryFX / Hair . cfx <nl> v2f_sh HairSG_VS ( app2vertGeneral IN ) <nl> float4 HPosition = mul ( g_VS_ViewProjMatr , vertPassPos . WorldPos ) ; <nl> <nl> # if ! % _RT_CUBEMAP0 <nl> - # if % _RT_ALPHABLEND <nl> - OUT . Depth = HPosition . z ; <nl> + # if ! % _RT_NEAREST <nl> + HPosition . z / = CP_ShadowGen_FrustumInfo . y ; <nl> + # endif <nl> + <nl> + # if % _RT_SAMPLE0 <nl> + OUT . Depth = HPosition . z + CP_ShadowGen_DepthTestBias . x ; <nl> # endif <nl> # else <nl> OUT . Depth = ( HPosition . z / CP_ShadowGen_FrustumInfo . y ) ; <nl>
|
! B ( CE - 10174 ) ( Shadows ) : Fix vertex shader depth output for hair shadow gen ( Approved by timur )
|
CRYTEK/CRYENGINE
|
3ecb58026100fe8e2c3f76d6e3819a51e972a4eb
|
2016-08-08T13:48:15Z
|
mmm a / test / test_jit . py <nl> ppp b / test / test_jit . py <nl> <nl> from jit . test_custom_operators import TestCustomOperators # noqa : F401 <nl> from jit . test_export_modes import TestExportModes # noqa : F401 <nl> from jit . test_class_type import TestClassType # noqa : F401 <nl> + from jit . test_module_interface import TestModuleInterface # noqa : F401 <nl> from jit . test_builtins import TestBuiltins , TestTensorBuiltins # noqa : F401 <nl> from jit . test_unsupported_ops import TestUnsupportedOps # noqa : F401 <nl> from jit . test_freezing import TestFreezing # noqa : F401 <nl>
|
[ jit ] add module interface tests to test_jit ( )
|
pytorch/pytorch
|
d7c255d2fc8b7bf1ccc0c328e1be606db8db8908
|
2020-03-25T22:25:28Z
|
mmm a / src / flag - definitions . h <nl> ppp b / src / flag - definitions . h <nl> DEFINE_BOOL ( incremental_marking_wrappers , true , <nl> DEFINE_BOOL ( trace_unmapper , false , " Trace the unmapping " ) <nl> DEFINE_BOOL ( parallel_scavenge , true , " parallel scavenge " ) <nl> DEFINE_BOOL ( trace_parallel_scavenge , false , " trace parallel scavenge " ) <nl> - # if defined ( V8_TARGET_ARCH_ARM ) <nl> - # define V8_WRITE_PROTECT_CODE_MEMORY_BOOL false <nl> - # else <nl> - # define V8_WRITE_PROTECT_CODE_MEMORY_BOOL true <nl> - # endif <nl> - DEFINE_BOOL ( write_protect_code_memory , V8_WRITE_PROTECT_CODE_MEMORY_BOOL , <nl> - " write protect code memory " ) <nl> + DEFINE_BOOL ( write_protect_code_memory , true , " write protect code memory " ) <nl> # ifdef V8_CONCURRENT_MARKING <nl> # define V8_CONCURRENT_MARKING_BOOL true <nl> # else <nl>
|
[ arm ] Enable write - protected code pages .
|
v8/v8
|
56bed77bd5ecba65847f373608c7918d404a1105
|
2019-01-09T11:18:15Z
|
deleted file mode 100644 <nl> index 5d805bb4b22 . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_csharp / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / ccache_setup . include " / > <nl> - < % include file = " . . / . . / cxx_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / csharp_deps . include " / > <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> - <nl> deleted file mode 100644 <nl> index 18f06b770c3 . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_cxx / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / ccache_setup . include " / > <nl> - < % include file = " . . / . . / cxx_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / clang_update . include " / > <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100644 <nl> index ad8ad71b5fa . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_go / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM golang : latest <nl> - <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / go_path . include " / > <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100644 <nl> index 2bb2f9ba1e6 . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_java / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / ccache_setup . include " / > <nl> - < % include file = " . . / . . / cxx_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / java_deps . include " / > <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100644 <nl> index d70b751b141 . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_node / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / node_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / run_tests_addons . include " / > <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100644 <nl> index 49ba60168da . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_php / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / ruby_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / php_deps . include " / > <nl> - < % include file = " . . / . . / run_tests_addons . include " / > <nl> - # Install composer <nl> - RUN curl - sS https : / / getcomposer . org / installer | php <nl> - RUN mv composer . phar / usr / local / bin / composer <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> - <nl> deleted file mode 100644 <nl> index 27e9eeec5a8 . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_python / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / ccache_setup . include " / > <nl> - < % include file = " . . / . . / cxx_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - <nl> - RUN pip install coverage <nl> - RUN pip install oauth2client <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> - <nl> deleted file mode 100644 <nl> index 18199771d7e . . 00000000000 <nl> mmm a / templates / tools / dockerfile / stress_test / grpc_interop_stress_ruby / Dockerfile . template <nl> ppp / dev / null <nl> <nl> - % YAML 1 . 2 <nl> mmm - | <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - < % include file = " . . / . . / apt_get_basic . include " / > <nl> - < % include file = " . . / . . / python_deps . include " / > <nl> - < % include file = " . . / . . / ccache_setup . include " / > <nl> - < % include file = " . . / . . / cxx_deps . include " / > <nl> - < % include file = " . . / . . / gcp_api_libraries . include " / > <nl> - < % include file = " . . / . . / ruby_deps . include " / > <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> - <nl> deleted file mode 100644 <nl> index 12d8d091848 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_csharp / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # C + + dependencies <nl> - RUN apt - get update & & apt - get - y install libgflags - dev libgtest - dev libc + + - dev clang & & apt - get clean <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # C # dependencies <nl> - <nl> - # Update to a newer version of mono <nl> - RUN apt - key adv - - keyserver keyserver . ubuntu . com - - recv - keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF <nl> - RUN echo " deb http : / / download . mono - project . com / repo / debian wheezy main " | tee / etc / apt / sources . list . d / mono - xamarin . list <nl> - RUN echo " deb http : / / download . mono - project . com / repo / debian wheezy - apache24 - compat main " | tee - a / etc / apt / sources . list . d / mono - xamarin . list <nl> - RUN echo " deb http : / / download . mono - project . com / repo / debian wheezy - libjpeg62 - compat main " | tee - a / etc / apt / sources . list . d / mono - xamarin . list <nl> - <nl> - # Install dependencies <nl> - RUN apt - get update & & apt - get - y dist - upgrade & & apt - get install - y \ <nl> - mono - devel \ <nl> - ca - certificates - mono \ <nl> - nuget \ <nl> - & & apt - get clean <nl> - <nl> - RUN nuget update - self <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 345196894ef . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_csharp / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds C # interop server and client in a base image . <nl> - set - e <nl> - <nl> - mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # Copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - cd / var / local / git / grpc <nl> - <nl> - # Build C + + metrics client ( to query the metrics from csharp stress client ) <nl> - make metrics_client - j <nl> - <nl> - # Build C # interop client & server <nl> - tools / run_tests / run_tests . py - l csharp - c dbg - - build_only <nl> - <nl> deleted file mode 100644 <nl> index d0f66d99556 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_cxx / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # C + + dependencies <nl> - RUN apt - get update & & apt - get - y install libgflags - dev libgtest - dev libc + + - dev clang & & apt - get clean <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # Update clang to a version with improved tsan and fuzzing capabilities <nl> - <nl> - RUN apt - get update & & apt - get - y install python cmake & & apt - get clean <nl> - <nl> - RUN git clone - n - b release_38 http : / / llvm . org / git / llvm . git & & \ <nl> - cd llvm & & git checkout ad57503 & & cd . . <nl> - RUN git clone - n - b release_38 http : / / llvm . org / git / clang . git & & \ <nl> - cd clang & & git checkout ad2c56e & & cd . . <nl> - RUN git clone - n - b release_38 http : / / llvm . org / git / compiler - rt . git & & \ <nl> - cd compiler - rt & & git checkout 3176922 & & cd . . <nl> - RUN git clone - n - b release_38 \ <nl> - http : / / llvm . org / git / clang - tools - extra . git & & cd clang - tools - extra & & \ <nl> - git checkout c288525 & & cd . . <nl> - RUN git clone - n - b release_38 http : / / llvm . org / git / libcxx . git & & \ <nl> - cd libcxx & & git checkout fda3549 & & cd . . <nl> - RUN git clone - n - b release_38 http : / / llvm . org / git / libcxxabi . git & & \ <nl> - cd libcxxabi & & git checkout 8d4e51d & & cd . . <nl> - <nl> - RUN mv clang llvm / tools <nl> - RUN mv compiler - rt llvm / projects <nl> - RUN mv clang - tools - extra llvm / tools / clang / tools <nl> - RUN mv libcxx llvm / projects <nl> - RUN mv libcxxabi llvm / projects <nl> - <nl> - RUN mkdir llvm - build <nl> - RUN cd llvm - build & & cmake \ <nl> - - DCMAKE_BUILD_TYPE : STRING = Release \ <nl> - - DCMAKE_INSTALL_PREFIX : STRING = / usr \ <nl> - - DLLVM_TARGETS_TO_BUILD : STRING = X86 \ <nl> - . . / llvm <nl> - RUN make - C llvm - build - j 12 & & make - C llvm - build install & & rm - rf llvm - build <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 92d1f80fe60 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_cxx / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds C + + interop server and client in a base image . <nl> - set - e <nl> - <nl> - mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - cd / var / local / git / grpc <nl> - <nl> - make install - certs <nl> - <nl> - BUILD_TYPE = $ { BUILD_TYPE : = opt } <nl> - <nl> - # build C + + interop stress client , interop client and server <nl> - make CONFIG = $ BUILD_TYPE stress_test metrics_client interop_client interop_server <nl> deleted file mode 100644 <nl> index c099f339aee . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_go / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM golang : latest <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # Using login shell removes Go from path , so we add it . <nl> - RUN ln - s / usr / local / go / bin / go / usr / local / bin <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 9e4769cf334 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_go / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds Go interop server , Stress client and metrics client in a base image . <nl> - set - e <nl> - <nl> - # Clone just the grpc - go source code without any dependencies . <nl> - # We are cloning from a local git repo that contains the right revision <nl> - # to test instead of using " go get " to download from Github directly . <nl> - git clone - - recursive / var / local / jenkins / grpc - go src / google . golang . org / grpc <nl> - <nl> - # Clone the ' grpc ' repo . We just need this for the wrapper scripts under <nl> - # grpc / tools / gcp / stress_tests <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - # Get dependencies from GitHub <nl> - # NOTE : once grpc - go dependencies change , this needs to be updated manually <nl> - # but we don ' t expect this to happen any time soon . <nl> - go get github . com / golang / protobuf / proto <nl> - go get golang . org / x / net / context <nl> - go get golang . org / x / net / trace <nl> - go get golang . org / x / oauth2 <nl> - go get google . golang . org / cloud <nl> - <nl> - # Build the interop server , stress client and stress metrics client <nl> - ( cd src / google . golang . org / grpc / interop / server & & go install ) <nl> - ( cd src / google . golang . org / grpc / stress / client & & go install ) <nl> - ( cd src / google . golang . org / grpc / stress / metrics_client & & go install ) <nl> deleted file mode 100644 <nl> index 229ea469c42 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_java / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # C + + dependencies <nl> - RUN apt - get update & & apt - get - y install libgflags - dev libgtest - dev libc + + - dev clang & & apt - get clean <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # Install JDK 8 and Git <nl> - # <nl> - RUN echo oracle - java8 - installer shared / accepted - oracle - license - v1 - 1 select true | / usr / bin / debconf - set - selections & & \ <nl> - echo " deb http : / / ppa . launchpad . net / webupd8team / java / ubuntu trusty main " | tee / etc / apt / sources . list . d / webupd8team - java . list & & \ <nl> - echo " deb - src http : / / ppa . launchpad . net / webupd8team / java / ubuntu trusty main " | tee - a / etc / apt / sources . list . d / webupd8team - java . list & & \ <nl> - apt - key adv - - keyserver hkp : / / keyserver . ubuntu . com : 80 - - recv - keys EEA14886 <nl> - <nl> - RUN apt - get update & & apt - get - y install \ <nl> - git \ <nl> - libapr1 \ <nl> - oracle - java8 - installer \ <nl> - & & \ <nl> - apt - get clean & & rm - r / var / cache / oracle - jdk8 - installer / <nl> - <nl> - ENV JAVA_HOME / usr / lib / jvm / java - 8 - oracle <nl> - ENV PATH $ PATH : $ JAVA_HOME / bin <nl> - <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 0194860d101 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_java / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds C + + interop server and client in a base image . <nl> - set - e <nl> - <nl> - mkdir - p / var / local / git <nl> - # grpc - java repo <nl> - git clone - - recursive - - depth 1 / var / local / jenkins / grpc - java / var / local / git / grpc - java <nl> - <nl> - # grpc repo ( for metrics client and for the stress test wrapper scripts ) <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # Copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - # First build the metrics client in grpc repo <nl> - cd / var / local / git / grpc <nl> - make metrics_client <nl> - <nl> - # Build all interop test targets ( which includes interop server and stress test <nl> - # client ) in grpc - java repo <nl> - cd / var / local / git / grpc - java <nl> - . / gradlew : grpc - interop - testing : installDist - PskipCodegen = true <nl> deleted file mode 100644 <nl> index 5fd0bc0eb21 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_node / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # = = = = = = = = = = = = = = = = = = <nl> - # Node dependencies <nl> - <nl> - # Install nvm <nl> - RUN touch . profile <nl> - RUN curl - o - https : / / raw . githubusercontent . com / creationix / nvm / v0 . 25 . 4 / install . sh | bash <nl> - # Install all versions of node that we want to test <nl> - RUN / bin / bash - l - c " nvm install 0 . 12 & & npm config set cache / tmp / npm - cache " <nl> - RUN / bin / bash - l - c " nvm install 4 & & npm config set cache / tmp / npm - cache " <nl> - RUN / bin / bash - l - c " nvm install 5 & & npm config set cache / tmp / npm - cache " <nl> - RUN / bin / bash - l - c " nvm alias default 4 " <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - <nl> - RUN mkdir / var / local / jenkins <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 4116f842ff1 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_node / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds Node interop server and client in a base image . <nl> - set - e <nl> - <nl> - mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - cd / var / local / git / grpc <nl> - <nl> - # build Node interop client & server <nl> - npm install - g node - gyp <nl> - npm install - - unsafe - perm - - build - from - source <nl> deleted file mode 100644 <nl> index b5198b46529 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_php / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # = = = = = = = = = = = = = = = = = = <nl> - # Ruby dependencies <nl> - <nl> - # Install rvm <nl> - RUN gpg - - keyserver hkp : / / keys . gnupg . net - - recv - keys 409B6B1796C275462A1703113804BB82D39DC0E3 <nl> - RUN \ curl - sSL https : / / get . rvm . io | bash - s stable <nl> - <nl> - # Install Ruby 2 . 1 <nl> - RUN / bin / bash - l - c " rvm install ruby - 2 . 1 " <nl> - RUN / bin / bash - l - c " rvm use - - default ruby - 2 . 1 " <nl> - RUN / bin / bash - l - c " echo ' gem : - - no - ri - - no - rdoc ' > ~ / . gemrc " <nl> - RUN / bin / bash - l - c " echo ' export PATH = / usr / local / rvm / bin : $ PATH ' > > ~ / . bashrc " <nl> - RUN / bin / bash - l - c " echo ' rvm - - default use ruby - 2 . 1 ' > > ~ / . bashrc " <nl> - RUN / bin / bash - l - c " gem install bundler - - no - ri - - no - rdoc " <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # PHP dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - git php5 php5 - dev phpunit unzip <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - <nl> - RUN mkdir / var / local / jenkins <nl> - <nl> - # Install composer <nl> - RUN curl - sS https : / / getcomposer . org / installer | php <nl> - RUN mv composer . phar / usr / local / bin / composer <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index e3cca085a4d . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_php / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds PHP interop server and client in a base image . <nl> - set - ex <nl> - <nl> - mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - cd / var / local / git / grpc <nl> - <nl> - make install - certs <nl> - <nl> - # gRPC core and protobuf need to be installed <nl> - make install <nl> - <nl> - ( cd src / php / ext / grpc & & phpize & & . / configure & & make ) <nl> - <nl> - ( cd third_party / protobuf & & make install ) <nl> - <nl> - ( cd src / php & & php - d extension = ext / grpc / modules / grpc . so / usr / local / bin / composer install ) <nl> - <nl> - ( cd src / php & & . / bin / generate_proto_php . sh ) <nl> deleted file mode 100644 <nl> index 8e1de51f331 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_python / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # C + + dependencies <nl> - RUN apt - get update & & apt - get - y install libgflags - dev libgtest - dev libc + + - dev clang & & apt - get clean <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - <nl> - RUN pip install coverage <nl> - RUN pip install oauth2client <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 1c7dc2bd577 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_python / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds Python interop server and client in a base image . <nl> - set - e <nl> - <nl> - mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - cd / var / local / git / grpc <nl> - tools / run_tests / run_tests . py - l python - c opt - - build_only <nl> - <nl> - # Build c + + interop client <nl> - make metrics_client - j <nl> - <nl> deleted file mode 100644 <nl> index 9d291aac583 . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_ruby / Dockerfile <nl> ppp / dev / null <nl> <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - FROM debian : jessie <nl> - <nl> - # Install Git and basic packages . <nl> - RUN apt - get update & & apt - get install - y \ <nl> - autoconf \ <nl> - autotools - dev \ <nl> - build - essential \ <nl> - bzip2 \ <nl> - ccache \ <nl> - curl \ <nl> - gcc \ <nl> - gcc - multilib \ <nl> - git \ <nl> - golang \ <nl> - gyp \ <nl> - lcov \ <nl> - libc6 \ <nl> - libc6 - dbg \ <nl> - libc6 - dev \ <nl> - libgtest - dev \ <nl> - libtool \ <nl> - make \ <nl> - perl \ <nl> - strace \ <nl> - python - dev \ <nl> - python - setuptools \ <nl> - python - yaml \ <nl> - telnet \ <nl> - unzip \ <nl> - wget \ <nl> - zip & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = <nl> - # Build profiling <nl> - RUN apt - get update & & apt - get install - y time & & apt - get clean <nl> - <nl> - # = = = = = = = = = = = = = = = = = = = = <nl> - # Python dependencies <nl> - <nl> - # Install dependencies <nl> - <nl> - RUN apt - get update & & apt - get install - y \ <nl> - python - all - dev \ <nl> - python3 - all - dev \ <nl> - python - pip <nl> - <nl> - # Install Python packages from PyPI <nl> - RUN pip install pip - - upgrade <nl> - RUN pip install virtualenv <nl> - RUN pip install futures = = 2 . 2 . 0 enum34 = = 1 . 0 . 4 protobuf = = 3 . 2 . 0 six = = 1 . 10 . 0 <nl> - <nl> - # Prepare ccache <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / gcc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / g + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / cc <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / c + + <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang <nl> - RUN ln - s / usr / bin / ccache / usr / local / bin / clang + + <nl> - <nl> - # = = = = = = = = = = = = = = = = = <nl> - # C + + dependencies <nl> - RUN apt - get update & & apt - get - y install libgflags - dev libgtest - dev libc + + - dev clang & & apt - get clean <nl> - <nl> - # Google Cloud platform API libraries <nl> - RUN apt - get update & & apt - get install - y python - pip & & apt - get clean <nl> - RUN pip install - - upgrade google - api - python - client <nl> - <nl> - <nl> - # = = = = = = = = = = = = = = = = = = <nl> - # Ruby dependencies <nl> - <nl> - # Install rvm <nl> - RUN gpg - - keyserver hkp : / / keys . gnupg . net - - recv - keys 409B6B1796C275462A1703113804BB82D39DC0E3 <nl> - RUN \ curl - sSL https : / / get . rvm . io | bash - s stable <nl> - <nl> - # Install Ruby 2 . 1 <nl> - RUN / bin / bash - l - c " rvm install ruby - 2 . 1 " <nl> - RUN / bin / bash - l - c " rvm use - - default ruby - 2 . 1 " <nl> - RUN / bin / bash - l - c " echo ' gem : - - no - ri - - no - rdoc ' > ~ / . gemrc " <nl> - RUN / bin / bash - l - c " echo ' export PATH = / usr / local / rvm / bin : $ PATH ' > > ~ / . bashrc " <nl> - RUN / bin / bash - l - c " echo ' rvm - - default use ruby - 2 . 1 ' > > ~ / . bashrc " <nl> - RUN / bin / bash - l - c " gem install bundler - - no - ri - - no - rdoc " <nl> - <nl> - # Define the default command . <nl> - CMD [ " bash " ] <nl> deleted file mode 100755 <nl> index 019f0a44e4c . . 00000000000 <nl> mmm a / tools / dockerfile / stress_test / grpc_interop_stress_ruby / build_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # Builds Ruby interop server and client in a base image . <nl> - set - e <nl> - <nl> - mkdir - p / var / local / git <nl> - git clone / var / local / jenkins / grpc / var / local / git / grpc <nl> - # clone gRPC submodules , use data from locally cloned submodules where possible <nl> - ( cd / var / local / jenkins / grpc / & & git submodule foreach ' cd / var / local / git / grpc \ <nl> - & & git submodule update - - init - - reference / var / local / jenkins / grpc / $ { name } \ <nl> - $ { name } ' ) <nl> - <nl> - # Copy service account keys if available <nl> - cp - r / var / local / jenkins / service_account $ HOME | | true <nl> - <nl> - cd / var / local / git / grpc <nl> - rvm - - default use ruby - 2 . 1 <nl> - <nl> - # Build Ruby interop client and server <nl> - ( cd src / ruby & & gem update bundler & & bundle & & rake compile ) <nl> - <nl> - # Build c + + metrics client to query the metrics from ruby stress client <nl> - make metrics_client - j <nl> - <nl> deleted file mode 100755 <nl> index 51ada6820da . . 00000000000 <nl> mmm a / tools / gcp / stress_test / run_client . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python2 . 7 <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - import datetime <nl> - import os <nl> - import re <nl> - import resource <nl> - import select <nl> - import subprocess <nl> - import sys <nl> - import time <nl> - <nl> - from stress_test_utils import EventType <nl> - from stress_test_utils import BigQueryHelper <nl> - <nl> - <nl> - # TODO ( sree ) : Write a python grpc client to directly query the metrics instead <nl> - # of calling metrics_client <nl> - def _get_qps ( metrics_cmd ) : <nl> - qps = 0 <nl> - try : <nl> - # Note : gpr_log ( ) writes even non - error messages to stderr stream . So it is <nl> - # important that we set stderr = subprocess . STDOUT <nl> - p = subprocess . Popen ( args = metrics_cmd , <nl> - stdout = subprocess . PIPE , <nl> - stderr = subprocess . STDOUT ) <nl> - retcode = p . wait ( ) <nl> - ( out_str , err_str ) = p . communicate ( ) <nl> - if retcode ! = 0 : <nl> - print ' Error in reading metrics information ' <nl> - print ' Output : ' , out_str <nl> - else : <nl> - # The overall qps is printed at the end of the line <nl> - m = re . search ( ' \ d + $ ' , out_str ) <nl> - qps = int ( m . group ( ) ) if m else 0 <nl> - except Exception as ex : <nl> - print ' Exception while reading metrics information : ' + str ( ex ) <nl> - return qps <nl> - <nl> - <nl> - def run_client ( ) : <nl> - " " " This is a wrapper around the stress test client and performs the following : <nl> - 1 ) Create the following two tables in Big Query : <nl> - ( i ) Summary table : To record events like the test started , completed <nl> - successfully or failed <nl> - ( ii ) Qps table : To periodically record the QPS sent by this client <nl> - 2 ) Start the stress test client and add a row in the Big Query summary <nl> - table <nl> - 3 ) Once every few seconds ( as specificed by the poll_interval_secs ) poll <nl> - the status of the stress test client process and perform the <nl> - following : <nl> - 3 . 1 ) If the process is still running , get the current qps by invoking <nl> - the metrics client program and add a row in the Big Query <nl> - Qps table . Sleep for a duration specified by poll_interval_secs <nl> - 3 . 2 ) If the process exited successfully , add a row in the Big Query <nl> - Summary table and exit <nl> - 3 . 3 ) If the process failed , add a row in Big Query summary table and <nl> - wait forever . <nl> - NOTE : This script typically runs inside a GKE pod which means <nl> - that the pod gets destroyed when the script exits . However , in <nl> - case the stress test client fails , we would not want the pod to <nl> - be destroyed ( since we might want to connect to the pod for <nl> - examining logs ) . This is the reason why the script waits forever <nl> - in case of failures <nl> - " " " <nl> - # Set the ' core file ' size to ' unlimited ' so that ' core ' files are generated <nl> - # if the client crashes ( Note : This is not relevant for Java and Go clients ) <nl> - resource . setrlimit ( resource . RLIMIT_CORE , <nl> - ( resource . RLIM_INFINITY , resource . RLIM_INFINITY ) ) <nl> - <nl> - env = dict ( os . environ ) <nl> - image_type = env [ ' STRESS_TEST_IMAGE_TYPE ' ] <nl> - stress_client_cmd = env [ ' STRESS_TEST_CMD ' ] . split ( ) <nl> - args_str = env [ ' STRESS_TEST_ARGS_STR ' ] <nl> - metrics_client_cmd = env [ ' METRICS_CLIENT_CMD ' ] . split ( ) <nl> - metrics_client_args_str = env [ ' METRICS_CLIENT_ARGS_STR ' ] <nl> - run_id = env [ ' RUN_ID ' ] <nl> - pod_name = env [ ' POD_NAME ' ] <nl> - logfile_name = env . get ( ' LOGFILE_NAME ' ) <nl> - poll_interval_secs = float ( env [ ' POLL_INTERVAL_SECS ' ] ) <nl> - project_id = env [ ' GCP_PROJECT_ID ' ] <nl> - dataset_id = env [ ' DATASET_ID ' ] <nl> - summary_table_id = env [ ' SUMMARY_TABLE_ID ' ] <nl> - qps_table_id = env [ ' QPS_TABLE_ID ' ] <nl> - # The following parameter is to inform us whether the stress client runs <nl> - # forever until forcefully stopped or will it naturally stop after sometime . <nl> - # This way , we know that the stress client process should not terminate ( even <nl> - # if it does with a success exit code ) and flag the termination as a failure <nl> - will_run_forever = env . get ( ' WILL_RUN_FOREVER ' , ' 1 ' ) <nl> - <nl> - bq_helper = BigQueryHelper ( run_id , image_type , pod_name , project_id , <nl> - dataset_id , summary_table_id , qps_table_id ) <nl> - bq_helper . initialize ( ) <nl> - <nl> - # Create BigQuery Dataset and Tables : Summary Table and Metrics Table <nl> - if not bq_helper . setup_tables ( ) : <nl> - print ' Error in creating BigQuery tables ' <nl> - return <nl> - <nl> - start_time = datetime . datetime . now ( ) <nl> - <nl> - logfile = None <nl> - details = ' Logging to stdout ' <nl> - if logfile_name is not None : <nl> - print ' Opening logfile : % s . . . ' % logfile_name <nl> - details = ' Logfile : % s ' % logfile_name <nl> - logfile = open ( logfile_name , ' w ' ) <nl> - <nl> - metrics_cmd = metrics_client_cmd + [ x <nl> - for x in metrics_client_args_str . split ( ) ] <nl> - stress_cmd = stress_client_cmd + [ x for x in args_str . split ( ) ] <nl> - <nl> - details = ' % s , Metrics command : % s , Stress client command : % s ' % ( <nl> - details , str ( metrics_cmd ) , str ( stress_cmd ) ) <nl> - # Update status that the test is starting ( in the status table ) <nl> - bq_helper . insert_summary_row ( EventType . STARTING , details ) <nl> - <nl> - print ' Launching process % s . . . ' % stress_cmd <nl> - stress_p = subprocess . Popen ( args = stress_cmd , <nl> - stdout = logfile , <nl> - stderr = subprocess . STDOUT ) <nl> - <nl> - qps_history = [ 1 , 1 , 1 ] # Maintain the last 3 qps readings <nl> - qps_history_idx = 0 # Index into the qps_history list <nl> - <nl> - is_running_status_written = False <nl> - is_error = False <nl> - while True : <nl> - # Check if stress_client is still running . If so , collect metrics and upload <nl> - # to BigQuery status table <nl> - # If stress_p . poll ( ) is not None , it means that the stress client terminated <nl> - if stress_p . poll ( ) is not None : <nl> - end_time = datetime . datetime . now ( ) . isoformat ( ) <nl> - event_type = EventType . SUCCESS <nl> - details = ' End time : % s ' % end_time <nl> - if will_run_forever = = ' 1 ' or stress_p . returncode ! = 0 : <nl> - event_type = EventType . FAILURE <nl> - details = ' Return code = % d . End time : % s ' % ( stress_p . returncode , <nl> - end_time ) <nl> - is_error = True <nl> - bq_helper . insert_summary_row ( event_type , details ) <nl> - print details <nl> - break <nl> - <nl> - if not is_running_status_written : <nl> - bq_helper . insert_summary_row ( EventType . RUNNING , ' ' ) <nl> - is_running_status_written = True <nl> - <nl> - # Stress client still running . Get metrics <nl> - qps = _get_qps ( metrics_cmd ) <nl> - qps_recorded_at = datetime . datetime . now ( ) . isoformat ( ) <nl> - print ' qps : % d at % s ' % ( qps , qps_recorded_at ) <nl> - <nl> - # If QPS has been zero for the last 3 iterations , flag it as error and exit <nl> - qps_history [ qps_history_idx ] = qps <nl> - qps_history_idx = ( qps_history_idx + 1 ) % len ( qps_history ) <nl> - if sum ( qps_history ) = = 0 : <nl> - details = ' QPS has been zero for the last % d seconds - as of : % s ' % ( <nl> - poll_interval_secs * 3 , qps_recorded_at ) <nl> - is_error = True <nl> - bq_helper . insert_summary_row ( EventType . FAILURE , details ) <nl> - print details <nl> - break <nl> - <nl> - # Upload qps metrics to BiqQuery <nl> - bq_helper . insert_qps_row ( qps , qps_recorded_at ) <nl> - <nl> - time . sleep ( poll_interval_secs ) <nl> - <nl> - if is_error : <nl> - print ' Waiting indefinitely . . ' <nl> - select . select ( [ ] , [ ] , [ ] ) <nl> - <nl> - print ' Completed ' <nl> - return <nl> - <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - run_client ( ) <nl> deleted file mode 100755 <nl> index 4a4da6fc8b8 . . 00000000000 <nl> mmm a / tools / gcp / stress_test / run_node . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - # This is a wrapper script that was created to help run_server . py and <nl> - # run_client . py to launch ' node js ' stress clients and stress servers <nl> - source ~ / . nvm / nvm . sh <nl> - <nl> - set - ex <nl> - <nl> - $ @ <nl> deleted file mode 100755 <nl> index 80d0567447b . . 00000000000 <nl> mmm a / tools / gcp / stress_test / run_ruby . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - # This is a wrapper script that was created to help run_server . py and <nl> - # run_client . py to launch ' node js ' stress clients and stress servers <nl> - source / etc / profile . d / rvm . sh <nl> - <nl> - set - ex <nl> - <nl> - $ @ <nl> deleted file mode 100755 <nl> index 8f47e42ef32 . . 00000000000 <nl> mmm a / tools / gcp / stress_test / run_server . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python2 . 7 <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - import datetime <nl> - import os <nl> - import resource <nl> - import select <nl> - import subprocess <nl> - import sys <nl> - import time <nl> - <nl> - from stress_test_utils import BigQueryHelper <nl> - from stress_test_utils import EventType <nl> - <nl> - <nl> - def run_server ( ) : <nl> - " " " This is a wrapper around the interop server and performs the following : <nl> - 1 ) Create a ' Summary table ' in Big Query to record events like the server <nl> - started , completed successfully or failed . NOTE : This also creates <nl> - another table called the QPS table which is currently NOT needed on the <nl> - server ( it is needed on the stress test clients ) <nl> - 2 ) Start the server process and add a row in Big Query summary table <nl> - 3 ) Wait for the server process to terminate . The server process does not <nl> - terminate unless there is an error . <nl> - If the server process terminated with a failure , add a row in Big Query <nl> - and wait forever . <nl> - NOTE : This script typically runs inside a GKE pod which means that the <nl> - pod gets destroyed when the script exits . However , in case the server <nl> - process fails , we would not want the pod to be destroyed ( since we <nl> - might want to connect to the pod for examining logs ) . This is the <nl> - reason why the script waits forever in case of failures . <nl> - " " " <nl> - # Set the ' core file ' size to ' unlimited ' so that ' core ' files are generated <nl> - # if the server crashes ( Note : This is not relevant for Java and Go servers ) <nl> - resource . setrlimit ( resource . RLIMIT_CORE , <nl> - ( resource . RLIM_INFINITY , resource . RLIM_INFINITY ) ) <nl> - <nl> - # Read the parameters from environment variables <nl> - env = dict ( os . environ ) <nl> - <nl> - run_id = env [ ' RUN_ID ' ] # The unique run id for this test <nl> - image_type = env [ ' STRESS_TEST_IMAGE_TYPE ' ] <nl> - stress_server_cmd = env [ ' STRESS_TEST_CMD ' ] . split ( ) <nl> - args_str = env [ ' STRESS_TEST_ARGS_STR ' ] <nl> - pod_name = env [ ' POD_NAME ' ] <nl> - project_id = env [ ' GCP_PROJECT_ID ' ] <nl> - dataset_id = env [ ' DATASET_ID ' ] <nl> - summary_table_id = env [ ' SUMMARY_TABLE_ID ' ] <nl> - qps_table_id = env [ ' QPS_TABLE_ID ' ] <nl> - # The following parameter is to inform us whether the server runs forever <nl> - # until forcefully stopped or will it naturally stop after sometime . <nl> - # This way , we know that the process should not terminate ( even if it does <nl> - # with a success exit code ) and flag any termination as a failure . <nl> - will_run_forever = env . get ( ' WILL_RUN_FOREVER ' , ' 1 ' ) <nl> - <nl> - logfile_name = env . get ( ' LOGFILE_NAME ' ) <nl> - <nl> - print ( ' pod_name : % s , project_id : % s , run_id : % s , dataset_id : % s , ' <nl> - ' summary_table_id : % s , qps_table_id : % s ' ) % ( pod_name , project_id , <nl> - run_id , dataset_id , <nl> - summary_table_id , <nl> - qps_table_id ) <nl> - <nl> - bq_helper = BigQueryHelper ( run_id , image_type , pod_name , project_id , <nl> - dataset_id , summary_table_id , qps_table_id ) <nl> - bq_helper . initialize ( ) <nl> - <nl> - # Create BigQuery Dataset and Tables : Summary Table and Metrics Table <nl> - if not bq_helper . setup_tables ( ) : <nl> - print ' Error in creating BigQuery tables ' <nl> - return <nl> - <nl> - start_time = datetime . datetime . now ( ) <nl> - <nl> - logfile = None <nl> - details = ' Logging to stdout ' <nl> - if logfile_name is not None : <nl> - print ' Opening log file : ' , logfile_name <nl> - logfile = open ( logfile_name , ' w ' ) <nl> - details = ' Logfile : % s ' % logfile_name <nl> - <nl> - stress_cmd = stress_server_cmd + [ x for x in args_str . split ( ) ] <nl> - <nl> - details = ' % s , Stress server command : % s ' % ( details , str ( stress_cmd ) ) <nl> - # Update status that the test is starting ( in the status table ) <nl> - bq_helper . insert_summary_row ( EventType . STARTING , details ) <nl> - <nl> - print ' Launching process % s . . . ' % stress_cmd <nl> - stress_p = subprocess . Popen ( args = stress_cmd , <nl> - stdout = logfile , <nl> - stderr = subprocess . STDOUT ) <nl> - <nl> - # Update the status to running if subprocess . Popen launched the server <nl> - if stress_p . poll ( ) is None : <nl> - bq_helper . insert_summary_row ( EventType . RUNNING , ' ' ) <nl> - <nl> - # Wait for the server process to terminate <nl> - returncode = stress_p . wait ( ) <nl> - <nl> - if will_run_forever = = ' 1 ' or returncode ! = 0 : <nl> - end_time = datetime . datetime . now ( ) . isoformat ( ) <nl> - event_type = EventType . FAILURE <nl> - details = ' Returncode : % d ; End time : % s ' % ( returncode , end_time ) <nl> - bq_helper . insert_summary_row ( event_type , details ) <nl> - print ' Waiting indefinitely . . ' <nl> - select . select ( [ ] , [ ] , [ ] ) <nl> - return returncode <nl> - <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - run_server ( ) <nl> deleted file mode 100755 <nl> index be50af31845 . . 00000000000 <nl> mmm a / tools / gcp / stress_test / stress_test_utils . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python2 . 7 <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - import datetime <nl> - import json <nl> - import os <nl> - import re <nl> - import select <nl> - import subprocess <nl> - import sys <nl> - import time <nl> - <nl> - # Import big_query_utils module <nl> - bq_utils_dir = os . path . abspath ( os . path . join ( <nl> - os . path . dirname ( __file__ ) , ' . . / utils ' ) ) <nl> - sys . path . append ( bq_utils_dir ) <nl> - import big_query_utils as bq_utils <nl> - <nl> - <nl> - class EventType : <nl> - STARTING = ' STARTING ' <nl> - RUNNING = ' RUNNING ' <nl> - SUCCESS = ' SUCCESS ' <nl> - FAILURE = ' FAILURE ' <nl> - <nl> - <nl> - class BigQueryHelper : <nl> - " " " Helper class for the stress test wrappers to interact with BigQuery . <nl> - " " " <nl> - <nl> - def __init__ ( self , run_id , image_type , pod_name , project_id , dataset_id , <nl> - summary_table_id , qps_table_id ) : <nl> - self . run_id = run_id <nl> - self . image_type = image_type <nl> - self . pod_name = pod_name <nl> - self . project_id = project_id <nl> - self . dataset_id = dataset_id <nl> - self . summary_table_id = summary_table_id <nl> - self . qps_table_id = qps_table_id <nl> - <nl> - def initialize ( self ) : <nl> - self . bq = bq_utils . create_big_query ( ) <nl> - <nl> - def setup_tables ( self ) : <nl> - return bq_utils . create_dataset ( self . bq , self . project_id , self . dataset_id ) \ <nl> - and self . __create_summary_table ( ) \ <nl> - and self . __create_qps_table ( ) <nl> - <nl> - def insert_summary_row ( self , event_type , details ) : <nl> - row_values_dict = { <nl> - ' run_id ' : self . run_id , <nl> - ' image_type ' : self . image_type , <nl> - ' pod_name ' : self . pod_name , <nl> - ' event_date ' : datetime . datetime . now ( ) . isoformat ( ) , <nl> - ' event_type ' : event_type , <nl> - ' details ' : details <nl> - } <nl> - # row_unique_id is something that uniquely identifies the row ( BigQuery uses <nl> - # it for duplicate detection ) . <nl> - row_unique_id = ' % s_ % s_ % s ' % ( self . run_id , self . pod_name , event_type ) <nl> - row = bq_utils . make_row ( row_unique_id , row_values_dict ) <nl> - return bq_utils . insert_rows ( self . bq , self . project_id , self . dataset_id , <nl> - self . summary_table_id , [ row ] ) <nl> - <nl> - def insert_qps_row ( self , qps , recorded_at ) : <nl> - row_values_dict = { <nl> - ' run_id ' : self . run_id , <nl> - ' pod_name ' : self . pod_name , <nl> - ' recorded_at ' : recorded_at , <nl> - ' qps ' : qps <nl> - } <nl> - <nl> - # row_unique_id is something that uniquely identifies the row ( BigQuery uses <nl> - # it for duplicate detection ) . <nl> - row_unique_id = ' % s_ % s_ % s ' % ( self . run_id , self . pod_name , recorded_at ) <nl> - row = bq_utils . make_row ( row_unique_id , row_values_dict ) <nl> - return bq_utils . insert_rows ( self . bq , self . project_id , self . dataset_id , <nl> - self . qps_table_id , [ row ] ) <nl> - <nl> - def check_if_any_tests_failed ( self , num_query_retries = 3 , timeout_msec = 30000 ) : <nl> - query = ( ' SELECT event_type FROM % s . % s WHERE run_id = \ ' % s \ ' AND ' <nl> - ' event_type = " % s " ' ) % ( self . dataset_id , self . summary_table_id , <nl> - self . run_id , EventType . FAILURE ) <nl> - page = None <nl> - try : <nl> - query_job = bq_utils . sync_query_job ( self . bq , self . project_id , query ) <nl> - job_id = query_job [ ' jobReference ' ] [ ' jobId ' ] <nl> - project_id = query_job [ ' jobReference ' ] [ ' projectId ' ] <nl> - page = self . bq . jobs ( ) . getQueryResults ( <nl> - projectId = project_id , <nl> - jobId = job_id , <nl> - timeoutMs = timeout_msec ) . execute ( num_retries = num_query_retries ) <nl> - <nl> - if not page [ ' jobComplete ' ] : <nl> - print ( ' TIMEOUT ERROR : The query % s timed out . Current timeout value is ' <nl> - ' % d msec . Returning False ( i . e assuming there are no failures ) ' <nl> - ) % ( query , timeout_msec ) <nl> - return False <nl> - <nl> - num_failures = int ( page [ ' totalRows ' ] ) <nl> - print ' num rows : ' , num_failures <nl> - return num_failures > 0 <nl> - except : <nl> - print ' Exception in check_if_any_tests_failed ( ) . Info : ' , sys . exc_info ( ) <nl> - print ' Query : ' , query <nl> - <nl> - def print_summary_records ( self , num_query_retries = 3 ) : <nl> - line = ' - ' * 120 <nl> - print line <nl> - print ' Summary records ' <nl> - print ' Run Id : ' , self . run_id <nl> - print ' Dataset Id : ' , self . dataset_id <nl> - print line <nl> - query = ( ' SELECT pod_name , image_type , event_type , event_date , details ' <nl> - ' FROM % s . % s WHERE run_id = \ ' % s \ ' ORDER by event_date ; ' ) % ( <nl> - self . dataset_id , self . summary_table_id , self . run_id ) <nl> - query_job = bq_utils . sync_query_job ( self . bq , self . project_id , query ) <nl> - <nl> - print ' { : < 25 } { : < 12 } { : < 12 } { : < 30 } { } ' . format ( ' Pod name ' , ' Image type ' , <nl> - ' Event type ' , ' Date ' , <nl> - ' Details ' ) <nl> - print line <nl> - page_token = None <nl> - while True : <nl> - page = self . bq . jobs ( ) . getQueryResults ( <nl> - pageToken = page_token , <nl> - * * query_job [ ' jobReference ' ] ) . execute ( num_retries = num_query_retries ) <nl> - rows = page . get ( ' rows ' , [ ] ) <nl> - for row in rows : <nl> - print ' { : < 25 } { : < 12 } { : < 12 } { : < 30 } { } ' . format ( row [ ' f ' ] [ 0 ] [ ' v ' ] , <nl> - row [ ' f ' ] [ 1 ] [ ' v ' ] , <nl> - row [ ' f ' ] [ 2 ] [ ' v ' ] , <nl> - row [ ' f ' ] [ 3 ] [ ' v ' ] , <nl> - row [ ' f ' ] [ 4 ] [ ' v ' ] ) <nl> - page_token = page . get ( ' pageToken ' ) <nl> - if not page_token : <nl> - break <nl> - <nl> - def print_qps_records ( self , num_query_retries = 3 ) : <nl> - line = ' - ' * 80 <nl> - print line <nl> - print ' QPS Summary ' <nl> - print ' Run Id : ' , self . run_id <nl> - print ' Dataset Id : ' , self . dataset_id <nl> - print line <nl> - query = ( <nl> - ' SELECT pod_name , recorded_at , qps FROM % s . % s WHERE run_id = \ ' % s \ ' ' <nl> - ' ORDER by recorded_at ; ' ) % ( self . dataset_id , self . qps_table_id , <nl> - self . run_id ) <nl> - query_job = bq_utils . sync_query_job ( self . bq , self . project_id , query ) <nl> - print ' { : < 25 } { : 30 } { } ' . format ( ' Pod name ' , ' Recorded at ' , ' Qps ' ) <nl> - print line <nl> - page_token = None <nl> - while True : <nl> - page = self . bq . jobs ( ) . getQueryResults ( <nl> - pageToken = page_token , <nl> - * * query_job [ ' jobReference ' ] ) . execute ( num_retries = num_query_retries ) <nl> - rows = page . get ( ' rows ' , [ ] ) <nl> - for row in rows : <nl> - print ' { : < 25 } { : 30 } { } ' . format ( row [ ' f ' ] [ 0 ] [ ' v ' ] , row [ ' f ' ] [ 1 ] [ ' v ' ] , <nl> - row [ ' f ' ] [ 2 ] [ ' v ' ] ) <nl> - page_token = page . get ( ' pageToken ' ) <nl> - if not page_token : <nl> - break <nl> - <nl> - def __create_summary_table ( self ) : <nl> - summary_table_schema = [ <nl> - ( ' run_id ' , ' STRING ' , ' Test run id ' ) , <nl> - ( ' image_type ' , ' STRING ' , ' Client or Server ? ' ) , <nl> - ( ' pod_name ' , ' STRING ' , ' GKE pod hosting this image ' ) , <nl> - ( ' event_date ' , ' STRING ' , ' The date of this event ' ) , <nl> - ( ' event_type ' , ' STRING ' , ' STARTING / RUNNING / SUCCESS / FAILURE ' ) , <nl> - ( ' details ' , ' STRING ' , ' Any other relevant details ' ) <nl> - ] <nl> - desc = ( ' The table that contains STARTING / RUNNING / SUCCESS / FAILURE events ' <nl> - ' for the stress test clients and servers ' ) <nl> - return bq_utils . create_table ( self . bq , self . project_id , self . dataset_id , <nl> - self . summary_table_id , summary_table_schema , <nl> - desc ) <nl> - <nl> - def __create_qps_table ( self ) : <nl> - qps_table_schema = [ <nl> - ( ' run_id ' , ' STRING ' , ' Test run id ' ) , <nl> - ( ' pod_name ' , ' STRING ' , ' GKE pod hosting this image ' ) , <nl> - ( ' recorded_at ' , ' STRING ' , ' Metrics recorded at time ' ) , <nl> - ( ' qps ' , ' INTEGER ' , ' Queries per second ' ) <nl> - ] <nl> - desc = ' The table that cointains the qps recorded at various intervals ' <nl> - return bq_utils . create_table ( self . bq , self . project_id , self . dataset_id , <nl> - self . qps_table_id , qps_table_schema , desc ) <nl> deleted file mode 100755 <nl> index a8a4aad69b4 . . 00000000000 <nl> mmm a / tools / gcp / utils / kubernetes_api . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python2 . 7 <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - import requests <nl> - import json <nl> - <nl> - _REQUEST_TIMEOUT_SECS = 10 <nl> - <nl> - <nl> - def _make_pod_config ( pod_name , image_name , container_port_list , cmd_list , <nl> - arg_list , env_dict ) : <nl> - " " " Creates a string containing the Pod defintion as required by the Kubernetes API " " " <nl> - body = { <nl> - ' kind ' : ' Pod ' , <nl> - ' apiVersion ' : ' v1 ' , <nl> - ' metadata ' : { <nl> - ' name ' : pod_name , <nl> - ' labels ' : { ' name ' : pod_name } <nl> - } , <nl> - ' spec ' : { <nl> - ' containers ' : [ <nl> - { <nl> - ' name ' : pod_name , <nl> - ' image ' : image_name , <nl> - ' ports ' : [ { ' containerPort ' : port , <nl> - ' protocol ' : ' TCP ' } <nl> - for port in container_port_list ] , <nl> - ' imagePullPolicy ' : ' Always ' <nl> - } <nl> - ] <nl> - } <nl> - } <nl> - <nl> - env_list = [ { ' name ' : k , ' value ' : v } for ( k , v ) in env_dict . iteritems ( ) ] <nl> - if len ( env_list ) > 0 : <nl> - body [ ' spec ' ] [ ' containers ' ] [ 0 ] [ ' env ' ] = env_list <nl> - <nl> - # Add the ' Command ' and ' Args ' attributes if they are passed . <nl> - # Note : <nl> - # - ' Command ' overrides the ENTRYPOINT in the Docker Image <nl> - # - ' Args ' override the CMD in Docker image ( yes , it is confusing ! ) <nl> - if len ( cmd_list ) > 0 : <nl> - body [ ' spec ' ] [ ' containers ' ] [ 0 ] [ ' command ' ] = cmd_list <nl> - if len ( arg_list ) > 0 : <nl> - body [ ' spec ' ] [ ' containers ' ] [ 0 ] [ ' args ' ] = arg_list <nl> - return json . dumps ( body ) <nl> - <nl> - <nl> - def _make_service_config ( service_name , pod_name , service_port_list , <nl> - container_port_list , is_headless ) : <nl> - " " " Creates a string containing the Service definition as required by the Kubernetes API . <nl> - <nl> - NOTE : <nl> - This creates either a Headless Service or ' LoadBalancer ' service depending on <nl> - the is_headless parameter . For Headless services , there is no ' type ' attribute <nl> - and the ' clusterIP ' attribute is set to ' None ' . Also , if the service is <nl> - Headless , Kubernetes creates DNS entries for Pods - i . e creates DNS A - records <nl> - mapping the service ' s name to the Pods ' IPs <nl> - " " " <nl> - if len ( container_port_list ) ! = len ( service_port_list ) : <nl> - print ( <nl> - ' ERROR : container_port_list and service_port_list must be of same size ' ) <nl> - return ' ' <nl> - body = { <nl> - ' kind ' : ' Service ' , <nl> - ' apiVersion ' : ' v1 ' , <nl> - ' metadata ' : { <nl> - ' name ' : service_name , <nl> - ' labels ' : { <nl> - ' name ' : service_name <nl> - } <nl> - } , <nl> - ' spec ' : { <nl> - ' ports ' : [ ] , <nl> - ' selector ' : { <nl> - ' name ' : pod_name <nl> - } <nl> - } <nl> - } <nl> - # Populate the ' ports ' list in the ' spec ' section . This maps service ports <nl> - # ( port numbers that are exposed by Kubernetes ) to container ports ( i . e port <nl> - # numbers that are exposed by your Docker image ) <nl> - for idx in range ( len ( container_port_list ) ) : <nl> - port_entry = { <nl> - ' port ' : service_port_list [ idx ] , <nl> - ' targetPort ' : container_port_list [ idx ] , <nl> - ' protocol ' : ' TCP ' <nl> - } <nl> - body [ ' spec ' ] [ ' ports ' ] . append ( port_entry ) <nl> - <nl> - # Make this either a LoadBalancer service or a headless service depending on <nl> - # the is_headless parameter <nl> - if is_headless : <nl> - body [ ' spec ' ] [ ' clusterIP ' ] = ' None ' <nl> - else : <nl> - body [ ' spec ' ] [ ' type ' ] = ' LoadBalancer ' <nl> - return json . dumps ( body ) <nl> - <nl> - <nl> - def _print_connection_error ( msg ) : <nl> - print ( ' ERROR : Connection failed . Did you remember to run Kubenetes proxy on ' <nl> - ' localhost ( i . e kubectl proxy - - port = < proxy_port > ) ? . Error : % s ' % msg ) <nl> - <nl> - <nl> - def _do_post ( post_url , api_name , request_body ) : <nl> - " " " Helper to do HTTP POST . <nl> - <nl> - Note : <nl> - 1 ) On success , Kubernetes returns a success code of 201 ( CREATED ) not 200 ( OK ) <nl> - 2 ) A response code of 509 ( CONFLICT ) is interpreted as a success code ( since <nl> - the error is most likely due to the resource already existing ) . This makes <nl> - _do_post ( ) idempotent which is semantically desirable . <nl> - " " " <nl> - is_success = True <nl> - try : <nl> - r = requests . post ( post_url , <nl> - data = request_body , <nl> - timeout = _REQUEST_TIMEOUT_SECS ) <nl> - if r . status_code = = requests . codes . conflict : <nl> - print ( ' WARN : Looks like the resource already exists . Api : % s , url : % s ' % <nl> - ( api_name , post_url ) ) <nl> - elif r . status_code ! = requests . codes . created : <nl> - print ( ' ERROR : % s API returned error . HTTP response : ( % d ) % s ' % <nl> - ( api_name , r . status_code , r . text ) ) <nl> - is_success = False <nl> - except ( requests . exceptions . Timeout , <nl> - requests . exceptions . ConnectionError ) as e : <nl> - is_success = False <nl> - _print_connection_error ( str ( e ) ) <nl> - return is_success <nl> - <nl> - <nl> - def _do_delete ( del_url , api_name ) : <nl> - " " " Helper to do HTTP DELETE . <nl> - <nl> - Note : A response code of 404 ( NOT_FOUND ) is treated as success to keep <nl> - _do_delete ( ) idempotent . <nl> - " " " <nl> - is_success = True <nl> - try : <nl> - r = requests . delete ( del_url , timeout = _REQUEST_TIMEOUT_SECS ) <nl> - if r . status_code = = requests . codes . not_found : <nl> - print ( ' WARN : The resource does not exist . Api : % s , url : % s ' % <nl> - ( api_name , del_url ) ) <nl> - elif r . status_code ! = requests . codes . ok : <nl> - print ( ' ERROR : % s API returned error . HTTP response : % s ' % <nl> - ( api_name , r . text ) ) <nl> - is_success = False <nl> - except ( requests . exceptions . Timeout , <nl> - requests . exceptions . ConnectionError ) as e : <nl> - is_success = False <nl> - _print_connection_error ( str ( e ) ) <nl> - return is_success <nl> - <nl> - <nl> - def create_service ( kube_host , kube_port , namespace , service_name , pod_name , <nl> - service_port_list , container_port_list , is_headless ) : <nl> - " " " Creates either a Headless Service or a LoadBalancer Service depending <nl> - on the is_headless parameter . <nl> - " " " <nl> - post_url = ' http : / / % s : % d / api / v1 / namespaces / % s / services ' % ( <nl> - kube_host , kube_port , namespace ) <nl> - request_body = _make_service_config ( service_name , pod_name , service_port_list , <nl> - container_port_list , is_headless ) <nl> - return _do_post ( post_url , ' Create Service ' , request_body ) <nl> - <nl> - <nl> - def create_pod ( kube_host , kube_port , namespace , pod_name , image_name , <nl> - container_port_list , cmd_list , arg_list , env_dict ) : <nl> - " " " Creates a Kubernetes Pod . <nl> - <nl> - Note that it is generally NOT considered a good practice to directly create <nl> - Pods . Typically , the recommendation is to create ' Controllers ' to create and <nl> - manage Pods ' lifecycle . Currently Kubernetes only supports ' Replication <nl> - Controller ' which creates a configurable number of ' identical Replicas ' of <nl> - Pods and automatically restarts any Pods in case of failures ( for eg : Machine <nl> - failures in Kubernetes ) . This makes it less flexible for our test use cases <nl> - where we might want slightly different set of args to each Pod . Hence we <nl> - directly create Pods and not care much about Kubernetes failures since those <nl> - are very rare . <nl> - " " " <nl> - post_url = ' http : / / % s : % d / api / v1 / namespaces / % s / pods ' % ( kube_host , kube_port , <nl> - namespace ) <nl> - request_body = _make_pod_config ( pod_name , image_name , container_port_list , <nl> - cmd_list , arg_list , env_dict ) <nl> - return _do_post ( post_url , ' Create Pod ' , request_body ) <nl> - <nl> - <nl> - def delete_service ( kube_host , kube_port , namespace , service_name ) : <nl> - del_url = ' http : / / % s : % d / api / v1 / namespaces / % s / services / % s ' % ( <nl> - kube_host , kube_port , namespace , service_name ) <nl> - return _do_delete ( del_url , ' Delete Service ' ) <nl> - <nl> - <nl> - def delete_pod ( kube_host , kube_port , namespace , pod_name ) : <nl> - del_url = ' http : / / % s : % d / api / v1 / namespaces / % s / pods / % s ' % ( kube_host , kube_port , <nl> - namespace , pod_name ) <nl> - return _do_delete ( del_url , ' Delete Pod ' ) <nl> - <nl> - <nl> - def create_pod_and_service ( kube_host , kube_port , namespace , pod_name , <nl> - image_name , container_port_list , cmd_list , arg_list , <nl> - env_dict , is_headless_service ) : <nl> - " " " A helper function that creates a pod and a service ( if pod creation was successful ) . " " " <nl> - is_success = create_pod ( kube_host , kube_port , namespace , pod_name , image_name , <nl> - container_port_list , cmd_list , arg_list , env_dict ) <nl> - if not is_success : <nl> - print ' Error in creating Pod ' <nl> - return False <nl> - <nl> - is_success = create_service ( <nl> - kube_host , <nl> - kube_port , <nl> - namespace , <nl> - pod_name , # Use pod_name for service <nl> - pod_name , <nl> - container_port_list , # Service port list same as container port list <nl> - container_port_list , <nl> - is_headless_service ) <nl> - if not is_success : <nl> - print ' Error in creating Service ' <nl> - return False <nl> - <nl> - print ' Successfully created the pod / service % s ' % pod_name <nl> - return True <nl> - <nl> - <nl> - def delete_pod_and_service ( kube_host , kube_port , namespace , pod_name ) : <nl> - " " " A helper function that calls delete_pod and delete_service " " " <nl> - is_success = delete_pod ( kube_host , kube_port , namespace , pod_name ) <nl> - if not is_success : <nl> - print ' Error in deleting pod % s ' % pod_name <nl> - return False <nl> - <nl> - # Note : service name assumed to the the same as pod name <nl> - is_success = delete_service ( kube_host , kube_port , namespace , pod_name ) <nl> - if not is_success : <nl> - print ' Error in deleting service % s ' % pod_name <nl> - return False <nl> - <nl> - print ' Successfully deleted the Pod / Service : % s ' % pod_name <nl> - return True <nl> deleted file mode 100755 <nl> index 22d81db8bcd . . 00000000000 <nl> mmm a / tools / jenkins / run_interop_stress . sh <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env bash <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - # <nl> - # This script is invoked by Jenkins and runs interop test suite . <nl> - set - ex <nl> - <nl> - # Enter the gRPC repo root <nl> - cd $ ( dirname $ 0 ) / . . / . . <nl> - <nl> - tools / run_tests / run_stress_tests . py - l all - s all - j 12 $ @ | | true <nl> deleted file mode 100755 <nl> index 4eea02118e5 . . 00000000000 <nl> mmm a / tools / run_tests / run_stress_tests . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python <nl> - # Copyright 2015 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - " " " Run stress test in C + + " " " <nl> - <nl> - from __future__ import print_function <nl> - <nl> - import argparse <nl> - import atexit <nl> - import itertools <nl> - import json <nl> - import multiprocessing <nl> - import os <nl> - import re <nl> - import subprocess <nl> - import sys <nl> - import tempfile <nl> - import time <nl> - import uuid <nl> - import six <nl> - <nl> - import python_utils . dockerjob as dockerjob <nl> - import python_utils . jobset as jobset <nl> - <nl> - # Docker doesn ' t clean up after itself , so we do it on exit . <nl> - atexit . register ( lambda : subprocess . call ( [ ' stty ' , ' echo ' ] ) ) <nl> - <nl> - ROOT = os . path . abspath ( os . path . join ( os . path . dirname ( sys . argv [ 0 ] ) , ' . . / . . ' ) ) <nl> - os . chdir ( ROOT ) <nl> - <nl> - _DEFAULT_SERVER_PORT = 8080 <nl> - _DEFAULT_METRICS_PORT = 8081 <nl> - _DEFAULT_TEST_CASES = ' empty_unary : 20 , large_unary : 20 , client_streaming : 20 , server_streaming : 20 , empty_stream : 20 ' <nl> - _DEFAULT_NUM_CHANNELS_PER_SERVER = 5 <nl> - _DEFAULT_NUM_STUBS_PER_CHANNEL = 10 <nl> - <nl> - # 15 mins default <nl> - _DEFAULT_TEST_DURATION_SECS = 900 <nl> - <nl> - class CXXLanguage : <nl> - <nl> - def __init__ ( self ) : <nl> - self . client_cwd = None <nl> - self . server_cwd = None <nl> - self . safename = ' cxx ' <nl> - <nl> - def client_cmd ( self , args ) : <nl> - return [ ' bins / opt / stress_test ' ] + args <nl> - <nl> - def server_cmd ( self , args ) : <nl> - return [ ' bins / opt / interop_server ' ] + args <nl> - <nl> - def global_env ( self ) : <nl> - return { } <nl> - <nl> - def __str__ ( self ) : <nl> - return ' c + + ' <nl> - <nl> - <nl> - _LANGUAGES = { ' c + + ' : CXXLanguage ( ) , } <nl> - <nl> - # languages supported as cloud_to_cloud servers <nl> - _SERVERS = [ ' c + + ' ] <nl> - <nl> - DOCKER_WORKDIR_ROOT = ' / var / local / git / grpc ' <nl> - <nl> - <nl> - def docker_run_cmdline ( cmdline , image , docker_args = [ ] , cwd = None , environ = None ) : <nl> - " " " Wraps given cmdline array to create ' docker run ' cmdline from it . " " " <nl> - docker_cmdline = [ ' docker ' , ' run ' , ' - i ' , ' - - rm = true ' ] <nl> - <nl> - # turn environ into - e docker args <nl> - if environ : <nl> - for k , v in environ . items ( ) : <nl> - docker_cmdline + = [ ' - e ' , ' % s = % s ' % ( k , v ) ] <nl> - <nl> - # set working directory <nl> - workdir = DOCKER_WORKDIR_ROOT <nl> - if cwd : <nl> - workdir = os . path . join ( workdir , cwd ) <nl> - docker_cmdline + = [ ' - w ' , workdir ] <nl> - <nl> - docker_cmdline + = docker_args + [ image ] + cmdline <nl> - return docker_cmdline <nl> - <nl> - <nl> - def bash_login_cmdline ( cmdline ) : <nl> - " " " Creates bash - l - c cmdline from args list . " " " <nl> - # Use login shell : <nl> - # * rvm and nvm require it <nl> - # * makes error messages clearer if executables are missing <nl> - return [ ' bash ' , ' - l ' , ' - c ' , ' ' . join ( cmdline ) ] <nl> - <nl> - <nl> - def _job_kill_handler ( job ) : <nl> - if job . _spec . container_name : <nl> - dockerjob . docker_kill ( job . _spec . container_name ) <nl> - # When the job times out and we decide to kill it , <nl> - # we need to wait a before restarting the job <nl> - # to prevent " container name already in use " error . <nl> - # TODO ( jtattermusch ) : figure out a cleaner way to to this . <nl> - time . sleep ( 2 ) <nl> - <nl> - <nl> - def cloud_to_cloud_jobspec ( language , <nl> - test_cases , <nl> - server_addresses , <nl> - test_duration_secs , <nl> - num_channels_per_server , <nl> - num_stubs_per_channel , <nl> - metrics_port , <nl> - docker_image = None ) : <nl> - " " " Creates jobspec for cloud - to - cloud interop test " " " <nl> - cmdline = bash_login_cmdline ( language . client_cmd ( [ <nl> - ' - - test_cases = % s ' % test_cases , ' - - server_addresses = % s ' % <nl> - server_addresses , ' - - test_duration_secs = % s ' % test_duration_secs , <nl> - ' - - num_stubs_per_channel = % s ' % num_stubs_per_channel , <nl> - ' - - num_channels_per_server = % s ' % num_channels_per_server , <nl> - ' - - metrics_port = % s ' % metrics_port <nl> - ] ) ) <nl> - print ( cmdline ) <nl> - cwd = language . client_cwd <nl> - environ = language . global_env ( ) <nl> - if docker_image : <nl> - container_name = dockerjob . random_name ( ' interop_client_ % s ' % <nl> - language . safename ) <nl> - cmdline = docker_run_cmdline ( <nl> - cmdline , <nl> - image = docker_image , <nl> - environ = environ , <nl> - cwd = cwd , <nl> - docker_args = [ ' - - net = host ' , ' - - name ' , container_name ] ) <nl> - cwd = None <nl> - <nl> - test_job = jobset . JobSpec ( cmdline = cmdline , <nl> - cwd = cwd , <nl> - environ = environ , <nl> - shortname = ' cloud_to_cloud : % s : % s_server : stress_test ' % ( <nl> - language , server_name ) , <nl> - timeout_seconds = test_duration_secs * 2 , <nl> - flake_retries = 0 , <nl> - timeout_retries = 0 , <nl> - kill_handler = _job_kill_handler ) <nl> - test_job . container_name = container_name <nl> - return test_job <nl> - <nl> - <nl> - def server_jobspec ( language , docker_image , test_duration_secs ) : <nl> - " " " Create jobspec for running a server " " " <nl> - container_name = dockerjob . random_name ( ' interop_server_ % s ' % <nl> - language . safename ) <nl> - cmdline = bash_login_cmdline ( language . server_cmd ( [ ' - - port = % s ' % <nl> - _DEFAULT_SERVER_PORT ] ) ) <nl> - environ = language . global_env ( ) <nl> - docker_cmdline = docker_run_cmdline ( <nl> - cmdline , <nl> - image = docker_image , <nl> - cwd = language . server_cwd , <nl> - environ = environ , <nl> - docker_args = [ ' - p ' , str ( _DEFAULT_SERVER_PORT ) , ' - - name ' , container_name ] ) <nl> - <nl> - server_job = jobset . JobSpec ( cmdline = docker_cmdline , <nl> - environ = environ , <nl> - shortname = ' interop_server_ % s ' % language , <nl> - timeout_seconds = test_duration_secs * 3 ) <nl> - server_job . container_name = container_name <nl> - return server_job <nl> - <nl> - <nl> - def build_interop_stress_image_jobspec ( language , tag = None ) : <nl> - " " " Creates jobspec for building stress test docker image for a language " " " <nl> - if not tag : <nl> - tag = ' grpc_interop_stress_ % s : % s ' % ( language . safename , uuid . uuid4 ( ) ) <nl> - env = { ' INTEROP_IMAGE ' : tag , <nl> - ' BASE_NAME ' : ' grpc_interop_stress_ % s ' % language . safename } <nl> - build_job = jobset . JobSpec ( cmdline = [ ' tools / run_tests / dockerize / build_interop_stress_image . sh ' ] , <nl> - environ = env , <nl> - shortname = ' build_docker_ % s ' % ( language ) , <nl> - timeout_seconds = 30 * 60 ) <nl> - build_job . tag = tag <nl> - return build_job <nl> - <nl> - argp = argparse . ArgumentParser ( description = ' Run stress tests . ' ) <nl> - argp . add_argument ( ' - l ' , <nl> - ' - - language ' , <nl> - choices = [ ' all ' ] + sorted ( _LANGUAGES ) , <nl> - nargs = ' + ' , <nl> - default = [ ' all ' ] , <nl> - help = ' Clients to run . ' ) <nl> - argp . add_argument ( ' - j ' , ' - - jobs ' , default = multiprocessing . cpu_count ( ) , type = int ) <nl> - argp . add_argument ( <nl> - ' - s ' , <nl> - ' - - server ' , <nl> - choices = [ ' all ' ] + sorted ( _SERVERS ) , <nl> - action = ' append ' , <nl> - help = ' Run cloud_to_cloud servers in a separate docker ' + ' image . ' , <nl> - default = [ ] ) <nl> - argp . add_argument ( <nl> - ' - - override_server ' , <nl> - action = ' append ' , <nl> - type = lambda kv : kv . split ( ' = ' ) , <nl> - help = <nl> - ' Use servername = HOST : PORT to explicitly specify a server . E . g . ' <nl> - ' csharp = localhost : 50000 ' , <nl> - default = [ ] ) <nl> - argp . add_argument ( ' - - test_duration_secs ' , <nl> - help = ' The duration of the test in seconds ' , <nl> - default = _DEFAULT_TEST_DURATION_SECS ) <nl> - <nl> - args = argp . parse_args ( ) <nl> - <nl> - servers = set ( <nl> - s <nl> - for s in itertools . chain . from_iterable ( _SERVERS if x = = ' all ' else [ x ] <nl> - for x in args . server ) ) <nl> - <nl> - languages = set ( _LANGUAGES [ l ] for l in itertools . chain . from_iterable ( <nl> - six . iterkeys ( _LANGUAGES ) if x = = ' all ' else [ x ] for x in args . language ) ) <nl> - <nl> - docker_images = { } <nl> - # languages for which to build docker images <nl> - languages_to_build = set ( <nl> - _LANGUAGES [ k ] <nl> - for k in set ( [ str ( l ) for l in languages ] + [ s for s in servers ] ) ) <nl> - build_jobs = [ ] <nl> - for l in languages_to_build : <nl> - job = build_interop_stress_image_jobspec ( l ) <nl> - docker_images [ str ( l ) ] = job . tag <nl> - build_jobs . append ( job ) <nl> - <nl> - if build_jobs : <nl> - jobset . message ( ' START ' , ' Building interop docker images . ' , do_newline = True ) <nl> - num_failures , _ = jobset . run ( build_jobs , <nl> - newline_on_success = True , <nl> - maxjobs = args . jobs ) <nl> - if num_failures = = 0 : <nl> - jobset . message ( ' SUCCESS ' , <nl> - ' All docker images built successfully . ' , <nl> - do_newline = True ) <nl> - else : <nl> - jobset . message ( ' FAILED ' , <nl> - ' Failed to build interop docker images . ' , <nl> - do_newline = True ) <nl> - for image in six . itervalues ( docker_images ) : <nl> - dockerjob . remove_image ( image , skip_nonexistent = True ) <nl> - sys . exit ( 1 ) <nl> - <nl> - # Start interop servers . <nl> - server_jobs = { } <nl> - server_addresses = { } <nl> - try : <nl> - for s in servers : <nl> - lang = str ( s ) <nl> - spec = server_jobspec ( _LANGUAGES [ lang ] , docker_images . get ( lang ) , args . test_duration_secs ) <nl> - job = dockerjob . DockerJob ( spec ) <nl> - server_jobs [ lang ] = job <nl> - server_addresses [ lang ] = ( ' localhost ' , <nl> - job . mapped_port ( _DEFAULT_SERVER_PORT ) ) <nl> - <nl> - jobs = [ ] <nl> - <nl> - for server in args . override_server : <nl> - server_name = server [ 0 ] <nl> - ( server_host , server_port ) = server [ 1 ] . split ( ' : ' ) <nl> - server_addresses [ server_name ] = ( server_host , server_port ) <nl> - <nl> - for server_name , server_address in server_addresses . items ( ) : <nl> - ( server_host , server_port ) = server_address <nl> - for language in languages : <nl> - test_job = cloud_to_cloud_jobspec ( <nl> - language , <nl> - _DEFAULT_TEST_CASES , <nl> - ( ' % s : % s ' % ( server_host , server_port ) ) , <nl> - args . test_duration_secs , <nl> - _DEFAULT_NUM_CHANNELS_PER_SERVER , <nl> - _DEFAULT_NUM_STUBS_PER_CHANNEL , <nl> - _DEFAULT_METRICS_PORT , <nl> - docker_image = docker_images . get ( str ( language ) ) ) <nl> - jobs . append ( test_job ) <nl> - <nl> - if not jobs : <nl> - print ( ' No jobs to run . ' ) <nl> - for image in six . itervalues ( docker_images ) : <nl> - dockerjob . remove_image ( image , skip_nonexistent = True ) <nl> - sys . exit ( 1 ) <nl> - <nl> - num_failures , resultset = jobset . run ( jobs , <nl> - newline_on_success = True , <nl> - maxjobs = args . jobs ) <nl> - if num_failures : <nl> - jobset . message ( ' FAILED ' , ' Some tests failed ' , do_newline = True ) <nl> - else : <nl> - jobset . message ( ' SUCCESS ' , ' All tests passed ' , do_newline = True ) <nl> - <nl> - finally : <nl> - # Check if servers are still running . <nl> - for server , job in server_jobs . items ( ) : <nl> - if not job . is_running ( ) : <nl> - print ( ' Server " % s " has exited prematurely . ' % server ) <nl> - <nl> - dockerjob . finish_jobs ( [ j for j in six . itervalues ( server_jobs ) ] ) <nl> - <nl> - for image in six . itervalues ( docker_images ) : <nl> - print ( ' Removing docker image % s ' % image ) <nl> - dockerjob . remove_image ( image ) <nl> deleted file mode 100644 <nl> index cc82b875cdd . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / README . md <nl> ppp / dev / null <nl> <nl> - Running Stress tests on Google Container Engine <nl> - = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - <nl> - # # # * * Glossary * * : <nl> - * GCP : Google Cloud Platform <nl> - * GCE : Google Compute Engine <nl> - * GKE : Google Container Engine <nl> - * GCP console : https : / / console . cloud . google . com <nl> - <nl> - # # # * * Setup Instructions * * <nl> - # # # # * On GCP : * <nl> - 1 . Login to GCP with your Google account ( for example , your @ gmail account ) at https : / / cloud . google . com . If do not have a Google account , you will have to create an account first . <nl> - 2 . Enable billing on Google cloud platform . Instructions [ here ] ( https : / / cloud . google . com / container - engine / docs / before - you - begin ) ( see the ' * Enable billing * ' section ) . <nl> - 3 . Create a Project from the [ GCP console ] ( https : / / console . cloud . google . com ) . i . e Click on the project dropdown box on the top right ( to the right of the search box ) and click ' * Create a project * ' option . <nl> - 4 . Enable the Container Engine API . Instructions [ here ] ( https : / / cloud . google . com / container - engine / docs / before - you - begin ) ( See the ' * Enable the Container Engine API * ’ section ) . Alternatively , you can do the following : <nl> - - Click on the ' * Products & Services * ' icon on the top left ( i . e the icon with three small horizontal bars ) and select ' * API Manager * ' <nl> - - Select the ' * Container Engine API * ' under ' * Google Cloud APIs * ' on the main page . Note that you might have to click on ' * More * ' under ' * Google Cloud APIs * ' to see the ' * Container Engine API * ' link <nl> - - Click on the ' * Enable * ' button . If the API is already enabled , the button ' s label would be ' * Disable * ' instead ( do NOT click the button if its label is ' * Disable * ' ) <nl> - 5 . Create a Cluster from the GCP console . <nl> - - Go to the Container Engine section from GCP console i . e : Click on the ' * Products & Services * ' icon on the top left ( i . e the icon with three small horizontal bars ) and click on ' * Container Engine * ' <nl> - - Click ' * Create Container Cluster * ' and follow the instructions . <nl> - - The instructions for ' Name / Zone / MachineType ' etc are [ here ] ( https : / / cloud . google . com / container - engine / docs / clusters / operations ) ( * * NOTE * * : The page also has instructions to setting up default clusters and configuring ` kubectl ` . We will be doing that later ) <nl> - - For the cluster size , a smaller size of < 10 GCE instances is good enough for our use cases - assuming that we are planning to run a reasonably small number of stress client instances . For the machine type , something like ' 2 vCPUs 7 . 5 GB ' ( available in the drop down box ) should be good enough . <nl> - - * * IMPORTANT * * : Before hitting the ' * Create * ' button , click on ' * More * ' link just above the ' * Create * ' button and Select ' * Enabled * ' for BigQuery , ' * Enabled * ' for Cloud Platform and ' * Read / Write * ' for Cloud User Accounts . <nl> - - Create the cluster by clicking ' * Create * ' button . <nl> - <nl> - # # # # * On your machine * ( or the machine from which stress tests on GKE are launched ) : <nl> - 1 . You need a working gRPC repository on your machine . If you do not have it , clone the grpc repository from github ( https : / / github . com / grpc / grpc ) and follow the instructions [ here ] ( https : / / github . com / grpc / grpc / blob / master / INSTALL . md ) <nl> - 2 . Install Docker . Instructions [ here ] ( https : / / docs . docker . com / engine / installation / ) <nl> - 3 . Install Google Cloud SDK . Instructions [ here ] ( https : / / cloud . google . com / sdk / ) . This installs the ` gcloud ` tool <nl> - 4 . Install ` kubectl ` , Kubernetes command line tool using ` gcloud ` . i . e <nl> - - ` $ gcloud components update kubectl ` <nl> - - NOTE : If you are running this from a GCE instance , the command may fail with the following error : <nl> - ` ` ` <nl> - You cannot perform this action because this Cloud SDK installation is <nl> - managed by an external package manager . If you would like to get the <nl> - latest version , please see our main download page at : <nl> - <nl> - https : / / developers . google . com / cloud / sdk / <nl> - <nl> - ERROR : ( gcloud . components . update ) The component manager is disabled for this installation <nl> - ` ` ` <nl> - - - If so , you will have to manually install Cloud SDK by doing the following <nl> - ` ` ` shell <nl> - $ # The following installs latest Cloud SDK and updates the PATH <nl> - $ # ( Accept the default values when prompted ) <nl> - $ curl https : / / sdk . cloud . google . com | bash <nl> - $ exec - l $ SHELL <nl> - $ # Set the defaults . Pick the default GCE credentials when prompted ( The service account <nl> - $ # name will have a name similar to : " xxx - compute @ developer . gserviceaccount . com " ) <nl> - $ gcloud init <nl> - ` ` ` <nl> - <nl> - 5 . Install Google python client apis : <nl> - - ` ‘ $ sudo pip install - - upgrade google - api - python - client ’ ` <nl> - - * * Note * * : Do ` $ sudo apt - get install python - pip ` ( or ` $ easy_install - U pip ` ) if you do not have pip <nl> - 6 . Install the ` requests ` Python package if you don ’ t have it already by doing ` sudo pip install requests ` . More details regarding ` requests ` package are [ here ] ( http : / / docs . python - requests . org / en / master / user / install / ) <nl> - 7 . Set the ` gcloud ` defaults : See the instructions [ here ] ( https : / / cloud . google . com / container - engine / docs / before - you - begin ) under " * Set gcloud defaults * " section ) <nl> - - Make sure you also fetch the cluster credentials for ` kubectl ` command to use . I . e ` $ gcloud container clusters get - credentials CLUSTER_NAME ` <nl> - <nl> - # # # * * Launching Stress tests * * <nl> - <nl> - The stress tests are launched by the following script ( path is relative to GRPC root directory ) : <nl> - ` tools / run_tests / stress_test / run_stress_tests_on_gke . py ` <nl> - <nl> - You can find out more details by using the ` - - help ` flag . <nl> - - ` < grpc_root_dir > $ tools / run_tests / stress_test / run_on_gke . py - - help ` <nl> - <nl> - > * * Example * * <nl> - > ` ` ` bash <nl> - > $ # Change to the grpc root directory <nl> - > $ cd $ GRPC_ROOT <nl> - > $ tools / run_tests / stress_test / run_on_gke . py - - project_id = sree - gce - - config_file = tools / run_tests / stress_test / configs / opt . json <nl> - > ` ` ` <nl> - <nl> - > The above runs the stress test on GKE under the project ` sree - gce ` in the default cluster ( that you set by ` gcloud ` command earlier ) . The test settings ( like number of client instances , servers , the parmeters to pass , test cases etc ) are all loaded from the config file ` $ GRPC_ROOT / tools / run_tests / stress_test / opt . json ` <nl> deleted file mode 100644 <nl> index 9f079beebc0 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / STRESS_CLIENT_SPEC . md <nl> ppp / dev / null <nl> <nl> - Stress Test client Specification <nl> - = = = = = = = = = = = = = = = = = = = = = = = = = <nl> - This document specifies the features a stress test client should implement in order to work with the stress testing framework . The stress test clients are executed against the existing interop test servers . <nl> - <nl> - * * Requirements * * <nl> mmmmmmmmmmmmmmm <nl> - * * 1 . * * A stress test client should be able to repeatedly execute one or more of the existing ' interop test cases ' . It may just be a wrapper around the existing interop test client . The exact command line arguments the client should support are listed in _Table 1_ below . <nl> - <nl> - * * 2 . * * The stress test client must implement a metrics server defined by _ [ metrics . proto ] ( https : / / github . com / grpc / grpc / blob / master / src / proto / grpc / testing / metrics . proto ) _ and must expose _qps_ as a ` Long ` - valued Gauge . The client can track the overall _qps_ in one Gauge or in multiple Gauges ( for example : One per Channel or Stub ) . <nl> - The framework periodically queries the _qps_ by calling the ` GetAllGauges ( ) ` method ( the framework assumes that all the returned Gauges are _qps_ Gauges and adds them up to determine the final qps ) and uses this to determine if the stress test client is running or crashed or stalled . <nl> - > * Note : * In this context , the term _ * * qps * * _ means _interop test cases per second_ ( not _messages per second_ or _rpc calls per second_ ) <nl> - <nl> - <nl> - * * Table 1 : * * Command line arguments that should be supported by the stress test client . <nl> - <nl> - > _ * * Note * * The current C + + [ stress client ] ( https : / / github . com / grpc / grpc / blob / master / test / cpp / interop / stress_test . cc ) supports more flags than those listed here but those flags will soon be deprecated . _ <nl> - <nl> - Parameter | Description <nl> mmmmmmmmmmmmmmmmmmmmm - - | mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> - ` - - server_addresses ` | The stress client should accept a list of server addresses in the following format : < br > ` ` ` < name_1 > : < port_1 > , < name_2 > : < port_2 > . . < name_N > : < port_N > ` ` ` < br > _Note : _ ` < name > ` can be either server name or IP address . < br > < br > _Type : _ string < br > _default : _ ` ` ` localhost : 8080 ` ` ` < br > _Example : _ ` ` foo . foobar . com : 8080 , bar . foobar . com : 8080 ` ` < br > < br > Currently , the stress test framework only passes one server address to the client . <nl> - ` - - test_cases ` | List of test cases along with the relative weights in the following format : < br > ` < testcase_1 : w_1 > , < testcase_2 : w_2 > . . . < testcase_n : w_n > ` . < br > The test cases names are the same as those currently used by the interop clients < br > < br > _Type : _ string < br > _Example : _ ` empty_unary : 20 , large_unary : 10 , empty_stream : 70 ` < br > ( The stress client would then make ` empty_unary ` calls 20 % of the time , ` large_unary ` calls 10 % of the time and ` empty_stream ` calls 70 % of the time . ) < br > _Note : _ The weights need not add up to 100 . <nl> - ` - - test_duration_secs ` | The test duration in seconds . A value of - 1 means that the test should run forever until forcefully terminated . < br > _Type : _ int < br > _default : _ - 1 <nl> - ` - - num_channels_per_server ` | Number of channels ( i . e connections ) to each server . < br > _Type : _ int < br > _default : _ 1 < br > < br > _Note : _ Unfortunately , the term ` channel ` is used differently in ` grpc - java ` and ` C based grpc ` . In this context , this really means " number of connections to the server " <nl> - ` - - num_stubs_per_channel ` | Number of client stubs per each connection to server . < br > _Type : _ int < br > _default : _ 1 <nl> - ` - - metrics_port ` | The port at which the stress client exposes [ QPS metrics ] ( https : / / github . com / grpc / grpc / blob / master / src / proto / grpc / testing / metrics . proto ) . < br > _Type : _ int < br > _default : _ 8081 <nl> deleted file mode 100755 <nl> index e424fcfd99b . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / cleanup_docker_images . sh <nl> ppp / dev / null <nl> <nl> - # ! / bin / bash <nl> - # Copyright 2017 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - for img in ` docker images | grep \ < none \ > | awk ' { print $ 3 } ' ` ; do docker rmi - f $ img ; done <nl> - <nl> deleted file mode 100644 <nl> index 7ae11ccbf1e . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / asan . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_cxx_asan " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " asan " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 120 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_client_asan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ " / var / local / git / grpc / bins / asan / stress_test " ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / asan / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_server_asan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / asan / interop_server " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - asan " : { <nl> - " serverTemplate " : " cxx_server_asan " , <nl> - " dockerImage " : " grpc_stress_cxx_asan " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - asan " : { <nl> - " clientTemplate " : " cxx_client_asan " , <nl> - " dockerImage " : " grpc_stress_cxx_asan " , <nl> - " numInstances " : 5 , <nl> - " serverPodSpec " : " stress - server - asan " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8003 , <nl> - " datasetIdNamePrefix " : " stress_test_asan " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index c438e08964c . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / csharp . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_csharp " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_csharp " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 100 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " , <nl> - " deadline_secs " : 60 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " csharp_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " mono " , <nl> - " / var / local / git / grpc / src / csharp / Grpc . IntegrationTesting . StressClient / bin / Debug / Grpc . IntegrationTesting . StressClient . exe " <nl> - ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / opt / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " csharp_server " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ <nl> - " mono " , <nl> - " / var / local / git / grpc / src / csharp / Grpc . IntegrationTesting . Server / bin / Debug / Grpc . IntegrationTesting . Server . exe " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - csharp " : { <nl> - " serverTemplate " : " csharp_server " , <nl> - " dockerImage " : " grpc_stress_csharp " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - csharp " : { <nl> - " clientTemplate " : " csharp_client " , <nl> - " dockerImage " : " grpc_stress_csharp " , <nl> - " numInstances " : 10 , <nl> - " serverPodSpec " : " stress - server - csharp " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 100 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8009 , <nl> - " datasetIdNamePrefix " : " stress_test_csharp " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index f1b2b523d3c . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / go . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_go " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_go " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " go_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " go " , <nl> - " run " , <nl> - " / go / src / google . golang . org / grpc / stress / client / main . go " <nl> - ] , <nl> - " metricsClientCmd " : [ <nl> - " go " , <nl> - " run " , <nl> - " / go / src / google . golang . org / grpc / stress / metrics_client / main . go " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " go_server " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ <nl> - " go " , <nl> - " run " , <nl> - " / go / src / google . golang . org / grpc / interop / server / server . go " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " go - stress - server " : { <nl> - " serverTemplate " : " go_server " , <nl> - " dockerImage " : " grpc_stress_go " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " go - stress - client " : { <nl> - " clientTemplate " : " go_client " , <nl> - " dockerImage " : " grpc_stress_go " , <nl> - " numInstances " : 15 , <nl> - " serverPodSpec " : " go - stress - server " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8007 , <nl> - " datasetIdNamePrefix " : " stress_test_go " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index 92af63c6b55 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / java . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_java " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_java " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 100 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " , <nl> - " deadline_secs " : 60 <nl> - } , <nl> - " env " : { <nl> - " STRESSTEST_CLIENT_OPTS " : " - Xmx3g - Xms3g - XX : NewSize = 1500m - XX : MaxNewSize = 1500m - XX : + UseConcMarkSweepGC " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " java_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " / var / local / git / grpc - java / interop - testing / build / install / grpc - interop - testing / bin / stresstest - client " <nl> - ] , <nl> - " metricsClientCmd " : [ <nl> - " / var / local / git / grpc / bins / opt / metrics_client " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 , <nl> - " use_tls " : " false " <nl> - } , <nl> - " env " : { <nl> - " TEST_SERVER_OPTS " : " - Xmx3g - Xms3g - XX : NewSize = 1500m - XX : MaxNewSize = 1500m - XX : + UseConcMarkSweepGC " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " java_server " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ <nl> - " / var / local / git / grpc - java / interop - testing / build / install / grpc - interop - testing / bin / test - server " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " java - stress - server " : { <nl> - " serverTemplate " : " java_server " , <nl> - " dockerImage " : " grpc_stress_java " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " java - stress - client " : { <nl> - " clientTemplate " : " java_client " , <nl> - " dockerImage " : " grpc_stress_java " , <nl> - " numInstances " : 10 , <nl> - " serverPodSpec " : " java - stress - server " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 100 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8008 , <nl> - " datasetIdNamePrefix " : " stress_test_java " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index 094c1236e71 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / node - cxx . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_cxx_opt " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " opt " <nl> - } , <nl> - " grpc_stress_node " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_node " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " node_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_node . sh " , <nl> - " node " , <nl> - " / var / local / git / grpc / src / node / stress / stress_client . js " <nl> - ] , <nl> - " metricsClientCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_node . sh " , <nl> - " node " , <nl> - " / var / local / git / grpc / src / node / stress / metrics_client . js " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_server_opt " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / opt / interop_server " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - cxx - opt " : { <nl> - " serverTemplate " : " cxx_server_opt " , <nl> - " dockerImage " : " grpc_stress_cxx_opt " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - node " : { <nl> - " clientTemplate " : " node_client " , <nl> - " dockerImage " : " grpc_stress_node " , <nl> - " numInstances " : 20 , <nl> - " serverPodSpec " : " stress - server - cxx - opt " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8006 , <nl> - " datasetIdNamePrefix " : " stress_test_node_cxx_opt " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index 85eb9e00031 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / node . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_node " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_node " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " node_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_node . sh " , <nl> - " node " , <nl> - " / var / local / git / grpc / src / node / stress / stress_client . js " <nl> - ] , <nl> - " metricsClientCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_node . sh " , <nl> - " node " , <nl> - " / var / local / git / grpc / src / node / stress / metrics_client . js " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " node_server " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_node . sh " , <nl> - " node " , <nl> - " / var / local / git / grpc / src / node / interop / interop_server . js " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " node - stress - server " : { <nl> - " serverTemplate " : " node_server " , <nl> - " dockerImage " : " grpc_stress_node " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " node - stress - client " : { <nl> - " clientTemplate " : " node_client " , <nl> - " dockerImage " : " grpc_stress_node " , <nl> - " numInstances " : 15 , <nl> - " serverPodSpec " : " node - stress - server " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8005 , <nl> - " datasetIdNamePrefix " : " stress_test_node " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index fcb3678c02f . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / opt - tsan - asan . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_cxx_opt " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " opt " <nl> - } , <nl> - " grpc_stress_cxx_tsan " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " tsan " <nl> - } , <nl> - " grpc_stress_cxx_asan " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " asan " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_client_opt " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ " / var / local / git / grpc / bins / opt / stress_test " ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / opt / metrics_client " ] <nl> - } , <nl> - " cxx_client_tsan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ " / var / local / git / grpc / bins / tsan / stress_test " ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / tsan / metrics_client " ] <nl> - } , <nl> - " cxx_client_asan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ " / var / local / git / grpc / bins / asan / stress_test " ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / asan / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_server_opt " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / opt / interop_server " ] <nl> - } , <nl> - " cxx_server_tsan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / tsan / interop_server " ] <nl> - } , <nl> - " cxx_server_asan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / asan / interop_server " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - opt " : { <nl> - " serverTemplate " : " cxx_server_opt " , <nl> - " dockerImage " : " grpc_stress_cxx_opt " , <nl> - " numInstances " : 1 <nl> - } , <nl> - " stress - server - tsan " : { <nl> - " serverTemplate " : " cxx_server_tsan " , <nl> - " dockerImage " : " grpc_stress_cxx_tsan " , <nl> - " numInstances " : 1 <nl> - } , <nl> - " stress - server - asan " : { <nl> - " serverTemplate " : " cxx_server_asan " , <nl> - " dockerImage " : " grpc_stress_cxx_asan " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - opt " : { <nl> - " clientTemplate " : " cxx_client_opt " , <nl> - " dockerImage " : " grpc_stress_cxx_opt " , <nl> - " numInstances " : 5 , <nl> - " serverPodSpec " : " stress - server - opt " <nl> - } , <nl> - " stress - client - tsan " : { <nl> - " clientTemplate " : " cxx_client_tsan " , <nl> - " dockerImage " : " grpc_stress_cxx_tsan " , <nl> - " numInstances " : 10 , <nl> - " serverPodSpec " : " stress - server - tsan " <nl> - } , <nl> - " stress - client - asan " : { <nl> - " clientTemplate " : " cxx_client_asan " , <nl> - " dockerImage " : " grpc_stress_cxx_asan " , <nl> - " numInstances " : 10 , <nl> - " serverPodSpec " : " stress - server - asan " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8004 , <nl> - " datasetIdNamePrefix " : " stress_test_opt_tsan " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> deleted file mode 100644 <nl> index 5e0e930d453 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / opt . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_cxx_opt " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " opt " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_client_opt " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ " / var / local / git / grpc / bins / opt / stress_test " ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / opt / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_server_opt " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / opt / interop_server " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - opt " : { <nl> - " serverTemplate " : " cxx_server_opt " , <nl> - " dockerImage " : " grpc_stress_cxx_opt " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - opt " : { <nl> - " clientTemplate " : " cxx_client_opt " , <nl> - " dockerImage " : " grpc_stress_cxx_opt " , <nl> - " numInstances " : 15 , <nl> - " serverPodSpec " : " stress - server - opt " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8001 , <nl> - " datasetIdNamePrefix " : " stress_test_opt " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index 03254b368c8 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / php - cxx . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_cxx_opt " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " opt " <nl> - } , <nl> - " grpc_stress_php " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_php " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " php_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " / var / local / git / grpc / src / php / bin / stress_client . sh " <nl> - ] , <nl> - " metricsClientCmd " : [ <nl> - " php " , <nl> - " / var / local / git / grpc / src / php / tests / interop / metrics_client . php " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_server_opt " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / opt / interop_server " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - cxx - php " : { <nl> - " serverTemplate " : " cxx_server_opt " , <nl> - " dockerImage " : " grpc_stress_cxx_opt " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - php " : { <nl> - " clientTemplate " : " php_client " , <nl> - " dockerImage " : " grpc_stress_php " , <nl> - " numInstances " : 20 , <nl> - " serverPodSpec " : " stress - server - cxx - php " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8010 , <nl> - " datasetIdNamePrefix " : " stress_test_php_cxx_opt " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index 4f85de1d5f6 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / python . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_python " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_python " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } , <nl> - " env " : { <nl> - " PYTHONPATH " : " / var / local / git / grpc / src / python / gens : / var / local / git / grpc / src / python / grpcio " , <nl> - " LD_LIBRARY_PATH " : " / var / local / git / grpc / libs / opt " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " python_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " python " , <nl> - " / var / local / git / grpc / src / python / grpcio / tests / stress / client . py " <nl> - ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / opt / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } , <nl> - " env " : { <nl> - " PYTHONPATH " : " / var / local / git / grpc / src / python / gens : / var / local / git / grpc / src / python / grpcio " , <nl> - " LD_LIBRARY_PATH " : " / var / local / git / grpc / libs / opt " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " python_server " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ <nl> - " python " , <nl> - " / var / local / git / grpc / src / python / grpcio / tests / interop / server . py " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " python - stress - server " : { <nl> - " serverTemplate " : " python_server " , <nl> - " dockerImage " : " grpc_stress_python " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " python - stress - client " : { <nl> - " clientTemplate " : " python_client " , <nl> - " dockerImage " : " grpc_stress_python " , <nl> - " numInstances " : 5 , <nl> - " serverPodSpec " : " python - stress - server " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8011 , <nl> - " datasetIdNamePrefix " : " stress_test_python " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index 7e2afcbb69e . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / ruby . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_ruby " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_ruby " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 60 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " ruby_client " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_ruby . sh " , <nl> - " ruby " , <nl> - " / var / local / git / grpc / src / ruby / stress / stress_client . rb " <nl> - ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / opt / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " ruby_server " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ <nl> - " / var / local / git / grpc / tools / gcp / stress_test / run_ruby . sh " , <nl> - " ruby " , <nl> - " / var / local / git / grpc / src / ruby / pb / test / server . rb " <nl> - ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - ruby " : { <nl> - " serverTemplate " : " ruby_server " , <nl> - " dockerImage " : " grpc_stress_ruby " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - ruby " : { <nl> - " clientTemplate " : " ruby_client " , <nl> - " dockerImage " : " grpc_stress_ruby " , <nl> - " numInstances " : 10 , <nl> - " serverPodSpec " : " stress - server - ruby " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8001 , <nl> - " datasetIdNamePrefix " : " stress_test_ruby " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100644 <nl> index abc759c79da . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / configs / tsan . json <nl> ppp / dev / null <nl> <nl> - { <nl> - " dockerImages " : { <nl> - " grpc_stress_cxx_tsan " : { <nl> - " buildScript " : " tools / run_tests / dockerize / build_interop_stress_image . sh " , <nl> - " dockerFileDir " : " grpc_interop_stress_cxx " , <nl> - " buildType " : " tsan " <nl> - } <nl> - } , <nl> - <nl> - " clientTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_client . py " , <nl> - " pollIntervalSecs " : 120 , <nl> - " clientArgs " : { <nl> - " num_channels_per_server " : 5 , <nl> - " num_stubs_per_channel " : 10 , <nl> - " test_cases " : " empty_unary : 1 , large_unary : 1 , client_streaming : 1 , server_streaming : 1 , empty_stream : 1 " , <nl> - " metrics_port " : 8081 <nl> - } , <nl> - " metricsPort " : 8081 , <nl> - " metricsArgs " : { <nl> - " metrics_server_address " : " localhost : 8081 " , <nl> - " total_only " : " true " <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_client_tsan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressClientCmd " : [ " / var / local / git / grpc / bins / tsan / stress_test " ] , <nl> - " metricsClientCmd " : [ " / var / local / git / grpc / bins / tsan / metrics_client " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " serverTemplates " : { <nl> - " baseTemplates " : { <nl> - " default " : { <nl> - " wrapperScriptPath " : " / var / local / git / grpc / tools / gcp / stress_test / run_server . py " , <nl> - " serverPort " : 8080 , <nl> - " serverArgs " : { <nl> - " port " : 8080 <nl> - } <nl> - } <nl> - } , <nl> - " templates " : { <nl> - " cxx_server_tsan " : { <nl> - " baseTemplate " : " default " , <nl> - " stressServerCmd " : [ " / var / local / git / grpc / bins / tsan / interop_server " ] <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " testMatrix " : { <nl> - " serverPodSpecs " : { <nl> - " stress - server - tsan " : { <nl> - " serverTemplate " : " cxx_server_tsan " , <nl> - " dockerImage " : " grpc_stress_cxx_tsan " , <nl> - " numInstances " : 1 <nl> - } <nl> - } , <nl> - <nl> - " clientPodSpecs " : { <nl> - " stress - client - tsan " : { <nl> - " clientTemplate " : " cxx_client_tsan " , <nl> - " dockerImage " : " grpc_stress_cxx_tsan " , <nl> - " numInstances " : 5 , <nl> - " serverPodSpec " : " stress - server - tsan " <nl> - } <nl> - } <nl> - } , <nl> - <nl> - " globalSettings " : { <nl> - " buildDockerImages " : true , <nl> - " pollIntervalSecs " : 60 , <nl> - " testDurationSecs " : 7200 , <nl> - " kubernetesProxyPort " : 8002 , <nl> - " datasetIdNamePrefix " : " stress_test_tsan " , <nl> - " summaryTableId " : " summary " , <nl> - " qpsTableId " : " qps " , <nl> - " podWarmupSecs " : 60 <nl> - } <nl> - } <nl> - <nl> deleted file mode 100755 <nl> index 6f4ada2f4fd . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / print_summary . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python <nl> - # Copyright 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - import argparse <nl> - import os <nl> - import sys <nl> - <nl> - stress_test_utils_dir = os . path . abspath ( os . path . join ( <nl> - os . path . dirname ( __file__ ) , ' . . / . . / gcp / stress_test ' ) ) <nl> - sys . path . append ( stress_test_utils_dir ) <nl> - from stress_test_utils import BigQueryHelper <nl> - <nl> - argp = argparse . ArgumentParser ( <nl> - description = ' Print summary tables ' , <nl> - formatter_class = argparse . ArgumentDefaultsHelpFormatter ) <nl> - argp . add_argument ( ' - - gcp_project_id ' , <nl> - required = True , <nl> - help = ' The Google Cloud Platform Project Id ' ) <nl> - argp . add_argument ( ' - - dataset_id ' , type = str , required = True ) <nl> - argp . add_argument ( ' - - run_id ' , type = str , required = True ) <nl> - argp . add_argument ( ' - - summary_table_id ' , type = str , default = ' summary ' ) <nl> - argp . add_argument ( ' - - qps_table_id ' , type = str , default = ' qps ' ) <nl> - argp . add_argument ( ' - - summary_only ' , action = ' store_true ' , default = True ) <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - args = argp . parse_args ( ) <nl> - bq_helper = BigQueryHelper ( args . run_id , ' ' , ' ' , args . gcp_project_id , <nl> - args . dataset_id , args . summary_table_id , <nl> - args . qps_table_id ) <nl> - bq_helper . initialize ( ) <nl> - if not args . summary_only : <nl> - bq_helper . print_qps_records ( ) <nl> - bq_helper . print_summary_records ( ) <nl> deleted file mode 100755 <nl> index b190ebde7a4 . . 00000000000 <nl> mmm a / tools / run_tests / stress_test / run_on_gke . py <nl> ppp / dev / null <nl> <nl> - # ! / usr / bin / env python <nl> - # Copyright 2015 - 2016 , Google Inc . <nl> - # All rights reserved . <nl> - # <nl> - # Redistribution and use in source and binary forms , with or without <nl> - # modification , are permitted provided that the following conditions are <nl> - # met : <nl> - # <nl> - # * Redistributions of source code must retain the above copyright <nl> - # notice , this list of conditions and the following disclaimer . <nl> - # * Redistributions in binary form must reproduce the above <nl> - # copyright notice , this list of conditions and the following disclaimer <nl> - # in the documentation and / or other materials provided with the <nl> - # distribution . <nl> - # * Neither the name of Google Inc . nor the names of its <nl> - # contributors may be used to endorse or promote products derived from <nl> - # this software without specific prior written permission . <nl> - # <nl> - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - # " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - # LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - # A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - # SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - # LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - # DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - # THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - # ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - # OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - from __future__ import print_function <nl> - <nl> - import argparse <nl> - import datetime <nl> - import json <nl> - import os <nl> - import subprocess <nl> - import sys <nl> - import time <nl> - <nl> - stress_test_utils_dir = os . path . abspath ( os . path . join ( <nl> - os . path . dirname ( __file__ ) , ' . . / . . / gcp / stress_test ' ) ) <nl> - sys . path . append ( stress_test_utils_dir ) <nl> - from stress_test_utils import BigQueryHelper <nl> - <nl> - kubernetes_api_dir = os . path . abspath ( os . path . join ( <nl> - os . path . dirname ( __file__ ) , ' . . / . . / gcp / utils ' ) ) <nl> - sys . path . append ( kubernetes_api_dir ) <nl> - <nl> - import kubernetes_api <nl> - <nl> - <nl> - class GlobalSettings : <nl> - <nl> - def __init__ ( self , gcp_project_id , build_docker_images , <nl> - test_poll_interval_secs , test_duration_secs , <nl> - kubernetes_proxy_port , dataset_id_prefix , summary_table_id , <nl> - qps_table_id , pod_warmup_secs ) : <nl> - self . gcp_project_id = gcp_project_id <nl> - self . build_docker_images = build_docker_images <nl> - self . test_poll_interval_secs = test_poll_interval_secs <nl> - self . test_duration_secs = test_duration_secs <nl> - self . kubernetes_proxy_port = kubernetes_proxy_port <nl> - self . dataset_id_prefix = dataset_id_prefix <nl> - self . summary_table_id = summary_table_id <nl> - self . qps_table_id = qps_table_id <nl> - self . pod_warmup_secs = pod_warmup_secs <nl> - <nl> - <nl> - class ClientTemplate : <nl> - " " " Contains all the common settings that are used by a stress client " " " <nl> - <nl> - def __init__ ( self , name , stress_client_cmd , metrics_client_cmd , metrics_port , <nl> - wrapper_script_path , poll_interval_secs , client_args_dict , <nl> - metrics_args_dict , will_run_forever , env_dict ) : <nl> - self . name = name <nl> - self . stress_client_cmd = stress_client_cmd <nl> - self . metrics_client_cmd = metrics_client_cmd <nl> - self . metrics_port = metrics_port <nl> - self . wrapper_script_path = wrapper_script_path <nl> - self . poll_interval_secs = poll_interval_secs <nl> - self . client_args_dict = client_args_dict <nl> - self . metrics_args_dict = metrics_args_dict <nl> - self . will_run_forever = will_run_forever <nl> - self . env_dict = env_dict <nl> - <nl> - <nl> - class ServerTemplate : <nl> - " " " Contains all the common settings used by a stress server " " " <nl> - <nl> - def __init__ ( self , name , server_cmd , wrapper_script_path , server_port , <nl> - server_args_dict , will_run_forever , env_dict ) : <nl> - self . name = name <nl> - self . server_cmd = server_cmd <nl> - self . wrapper_script_path = wrapper_script_path <nl> - self . server_port = server_port <nl> - self . server_args_dict = server_args_dict <nl> - self . will_run_forever = will_run_forever <nl> - self . env_dict = env_dict <nl> - <nl> - <nl> - class DockerImage : <nl> - " " " Represents properties of a Docker image . Provides methods to build the <nl> - image and push it to GKE registry <nl> - " " " <nl> - <nl> - def __init__ ( self , gcp_project_id , image_name , build_script_path , <nl> - dockerfile_dir , build_type ) : <nl> - " " " Args : <nl> - <nl> - image_name : The docker image name <nl> - tag_name : The additional tag name . This is the name used when pushing the <nl> - docker image to GKE registry <nl> - build_script_path : The path to the build script that builds this docker <nl> - image <nl> - dockerfile_dir : The name of the directory under <nl> - ' < grpc_root > / tools / dockerfile ' that contains the dockerfile <nl> - " " " <nl> - self . image_name = image_name <nl> - self . gcp_project_id = gcp_project_id <nl> - self . build_script_path = build_script_path <nl> - self . dockerfile_dir = dockerfile_dir <nl> - self . build_type = build_type <nl> - self . tag_name = self . _make_tag_name ( gcp_project_id , image_name ) <nl> - <nl> - def _make_tag_name ( self , project_id , image_name ) : <nl> - return ' gcr . io / % s / % s ' % ( project_id , image_name ) <nl> - <nl> - def build_image ( self ) : <nl> - print ( ' Building docker image : % s ( tag : % s ) ' % ( self . image_name , <nl> - self . tag_name ) ) <nl> - os . environ [ ' INTEROP_IMAGE ' ] = self . image_name <nl> - os . environ [ ' INTEROP_IMAGE_REPOSITORY_TAG ' ] = self . tag_name <nl> - os . environ [ ' BASE_NAME ' ] = self . dockerfile_dir <nl> - os . environ [ ' BUILD_TYPE ' ] = self . build_type <nl> - print ( ' DEBUG : path : ' , self . build_script_path ) <nl> - if subprocess . call ( args = [ self . build_script_path ] ) ! = 0 : <nl> - print ( ' Error in building the Docker image ' ) <nl> - return False <nl> - return True <nl> - <nl> - def push_to_gke_registry ( self ) : <nl> - cmd = [ ' gcloud ' , ' docker ' , ' push ' , self . tag_name ] <nl> - print ( ' Pushing % s to the GKE registry . . ' % self . tag_name ) <nl> - if subprocess . call ( args = cmd ) ! = 0 : <nl> - print ( ' Error in pushing the image % s to the GKE registry ' % <nl> - self . tag_name ) <nl> - return False <nl> - return True <nl> - <nl> - <nl> - class ServerPodSpec : <nl> - " " " Contains the information required to launch server pods . " " " <nl> - <nl> - def __init__ ( self , name , server_template , docker_image , num_instances ) : <nl> - self . name = name <nl> - self . template = server_template <nl> - self . docker_image = docker_image <nl> - self . num_instances = num_instances <nl> - <nl> - def pod_names ( self ) : <nl> - " " " Return a list of names of server pods to create . " " " <nl> - return [ ' % s - % d ' % ( self . name , i ) for i in range ( 1 , self . num_instances + 1 ) ] <nl> - <nl> - def server_addresses ( self ) : <nl> - " " " Return string of server addresses in the following format : <nl> - ' < server_pod_name_1 > : < server_port > , < server_pod_name_2 > : < server_port > . . . ' <nl> - " " " <nl> - return ' , ' . join ( [ ' % s : % d ' % ( pod_name , self . template . server_port ) <nl> - for pod_name in self . pod_names ( ) ] ) <nl> - <nl> - <nl> - class ClientPodSpec : <nl> - " " " Contains the information required to launch client pods " " " <nl> - <nl> - def __init__ ( self , name , client_template , docker_image , num_instances , <nl> - server_addresses ) : <nl> - self . name = name <nl> - self . template = client_template <nl> - self . docker_image = docker_image <nl> - self . num_instances = num_instances <nl> - self . server_addresses = server_addresses <nl> - <nl> - def pod_names ( self ) : <nl> - " " " Return a list of names of client pods to create " " " <nl> - return [ ' % s - % d ' % ( self . name , i ) for i in range ( 1 , self . num_instances + 1 ) ] <nl> - <nl> - # The client args in the template do not have server addresses . This function <nl> - # adds the server addresses and returns the updated client args <nl> - def get_client_args_dict ( self ) : <nl> - args_dict = self . template . client_args_dict . copy ( ) <nl> - args_dict [ ' server_addresses ' ] = self . server_addresses <nl> - return args_dict <nl> - <nl> - <nl> - class Gke : <nl> - " " " Class that has helper methods to interact with GKE " " " <nl> - <nl> - class KubernetesProxy : <nl> - " " " Class to start a proxy on localhost to talk to the Kubernetes API server " " " <nl> - <nl> - def __init__ ( self , port ) : <nl> - cmd = [ ' kubectl ' , ' proxy ' , ' - - port = % d ' % port ] <nl> - self . p = subprocess . Popen ( args = cmd ) <nl> - time . sleep ( 2 ) <nl> - print ( ' \ nStarted kubernetes proxy on port : % d ' % port ) <nl> - <nl> - def __del__ ( self ) : <nl> - if self . p is not None : <nl> - print ( ' Shutting down Kubernetes proxy . . ' ) <nl> - self . p . kill ( ) <nl> - <nl> - def __init__ ( self , project_id , run_id , dataset_id , summary_table_id , <nl> - qps_table_id , kubernetes_port ) : <nl> - self . project_id = project_id <nl> - self . run_id = run_id <nl> - self . dataset_id = dataset_id <nl> - self . summary_table_id = summary_table_id <nl> - self . qps_table_id = qps_table_id <nl> - <nl> - # The environment variables we would like to pass to every pod ( both client <nl> - # and server ) launched in GKE <nl> - self . gke_env = { <nl> - ' RUN_ID ' : self . run_id , <nl> - ' GCP_PROJECT_ID ' : self . project_id , <nl> - ' DATASET_ID ' : self . dataset_id , <nl> - ' SUMMARY_TABLE_ID ' : self . summary_table_id , <nl> - ' QPS_TABLE_ID ' : self . qps_table_id <nl> - } <nl> - <nl> - self . kubernetes_port = kubernetes_port <nl> - # Start kubernetes proxy <nl> - self . kubernetes_proxy = Gke . KubernetesProxy ( kubernetes_port ) <nl> - <nl> - def _args_dict_to_str ( self , args_dict ) : <nl> - return ' ' . join ( ' - - % s = % s ' % ( k , args_dict [ k ] ) for k in args_dict . keys ( ) ) <nl> - <nl> - def launch_servers ( self , server_pod_spec ) : <nl> - is_success = True <nl> - <nl> - # The command to run inside the container is the wrapper script ( which then <nl> - # launches the actual server ) <nl> - container_cmd = server_pod_spec . template . wrapper_script_path <nl> - <nl> - # The parameters to the wrapper script ( defined in <nl> - # server_pod_spec . template . wrapper_script_path ) are are injected into the <nl> - # container via environment variables <nl> - server_env = self . gke_env . copy ( ) <nl> - server_env . update ( server_pod_spec . template . env_dict ) <nl> - server_env . update ( { <nl> - ' STRESS_TEST_IMAGE_TYPE ' : ' SERVER ' , <nl> - ' STRESS_TEST_CMD ' : server_pod_spec . template . server_cmd , <nl> - ' STRESS_TEST_ARGS_STR ' : self . _args_dict_to_str ( <nl> - server_pod_spec . template . server_args_dict ) , <nl> - ' WILL_RUN_FOREVER ' : str ( server_pod_spec . template . will_run_forever ) <nl> - } ) <nl> - <nl> - for pod_name in server_pod_spec . pod_names ( ) : <nl> - server_env [ ' POD_NAME ' ] = pod_name <nl> - print ( ' Creating server : % s ' % pod_name ) <nl> - is_success = kubernetes_api . create_pod_and_service ( <nl> - ' localhost ' , <nl> - self . kubernetes_port , <nl> - ' default ' , # Use ' default ' namespace <nl> - pod_name , <nl> - server_pod_spec . docker_image . tag_name , <nl> - [ server_pod_spec . template . server_port ] , # Ports to expose on the pod <nl> - [ container_cmd ] , <nl> - [ ] , # Args list is empty since we are passing all args via env variables <nl> - server_env , <nl> - True # Headless = True for server to that GKE creates a DNS record for pod_name <nl> - ) <nl> - if not is_success : <nl> - print ( ' Error in launching server : % s ' % pod_name ) <nl> - break <nl> - <nl> - if is_success : <nl> - print ( ' Successfully created server ( s ) ' ) <nl> - <nl> - return is_success <nl> - <nl> - def launch_clients ( self , client_pod_spec ) : <nl> - is_success = True <nl> - <nl> - # The command to run inside the container is the wrapper script ( which then <nl> - # launches the actual stress client ) <nl> - container_cmd = client_pod_spec . template . wrapper_script_path <nl> - <nl> - # The parameters to the wrapper script ( defined in <nl> - # client_pod_spec . template . wrapper_script_path ) are are injected into the <nl> - # container via environment variables <nl> - client_env = self . gke_env . copy ( ) <nl> - client_env . update ( client_pod_spec . template . env_dict ) <nl> - client_env . update ( { <nl> - ' STRESS_TEST_IMAGE_TYPE ' : ' CLIENT ' , <nl> - ' STRESS_TEST_CMD ' : client_pod_spec . template . stress_client_cmd , <nl> - ' STRESS_TEST_ARGS_STR ' : self . _args_dict_to_str ( <nl> - client_pod_spec . get_client_args_dict ( ) ) , <nl> - ' METRICS_CLIENT_CMD ' : client_pod_spec . template . metrics_client_cmd , <nl> - ' METRICS_CLIENT_ARGS_STR ' : self . _args_dict_to_str ( <nl> - client_pod_spec . template . metrics_args_dict ) , <nl> - ' POLL_INTERVAL_SECS ' : str ( client_pod_spec . template . poll_interval_secs ) , <nl> - ' WILL_RUN_FOREVER ' : str ( client_pod_spec . template . will_run_forever ) <nl> - } ) <nl> - <nl> - for pod_name in client_pod_spec . pod_names ( ) : <nl> - client_env [ ' POD_NAME ' ] = pod_name <nl> - print ( ' Creating client : % s ' % pod_name ) <nl> - is_success = kubernetes_api . create_pod_and_service ( <nl> - ' localhost ' , <nl> - self . kubernetes_port , <nl> - ' default ' , # default namespace , <nl> - pod_name , <nl> - client_pod_spec . docker_image . tag_name , <nl> - [ client_pod_spec . template . metrics_port ] , # Ports to expose on the pod <nl> - [ container_cmd ] , <nl> - [ ] , # Empty args list since all args are passed via env variables <nl> - client_env , <nl> - True # Client is a headless service ( no need for an external ip ) <nl> - ) <nl> - <nl> - if not is_success : <nl> - print ( ' Error in launching client % s ' % pod_name ) <nl> - break <nl> - <nl> - if is_success : <nl> - print ( ' Successfully created all client ( s ) ' ) <nl> - <nl> - return is_success <nl> - <nl> - def _delete_pods ( self , pod_name_list ) : <nl> - is_success = True <nl> - for pod_name in pod_name_list : <nl> - print ( ' Deleting % s ' % pod_name ) <nl> - is_success = kubernetes_api . delete_pod_and_service ( <nl> - ' localhost ' , <nl> - self . kubernetes_port , <nl> - ' default ' , # default namespace <nl> - pod_name ) <nl> - <nl> - if not is_success : <nl> - print ( ' Error in deleting pod % s ' % pod_name ) <nl> - break <nl> - <nl> - if is_success : <nl> - print ( ' Successfully deleted all pods ' ) <nl> - <nl> - return is_success <nl> - <nl> - def delete_servers ( self , server_pod_spec ) : <nl> - return self . _delete_pods ( server_pod_spec . pod_names ( ) ) <nl> - <nl> - def delete_clients ( self , client_pod_spec ) : <nl> - return self . _delete_pods ( client_pod_spec . pod_names ( ) ) <nl> - <nl> - <nl> - class Config : <nl> - <nl> - def __init__ ( self , config_filename , gcp_project_id ) : <nl> - print ( ' Loading configuration . . . ' ) <nl> - config_dict = self . _load_config ( config_filename ) <nl> - <nl> - self . global_settings = self . _parse_global_settings ( config_dict , <nl> - gcp_project_id ) <nl> - self . docker_images_dict = self . _parse_docker_images ( <nl> - config_dict , self . global_settings . gcp_project_id ) <nl> - self . client_templates_dict = self . _parse_client_templates ( config_dict ) <nl> - self . server_templates_dict = self . _parse_server_templates ( config_dict ) <nl> - self . server_pod_specs_dict = self . _parse_server_pod_specs ( <nl> - config_dict , self . docker_images_dict , self . server_templates_dict ) <nl> - self . client_pod_specs_dict = self . _parse_client_pod_specs ( <nl> - config_dict , self . docker_images_dict , self . client_templates_dict , <nl> - self . server_pod_specs_dict ) <nl> - print ( ' Loaded Configuaration . ' ) <nl> - <nl> - def _parse_global_settings ( self , config_dict , gcp_project_id ) : <nl> - global_settings_dict = config_dict [ ' globalSettings ' ] <nl> - return GlobalSettings ( gcp_project_id , <nl> - global_settings_dict [ ' buildDockerImages ' ] , <nl> - global_settings_dict [ ' pollIntervalSecs ' ] , <nl> - global_settings_dict [ ' testDurationSecs ' ] , <nl> - global_settings_dict [ ' kubernetesProxyPort ' ] , <nl> - global_settings_dict [ ' datasetIdNamePrefix ' ] , <nl> - global_settings_dict [ ' summaryTableId ' ] , <nl> - global_settings_dict [ ' qpsTableId ' ] , <nl> - global_settings_dict [ ' podWarmupSecs ' ] ) <nl> - <nl> - def _parse_docker_images ( self , config_dict , gcp_project_id ) : <nl> - " " " Parses the ' dockerImages ' section of the config file and returns a <nl> - Dictionary of ' DockerImage ' objects keyed by docker image names " " " <nl> - docker_images_dict = { } <nl> - <nl> - docker_config_dict = config_dict [ ' dockerImages ' ] <nl> - for image_name in docker_config_dict . keys ( ) : <nl> - build_script_path = docker_config_dict [ image_name ] [ ' buildScript ' ] <nl> - dockerfile_dir = docker_config_dict [ image_name ] [ ' dockerFileDir ' ] <nl> - build_type = docker_config_dict [ image_name ] . get ( ' buildType ' , ' opt ' ) <nl> - docker_images_dict [ image_name ] = DockerImage ( gcp_project_id , image_name , <nl> - build_script_path , <nl> - dockerfile_dir , build_type ) <nl> - return docker_images_dict <nl> - <nl> - def _parse_client_templates ( self , config_dict ) : <nl> - " " " Parses the ' clientTemplates ' section of the config file and returns a <nl> - Dictionary of ' ClientTemplate ' objects keyed by client template names . <nl> - <nl> - Note : The ' baseTemplates ' sub section of the config file contains templates <nl> - with default values and the ' templates ' sub section contains the actual <nl> - client templates ( which refer to the base template name to use for default <nl> - values ) . <nl> - " " " <nl> - client_templates_dict = { } <nl> - <nl> - templates_dict = config_dict [ ' clientTemplates ' ] [ ' templates ' ] <nl> - base_templates_dict = config_dict [ ' clientTemplates ' ] . get ( ' baseTemplates ' , <nl> - { } ) <nl> - for template_name in templates_dict . keys ( ) : <nl> - # temp_dict is a temporary dictionary that merges base template dictionary <nl> - # and client template dictionary ( with client template dictionary values <nl> - # overriding base template values ) <nl> - temp_dict = { } <nl> - <nl> - base_template_name = templates_dict [ template_name ] . get ( ' baseTemplate ' ) <nl> - if not base_template_name is None : <nl> - temp_dict = base_templates_dict [ base_template_name ] . copy ( ) <nl> - <nl> - temp_dict . update ( templates_dict [ template_name ] ) <nl> - <nl> - # Create and add ClientTemplate object to the final client_templates_dict <nl> - stress_client_cmd = ' ' . join ( temp_dict [ ' stressClientCmd ' ] ) <nl> - metrics_client_cmd = ' ' . join ( temp_dict [ ' metricsClientCmd ' ] ) <nl> - client_templates_dict [ template_name ] = ClientTemplate ( <nl> - template_name , stress_client_cmd , metrics_client_cmd , <nl> - temp_dict [ ' metricsPort ' ] , temp_dict [ ' wrapperScriptPath ' ] , <nl> - temp_dict [ ' pollIntervalSecs ' ] , temp_dict [ ' clientArgs ' ] . copy ( ) , <nl> - temp_dict [ ' metricsArgs ' ] . copy ( ) , temp_dict . get ( ' willRunForever ' , 1 ) , <nl> - temp_dict . get ( ' env ' , { } ) . copy ( ) ) <nl> - <nl> - return client_templates_dict <nl> - <nl> - def _parse_server_templates ( self , config_dict ) : <nl> - " " " Parses the ' serverTemplates ' section of the config file and returns a <nl> - Dictionary of ' serverTemplate ' objects keyed by server template names . <nl> - <nl> - Note : The ' baseTemplates ' sub section of the config file contains templates <nl> - with default values and the ' templates ' sub section contains the actual <nl> - server templates ( which refer to the base template name to use for default <nl> - values ) . <nl> - " " " <nl> - server_templates_dict = { } <nl> - <nl> - templates_dict = config_dict [ ' serverTemplates ' ] [ ' templates ' ] <nl> - base_templates_dict = config_dict [ ' serverTemplates ' ] . get ( ' baseTemplates ' , <nl> - { } ) <nl> - <nl> - for template_name in templates_dict . keys ( ) : <nl> - # temp_dict is a temporary dictionary that merges base template dictionary <nl> - # and server template dictionary ( with server template dictionary values <nl> - # overriding base template values ) <nl> - temp_dict = { } <nl> - <nl> - base_template_name = templates_dict [ template_name ] . get ( ' baseTemplate ' ) <nl> - if not base_template_name is None : <nl> - temp_dict = base_templates_dict [ base_template_name ] . copy ( ) <nl> - <nl> - temp_dict . update ( templates_dict [ template_name ] ) <nl> - <nl> - # Create and add ServerTemplate object to the final server_templates_dict <nl> - stress_server_cmd = ' ' . join ( temp_dict [ ' stressServerCmd ' ] ) <nl> - server_templates_dict [ template_name ] = ServerTemplate ( <nl> - template_name , stress_server_cmd , temp_dict [ ' wrapperScriptPath ' ] , <nl> - temp_dict [ ' serverPort ' ] , temp_dict [ ' serverArgs ' ] . copy ( ) , <nl> - temp_dict . get ( ' willRunForever ' , 1 ) , temp_dict . get ( ' env ' , { } ) . copy ( ) ) <nl> - <nl> - return server_templates_dict <nl> - <nl> - def _parse_server_pod_specs ( self , config_dict , docker_images_dict , <nl> - server_templates_dict ) : <nl> - " " " Parses the ' serverPodSpecs ' sub - section ( under ' testMatrix ' section ) of <nl> - the config file and returns a Dictionary of ' ServerPodSpec ' objects keyed <nl> - by server pod spec names " " " <nl> - server_pod_specs_dict = { } <nl> - <nl> - pod_specs_dict = config_dict [ ' testMatrix ' ] . get ( ' serverPodSpecs ' , { } ) <nl> - <nl> - for pod_name in pod_specs_dict . keys ( ) : <nl> - server_template_name = pod_specs_dict [ pod_name ] [ ' serverTemplate ' ] <nl> - docker_image_name = pod_specs_dict [ pod_name ] [ ' dockerImage ' ] <nl> - num_instances = pod_specs_dict [ pod_name ] . get ( ' numInstances ' , 1 ) <nl> - <nl> - # Create and add the ServerPodSpec object to the final <nl> - # server_pod_specs_dict <nl> - server_pod_specs_dict [ pod_name ] = ServerPodSpec ( <nl> - pod_name , server_templates_dict [ server_template_name ] , <nl> - docker_images_dict [ docker_image_name ] , num_instances ) <nl> - <nl> - return server_pod_specs_dict <nl> - <nl> - def _parse_client_pod_specs ( self , config_dict , docker_images_dict , <nl> - client_templates_dict , server_pod_specs_dict ) : <nl> - " " " Parses the ' clientPodSpecs ' sub - section ( under ' testMatrix ' section ) of <nl> - the config file and returns a Dictionary of ' ClientPodSpec ' objects keyed <nl> - by client pod spec names " " " <nl> - client_pod_specs_dict = { } <nl> - <nl> - pod_specs_dict = config_dict [ ' testMatrix ' ] . get ( ' clientPodSpecs ' , { } ) <nl> - for pod_name in pod_specs_dict . keys ( ) : <nl> - client_template_name = pod_specs_dict [ pod_name ] [ ' clientTemplate ' ] <nl> - docker_image_name = pod_specs_dict [ pod_name ] [ ' dockerImage ' ] <nl> - num_instances = pod_specs_dict [ pod_name ] [ ' numInstances ' ] <nl> - <nl> - # Get the server addresses from the server pod spec object <nl> - server_pod_spec_name = pod_specs_dict [ pod_name ] [ ' serverPodSpec ' ] <nl> - server_addresses = server_pod_specs_dict [ <nl> - server_pod_spec_name ] . server_addresses ( ) <nl> - <nl> - client_pod_specs_dict [ pod_name ] = ClientPodSpec ( <nl> - pod_name , client_templates_dict [ client_template_name ] , <nl> - docker_images_dict [ docker_image_name ] , num_instances , <nl> - server_addresses ) <nl> - <nl> - return client_pod_specs_dict <nl> - <nl> - def _load_config ( self , config_filename ) : <nl> - " " " Opens the config file and converts the Json text to Dictionary " " " <nl> - if not os . path . isabs ( config_filename ) : <nl> - raise Exception ( ' Config objects expects an absolute file path . ' <nl> - ' config file name passed : % s ' % config_filename ) <nl> - with open ( config_filename ) as config_file : <nl> - return json . load ( config_file ) <nl> - <nl> - <nl> - def run_tests ( config ) : <nl> - " " " The main function that launches the stress tests " " " <nl> - # Build docker images and push to GKE registry <nl> - if config . global_settings . build_docker_images : <nl> - for name , docker_image in config . docker_images_dict . iteritems ( ) : <nl> - if not ( docker_image . build_image ( ) and <nl> - docker_image . push_to_gke_registry ( ) ) : <nl> - return False <nl> - <nl> - # Create a unique id for this run ( Note : Using timestamp instead of UUID to <nl> - # make it easier to deduce the date / time of the run just by looking at the run <nl> - # run id . This is useful in debugging when looking at records in Biq query ) <nl> - run_id = datetime . datetime . now ( ) . strftime ( ' % Y_ % m_ % d_ % H_ % M_ % S ' ) <nl> - dataset_id = ' % s_ % s ' % ( config . global_settings . dataset_id_prefix , run_id ) <nl> - print ( ' Run id : ' , run_id ) <nl> - print ( ' Dataset id : ' , dataset_id ) <nl> - <nl> - bq_helper = BigQueryHelper ( run_id , ' ' , ' ' , <nl> - config . global_settings . gcp_project_id , dataset_id , <nl> - config . global_settings . summary_table_id , <nl> - config . global_settings . qps_table_id ) <nl> - bq_helper . initialize ( ) <nl> - <nl> - gke = Gke ( config . global_settings . gcp_project_id , run_id , dataset_id , <nl> - config . global_settings . summary_table_id , <nl> - config . global_settings . qps_table_id , <nl> - config . global_settings . kubernetes_proxy_port ) <nl> - <nl> - is_success = True <nl> - <nl> - try : <nl> - print ( ' Launching servers . . ' ) <nl> - for name , server_pod_spec in config . server_pod_specs_dict . iteritems ( ) : <nl> - if not gke . launch_servers ( server_pod_spec ) : <nl> - is_success = False # is_success is checked in the ' finally ' block <nl> - return False <nl> - <nl> - print ( ' Launched servers . Waiting for % d seconds for the server pods to be ' <nl> - ' fully online ' ) % config . global_settings . pod_warmup_secs <nl> - time . sleep ( config . global_settings . pod_warmup_secs ) <nl> - <nl> - for name , client_pod_spec in config . client_pod_specs_dict . iteritems ( ) : <nl> - if not gke . launch_clients ( client_pod_spec ) : <nl> - is_success = False # is_success is checked in the ' finally ' block <nl> - return False <nl> - <nl> - print ( ' Launched all clients . Waiting for % d seconds for the client pods to ' <nl> - ' be fully online ' ) % config . global_settings . pod_warmup_secs <nl> - time . sleep ( config . global_settings . pod_warmup_secs ) <nl> - <nl> - start_time = datetime . datetime . now ( ) <nl> - end_time = start_time + datetime . timedelta ( <nl> - seconds = config . global_settings . test_duration_secs ) <nl> - print ( ' Running the test until % s ' % end_time . isoformat ( ) ) <nl> - <nl> - while True : <nl> - if datetime . datetime . now ( ) > end_time : <nl> - print ( ' Test was run for % d seconds ' % <nl> - config . global_settings . test_duration_secs ) <nl> - break <nl> - <nl> - # Check if either stress server or clients have failed ( btw , the bq_helper <nl> - # monitors all the rows in the summary table and checks if any of them <nl> - # have a failure status ) <nl> - if bq_helper . check_if_any_tests_failed ( ) : <nl> - is_success = False <nl> - print ( ' Some tests failed . ' ) <nl> - break # Don ' t ' return ' here . We still want to call bq_helper to print qps / summary tables <nl> - <nl> - # Tests running fine . Wait until next poll time to check the status <nl> - print ( ' Sleeping for % d seconds . . ' % <nl> - config . global_settings . test_poll_interval_secs ) <nl> - time . sleep ( config . global_settings . test_poll_interval_secs ) <nl> - <nl> - # Print BiqQuery tables <nl> - bq_helper . print_qps_records ( ) <nl> - bq_helper . print_summary_records ( ) <nl> - <nl> - finally : <nl> - # If there was a test failure , we should not delete the pods since they <nl> - # would contain useful debug information ( logs , core dumps etc ) <nl> - if is_success : <nl> - for name , server_pod_spec in config . server_pod_specs_dict . iteritems ( ) : <nl> - gke . delete_servers ( server_pod_spec ) <nl> - for name , client_pod_spec in config . client_pod_specs_dict . iteritems ( ) : <nl> - gke . delete_clients ( client_pod_spec ) <nl> - <nl> - return is_success <nl> - <nl> - <nl> - def tear_down ( config ) : <nl> - gke = Gke ( config . global_settings . gcp_project_id , ' ' , ' ' , <nl> - config . global_settings . summary_table_id , <nl> - config . global_settings . qps_table_id , <nl> - config . global_settings . kubernetes_proxy_port ) <nl> - for name , server_pod_spec in config . server_pod_specs_dict . iteritems ( ) : <nl> - gke . delete_servers ( server_pod_spec ) <nl> - for name , client_pod_spec in config . client_pod_specs_dict . iteritems ( ) : <nl> - gke . delete_clients ( client_pod_spec ) <nl> - <nl> - <nl> - argp = argparse . ArgumentParser ( <nl> - description = ' Launch stress tests in GKE ' , <nl> - formatter_class = argparse . ArgumentDefaultsHelpFormatter ) <nl> - argp . add_argument ( ' - - gcp_project_id ' , <nl> - required = True , <nl> - help = ' The Google Cloud Platform Project Id ' ) <nl> - argp . add_argument ( ' - - config_file ' , <nl> - required = True , <nl> - type = str , <nl> - help = ' The test config file ' ) <nl> - argp . add_argument ( ' - - tear_down ' , action = ' store_true ' , default = False ) <nl> - <nl> - if __name__ = = ' __main__ ' : <nl> - args = argp . parse_args ( ) <nl> - <nl> - config_filename = args . config_file <nl> - <nl> - # Since we will be changing the current working directory to grpc root in the <nl> - # next step , we should check if the config filename path is a relative path <nl> - # ( i . e a path relative to the current working directory ) and if so , convert it <nl> - # to abosulte path <nl> - if not os . path . isabs ( config_filename ) : <nl> - config_filename = os . path . abspath ( config_filename ) <nl> - <nl> - config = Config ( config_filename , args . gcp_project_id ) <nl> - <nl> - # Change current working directory to grpc root <nl> - # ( This is important because all relative file paths in the config file are <nl> - # supposed to interpreted as relative to the GRPC root ) <nl> - grpc_root = os . path . abspath ( os . path . join ( <nl> - os . path . dirname ( sys . argv [ 0 ] ) , ' . . / . . / . . ' ) ) <nl> - os . chdir ( grpc_root ) <nl> - <nl> - # Note that tear_down is only in cases where we want to manually tear down a <nl> - # test that for some reason run_tests ( ) could not cleanup <nl> - if args . tear_down : <nl> - tear_down ( config ) <nl> - sys . exit ( 1 ) <nl> - <nl> - if not run_tests ( config ) : <nl> - sys . exit ( 1 ) <nl>
|
Merge pull request from yongni / stress_cleanup
|
grpc/grpc
|
ca754964044a9d66fb09ba8040f58ef0bc3726a6
|
2017-05-09T14:19:57Z
|
new file mode 100644 <nl> index 00000000000 . . 4ca978bf787 <nl> mmm / dev / null <nl> ppp b / tests / core / test_linked_list . in <nl> <nl> + <nl> + # include < stdio . h > <nl> + struct worker_args { <nl> + int value ; <nl> + struct worker_args * next ; <nl> + } ; <nl> + int main ( ) <nl> + { <nl> + worker_args a ; <nl> + worker_args b ; <nl> + a . value = 60 ; <nl> + a . next = & b ; <nl> + b . value = 900 ; <nl> + b . next = NULL ; <nl> + worker_args * c = & a ; <nl> + int total = 0 ; <nl> + while ( c ) { <nl> + total + = c - > value ; <nl> + c = c - > next ; <nl> + } <nl> + <nl> + / / Chunk of em <nl> + worker_args chunk [ 10 ] ; <nl> + for ( int i = 0 ; i < 9 ; i + + ) { <nl> + chunk [ i ] . value = i * 10 ; <nl> + chunk [ i ] . next = & chunk [ i + 1 ] ; <nl> + } <nl> + chunk [ 9 ] . value = 90 ; <nl> + chunk [ 9 ] . next = & chunk [ 0 ] ; <nl> + <nl> + c = chunk ; <nl> + do { <nl> + total + = c - > value ; <nl> + c = c - > next ; <nl> + } while ( c ! = chunk ) ; <nl> + <nl> + printf ( " * % d , % d * \ n " , total , b . next ) ; <nl> + / / NULL * is * 0 , in C / C + + . No JS null ! ( null = = 0 is false , etc . ) <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . f3b615b1d2a <nl> mmm / dev / null <nl> ppp b / tests / core / test_linked_list . out <nl> @ @ - 0 , 0 + 1 @ @ <nl> + * 1410 , 0 * <nl> \ No newline at end of file <nl> mmm a / tests / test_core . py <nl> ppp b / tests / test_core . py <nl> def test_globals ( self ) : <nl> self . do_run_from_file ( src , output ) <nl> <nl> def test_linked_list ( self ) : <nl> - src = ' ' ' <nl> - # include < stdio . h > <nl> - struct worker_args { <nl> - int value ; <nl> - struct worker_args * next ; <nl> - } ; <nl> - int main ( ) <nl> - { <nl> - worker_args a ; <nl> - worker_args b ; <nl> - a . value = 60 ; <nl> - a . next = & b ; <nl> - b . value = 900 ; <nl> - b . next = NULL ; <nl> - worker_args * c = & a ; <nl> - int total = 0 ; <nl> - while ( c ) { <nl> - total + = c - > value ; <nl> - c = c - > next ; <nl> - } <nl> - <nl> - / / Chunk of em <nl> - worker_args chunk [ 10 ] ; <nl> - for ( int i = 0 ; i < 9 ; i + + ) { <nl> - chunk [ i ] . value = i * 10 ; <nl> - chunk [ i ] . next = & chunk [ i + 1 ] ; <nl> - } <nl> - chunk [ 9 ] . value = 90 ; <nl> - chunk [ 9 ] . next = & chunk [ 0 ] ; <nl> - <nl> - c = chunk ; <nl> - do { <nl> - total + = c - > value ; <nl> - c = c - > next ; <nl> - } while ( c ! = chunk ) ; <nl> - <nl> - printf ( " * % d , % d * \ \ n " , total , b . next ) ; <nl> - / / NULL * is * 0 , in C / C + + . No JS null ! ( null = = 0 is false , etc . ) <nl> + test_path = path_from_root ( ' tests ' , ' core ' , ' test_linked_list ' ) <nl> + src , output = ( test_path + s for s in ( ' . in ' , ' . out ' ) ) <nl> <nl> - return 0 ; <nl> - } <nl> - ' ' ' <nl> - self . do_run ( src , ' * 1410 , 0 * ' ) <nl> + self . do_run_from_file ( src , output ) <nl> <nl> def test_sup ( self ) : <nl> src = ' ' ' <nl>
|
Use do_run_from_file ( ) for test_linked_list
|
emscripten-core/emscripten
|
dc905bf16379b39230604b00fc9fc2e395597b5b
|
2013-12-07T17:35:52Z
|
mmm a / src / mongo / db / s / resharding / resharding_coordinator_service . cpp <nl> ppp b / src / mongo / db / s / resharding / resharding_coordinator_service . cpp <nl> void writeToCoordinatorStateNss ( OperationContext * opCtx , <nl> } <nl> } <nl> <nl> + / * * <nl> + * Extracts the ShardId from each Donor / RecipientShardEntry in participantShardEntries . <nl> + * / <nl> + template < class T > <nl> + std : : vector < ShardId > extractShardIds ( const std : : vector < T > & participantShardEntries ) { <nl> + std : : vector < ShardId > shardIds ( participantShardEntries . size ( ) ) ; <nl> + std : : transform ( participantShardEntries . begin ( ) , <nl> + participantShardEntries . end ( ) , <nl> + shardIds . begin ( ) , <nl> + [ ] ( auto & shardEntry ) { return shardEntry . getId ( ) ; } ) ; <nl> + return shardIds ; <nl> + } <nl> + <nl> + / * * <nl> + * Creates reshardingFields . recipientFields for the resharding operation . Note : these should not <nl> + * change once the operation has begun . <nl> + * / <nl> + TypeCollectionRecipientFields constructRecipientFields ( <nl> + const ReshardingCoordinatorDocument & coordinatorDoc ) { <nl> + auto donorShardIds = extractShardIds ( coordinatorDoc . getDonorShards ( ) ) ; <nl> + TypeCollectionRecipientFields recipientFields ( <nl> + std : : move ( donorShardIds ) , coordinatorDoc . getExistingUUID ( ) , coordinatorDoc . getNss ( ) ) ; <nl> + emplaceFetchTimestampIfExists ( recipientFields , coordinatorDoc . getFetchTimestamp ( ) ) ; <nl> + return recipientFields ; <nl> + } <nl> + <nl> BSONObj createReshardingFieldsUpdateForOriginalNss ( <nl> OperationContext * opCtx , <nl> const ReshardingCoordinatorDocument & coordinatorDoc , <nl> BSONObj createReshardingFieldsUpdateForOriginalNss ( <nl> / / the new sharded collection . Set ' uuid ' to the reshardingUUID , ' key ' to the new shard <nl> / / key , ' lastmodEpoch ' to newCollectionEpoch , and ' timestamp ' to <nl> / / newCollectionTimestamp ( if newCollectionTimestamp has a value ; i . e . when the <nl> - / / shardingFullDDLSupport feature flag is enabled ) . Also update the ' state ' field in the <nl> - / / ' reshardingFields ' section <nl> + / / shardingFullDDLSupport feature flag is enabled ) . Also update the ' state ' field and <nl> + / / add the ' recipientFields ' to the ' reshardingFields ' section . <nl> + auto recipientFields = constructRecipientFields ( coordinatorDoc ) ; <nl> BSONObj setFields = <nl> BSON ( " uuid " < < coordinatorDoc . get_id ( ) < < " key " <nl> < < coordinatorDoc . getReshardingKey ( ) . toBSON ( ) < < " lastmodEpoch " <nl> < < newCollectionEpoch . get ( ) < < " lastmod " <nl> < < opCtx - > getServiceContext ( ) - > getPreciseClockSource ( ) - > now ( ) <nl> < < " reshardingFields . state " <nl> - < < CoordinatorState_serializer ( coordinatorDoc . getState ( ) ) . toString ( ) ) ; <nl> + < < CoordinatorState_serializer ( coordinatorDoc . getState ( ) ) . toString ( ) <nl> + < < " reshardingFields . recipientFields " < < recipientFields . toBSON ( ) ) ; <nl> if ( newCollectionTimestamp . has_value ( ) ) { <nl> setFields = setFields . addFields ( BSON ( " timestamp " < < newCollectionTimestamp . get ( ) ) ) ; <nl> } <nl> void updateChunkAndTagsDocsForTempNss ( OperationContext * opCtx , <nl> opCtx , TagsType : : ConfigNS , tagsRequest , txnNumber ) ; <nl> } <nl> <nl> - / * * <nl> - * Extracts the ShardId from each Donor / RecipientShardEntry in participantShardEntries . <nl> - * / <nl> - template < class T > <nl> - std : : vector < ShardId > extractShardIds ( const std : : vector < T > & participantShardEntries ) { <nl> - std : : vector < ShardId > shardIds ( participantShardEntries . size ( ) ) ; <nl> - std : : transform ( participantShardEntries . begin ( ) , <nl> - participantShardEntries . end ( ) , <nl> - shardIds . begin ( ) , <nl> - [ ] ( auto & shardEntry ) { return shardEntry . getId ( ) ; } ) ; <nl> - return shardIds ; <nl> - } <nl> - <nl> / / <nl> / / Helper methods for ensuring donors / recipients are able to notice when certain state transitions <nl> / / occur . <nl> CollectionType createTempReshardingCollectionType ( <nl> TypeCollectionReshardingFields tempEntryReshardingFields ( coordinatorDoc . get_id ( ) ) ; <nl> tempEntryReshardingFields . setState ( coordinatorDoc . getState ( ) ) ; <nl> <nl> - auto donorShardIds = extractShardIds ( coordinatorDoc . getDonorShards ( ) ) ; <nl> - <nl> - TypeCollectionRecipientFields recipient ( <nl> - std : : move ( donorShardIds ) , coordinatorDoc . getExistingUUID ( ) , coordinatorDoc . getNss ( ) ) ; <nl> - emplaceFetchTimestampIfExists ( recipient , coordinatorDoc . getFetchTimestamp ( ) ) ; <nl> - tempEntryReshardingFields . setRecipientFields ( recipient ) ; <nl> + auto recipientFields = constructRecipientFields ( coordinatorDoc ) ; <nl> + tempEntryReshardingFields . setRecipientFields ( std : : move ( recipientFields ) ) ; <nl> collType . setReshardingFields ( std : : move ( tempEntryReshardingFields ) ) ; <nl> return collType ; <nl> } <nl> mmm a / src / mongo / db / s / resharding / resharding_coordinator_test . cpp <nl> ppp b / src / mongo / db / s / resharding / resharding_coordinator_test . cpp <nl> class ReshardingCoordinatorPersistenceTest : public ConfigServerTestFixture { <nl> } <nl> <nl> void readOriginalCollectionCatalogEntryAndAssertReshardingFieldsMatchExpected ( <nl> - OperationContext * opCtx , CollectionType expectedCollType , bool doneState ) { <nl> + OperationContext * opCtx , <nl> + CollectionType expectedCollType , <nl> + const ReshardingCoordinatorDocument & expectedCoordinatorDoc ) { <nl> DBDirectClient client ( opCtx ) ; <nl> CollectionType onDiskEntry ( <nl> client . findOne ( CollectionType : : ConfigNS . ns ( ) , Query ( BSON ( " _id " < < _originalNss . ns ( ) ) ) ) ) ; <nl> <nl> auto expectedReshardingFields = expectedCollType . getReshardingFields ( ) ; <nl> - if ( doneState | | <nl> + auto expectedCoordinatorState = expectedCoordinatorDoc . getState ( ) ; <nl> + if ( expectedCoordinatorState = = CoordinatorStateEnum : : kDone | | <nl> ( expectedReshardingFields & & <nl> expectedReshardingFields - > getState ( ) > = CoordinatorStateEnum : : kCommitted & & <nl> expectedReshardingFields - > getState ( ) ! = CoordinatorStateEnum : : kError ) ) { <nl> class ReshardingCoordinatorPersistenceTest : public ConfigServerTestFixture { <nl> expectedReshardingFields - > getDonorFields ( ) - > getReshardingKey ( ) . toBSON ( ) ) , <nl> 0 ) ; <nl> <nl> - / / ' recipientFields ' should only in the entry for the temporary collection . <nl> - ASSERT ( ! onDiskReshardingFields . getRecipientFields ( ) ) ; <nl> + / / Check the reshardingFields . recipientFields . <nl> + if ( expectedCoordinatorState ! = CoordinatorStateEnum : : kError ) { <nl> + / / Don ' t bother checking the recipientFields if the coordinator state is already kError . <nl> + if ( expectedCoordinatorState < CoordinatorStateEnum : : kCommitted ) { <nl> + / / Until CoordinatorStateEnum : : kCommitted , recipientsFields only live on the <nl> + / / temporaryNss entry in config . collections . <nl> + ASSERT ( ! onDiskReshardingFields . getRecipientFields ( ) ) ; <nl> + } else { <nl> + / / The entry for the temporaryNss has been removed , recipientFields are appended to <nl> + / / the originalCollection ' s reshardingFields . <nl> + ASSERT ( onDiskReshardingFields . getRecipientFields ( ) ) ; <nl> + } <nl> + } <nl> } <nl> <nl> void readTemporaryCollectionCatalogEntryAndAssertReshardingFieldsMatchExpected ( <nl> class ReshardingCoordinatorPersistenceTest : public ConfigServerTestFixture { <nl> std : : move ( collectionEpoch ) , <nl> opCtx - > getServiceContext ( ) - > getPreciseClockSource ( ) - > now ( ) ) ; <nl> readOriginalCollectionCatalogEntryAndAssertReshardingFieldsMatchExpected ( <nl> - opCtx , <nl> - originalCollType , <nl> - expectedCoordinatorDoc . getState ( ) = = CoordinatorStateEnum : : kDone ) ; <nl> + opCtx , originalCollType , expectedCoordinatorDoc ) ; <nl> <nl> / / Check the resharding fields in the config . collections entry for the temp collection . If <nl> / / the expected state is > = kCommitted , the entry for the temp collection should have been <nl> class ReshardingCoordinatorPersistenceTest : public ConfigServerTestFixture { <nl> _finalEpoch , <nl> opCtx - > getServiceContext ( ) - > getPreciseClockSource ( ) - > now ( ) ) ; <nl> readOriginalCollectionCatalogEntryAndAssertReshardingFieldsMatchExpected ( <nl> - opCtx , collType , true ) ; <nl> + opCtx , collType , expectedCoordinatorDoc ) ; <nl> } <nl> <nl> void assertChunkVersionDidNotIncreaseAfterStateTransition ( <nl> mmm a / src / mongo / db / s / resharding / resharding_donor_recipient_common . cpp <nl> ppp b / src / mongo / db / s / resharding / resharding_donor_recipient_common . cpp <nl> <nl> <nl> # include " mongo / db / s / resharding / resharding_donor_recipient_common . h " <nl> <nl> + # include < fmt / format . h > <nl> + <nl> namespace mongo { <nl> namespace resharding { <nl> <nl> using DonorStateMachine = ReshardingDonorService : : DonorStateMachine ; <nl> using RecipientStateMachine = ReshardingRecipientService : : RecipientStateMachine ; <nl> <nl> namespace { <nl> + using namespace fmt : : literals ; <nl> + <nl> std : : vector < DonorShardMirroringEntry > createDonorShardMirroringEntriesFromDonorShardIds ( <nl> const std : : vector < ShardId > & shardIds ) { <nl> std : : vector < DonorShardMirroringEntry > donorShards ( shardIds . size ( ) ) ; <nl> void processReshardingFieldsForCollection ( OperationContext * opCtx , <nl> const NamespaceString & nss , <nl> const CollectionMetadata & metadata , <nl> const ReshardingFields & reshardingFields ) { <nl> + auto coordinatorState = reshardingFields . getState ( ) ; <nl> + if ( coordinatorState ! = CoordinatorStateEnum : : kError ) { <nl> + if ( coordinatorState < CoordinatorStateEnum : : kCommitted ) { <nl> + / / The reshardingFields are either ( 1 ) on the originalNss because this shard is a donor <nl> + / / or ( 2 ) temporaryNss because this shard is a recipient . Until the cordinator is in <nl> + / / state CoordinatorStateEnum : : kCommitted , reshardingFields should contain either <nl> + / / recipientFields or donorFields , not both . <nl> + uassert ( <nl> + 5274201 , <nl> + fmt : : format ( " reshardingFields must contain either donorFields or recipientFields " <nl> + " ( and not both ) when the " <nl> + " coordinator is in state { } . Got reshardingFields { } " , <nl> + CoordinatorState_serializer ( reshardingFields . getState ( ) ) , <nl> + reshardingFields . toBSON ( ) . toString ( ) ) , <nl> + reshardingFields . getDonorFields ( ) . is_initialized ( ) ^ <nl> + reshardingFields . getRecipientFields ( ) . is_initialized ( ) ) ; <nl> + } else { <nl> + / / Once the entry in config . collections for the temporaryNss is removed , recipientFields <nl> + / / and donorFields should both exist in the reshardingFields . <nl> + uassert ( <nl> + 5274202 , <nl> + fmt : : format ( " reshardingFields must contain both donorFields and recipientFields " <nl> + " when the coordinator ' s state is greater than or equal to " <nl> + " CoordinatorStateEnum : : kCommitted . Got reshardingFields { } " , <nl> + reshardingFields . toBSON ( ) . toString ( ) ) , <nl> + reshardingFields . getDonorFields ( ) & & reshardingFields . getRecipientFields ( ) ) ; <nl> + } <nl> + } <nl> + <nl> if ( reshardingFields . getDonorFields ( ) ) { <nl> - invariant ( ! reshardingFields . getRecipientFields ( ) ) ; <nl> processReshardingFieldsForDonorCollection ( opCtx , nss , metadata , reshardingFields ) ; <nl> - return ; <nl> } <nl> <nl> if ( reshardingFields . getRecipientFields ( ) ) { <nl> - invariant ( ! reshardingFields . getDonorFields ( ) ) ; <nl> processReshardingFieldsForRecipientCollection ( opCtx , metadata , reshardingFields ) ; <nl> - return ; <nl> } <nl> - <nl> - MONGO_UNREACHABLE <nl> } <nl> <nl> } / / namespace resharding <nl> mmm a / src / mongo / db / s / resharding / resharding_donor_recipient_common_test . cpp <nl> ppp b / src / mongo / db / s / resharding / resharding_donor_recipient_common_test . cpp <nl> TEST_F ( ReshardingDonorRecipientCommonTest , <nl> appendRecipientFieldsToReshardingFields ( <nl> reshardingFields , kShardIds , kExistingUUID , kOriginalNss , kFetchTimestamp ) ; <nl> <nl> - resharding : : processReshardingFieldsForCollection ( <nl> - opCtx , kTemporaryReshardingNss , metadata , reshardingFields ) ; <nl> + ASSERT_THROWS_CODE ( resharding : : processReshardingFieldsForCollection ( <nl> + opCtx , kTemporaryReshardingNss , metadata , reshardingFields ) , <nl> + DBException , <nl> + 5274202 ) ; <nl> <nl> auto recipientStateMachine = <nl> resharding : : tryGetReshardingStateMachine < ReshardingRecipientService , <nl> TEST_F ( ReshardingDonorRecipientCommonTest , <nl> ASSERT ( recipientStateMachine = = boost : : none ) ; <nl> } <nl> <nl> - DEATH_TEST_F ( ReshardingDonorRecipientCommonTest , <nl> - ProcessReshardingFieldsWithoutDonorOrRecipientFields , <nl> - " invariant " ) { <nl> + TEST_F ( ReshardingDonorRecipientCommonTest , ProcessReshardingFieldsWithoutDonorOrRecipientFields ) { <nl> OperationContext * opCtx = operationContext ( ) ; <nl> auto metadata = makeShardedMetadataForTemporaryReshardingCollection ( opCtx ) ; <nl> <nl> auto reshardingFields = <nl> createCommonReshardingFields ( kReshardingUUID , CoordinatorStateEnum : : kCloning ) ; <nl> <nl> - resharding : : processReshardingFieldsForCollection ( <nl> - opCtx , kTemporaryReshardingNss , metadata , reshardingFields ) ; <nl> + ASSERT_THROWS_CODE ( resharding : : processReshardingFieldsForCollection ( <nl> + opCtx , kTemporaryReshardingNss , metadata , reshardingFields ) , <nl> + DBException , <nl> + 5274201 ) ; <nl> } <nl> <nl> } / / namespace <nl> <nl> - } / / namespace mongo <nl> \ No newline at end of file <nl> + } / / namespace mongo <nl>
|
SERVER - 52742 Ensure both donorFields and recipientFields exists on the original collection entry after a resharding operation commits
|
mongodb/mongo
|
02afb5b532bd893919b3cc2228fd62e958e91240
|
2020-12-07T22:53:44Z
|
mmm a / src / counters . h <nl> ppp b / src / counters . h <nl> class Counters : public std : : enable_shared_from_this < Counters > { <nl> STATS_COUNTER_TS_LIST ( SC ) <nl> # undef SC <nl> <nl> - # define SC ( name ) \ <nl> - StatsCounter * count_of_ # # name ( ) { return & count_of_ # # name # # _ ; } \ <nl> - StatsCounter * size_of_ # # name ( ) { return & size_of_ # # name # # _ ; } <nl> - INSTANCE_TYPE_LIST ( SC ) <nl> - # undef SC <nl> - <nl> - # define SC ( name ) \ <nl> - StatsCounter * count_of_CODE_TYPE_ # # name ( ) \ <nl> - { return & count_of_CODE_TYPE_ # # name # # _ ; } \ <nl> - StatsCounter * size_of_CODE_TYPE_ # # name ( ) \ <nl> - { return & size_of_CODE_TYPE_ # # name # # _ ; } <nl> - CODE_KIND_LIST ( SC ) <nl> - # undef SC <nl> - <nl> - # define SC ( name ) \ <nl> - StatsCounter * count_of_FIXED_ARRAY_ # # name ( ) \ <nl> - { return & count_of_FIXED_ARRAY_ # # name # # _ ; } \ <nl> - StatsCounter * size_of_FIXED_ARRAY_ # # name ( ) \ <nl> - { return & size_of_FIXED_ARRAY_ # # name # # _ ; } <nl> - FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST ( SC ) <nl> - # undef SC <nl> - <nl> / / clang - format off <nl> enum Id { <nl> # define RATE_ID ( name , caption , max , res ) k_ # # name , <nl> mmm a / src / extensions / statistics - extension . cc <nl> ppp b / src / extensions / statistics - extension . cc <nl> void StatisticsExtension : : GetCounters ( <nl> , <nl> <nl> STATS_COUNTER_LIST_1 ( ADD_COUNTER ) STATS_COUNTER_LIST_2 ( ADD_COUNTER ) <nl> - # undef ADD_COUNTER <nl> - # define ADD_COUNTER ( name ) \ <nl> - { counters - > count_of_ # # name ( ) , " count_of_ " # name } \ <nl> - , { counters - > size_of_ # # name ( ) , " size_of_ " # name } , <nl> - <nl> - INSTANCE_TYPE_LIST ( ADD_COUNTER ) <nl> - # undef ADD_COUNTER <nl> - # define ADD_COUNTER ( name ) \ <nl> - { counters - > count_of_CODE_TYPE_ # # name ( ) , " count_of_CODE_TYPE_ " # name } \ <nl> - , { counters - > size_of_CODE_TYPE_ # # name ( ) , " size_of_CODE_TYPE_ " # name } , <nl> - <nl> - CODE_KIND_LIST ( ADD_COUNTER ) <nl> - # undef ADD_COUNTER <nl> - # define ADD_COUNTER ( name ) \ <nl> - { counters - > count_of_FIXED_ARRAY_ # # name ( ) , " count_of_FIXED_ARRAY_ " # name } \ <nl> - , { counters - > size_of_FIXED_ARRAY_ # # name ( ) , " size_of_FIXED_ARRAY_ " # name } , <nl> - <nl> - FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST ( ADD_COUNTER ) <nl> # undef ADD_COUNTER <nl> } ; / / End counter_list array . <nl> <nl> mmm a / src / heap / object - stats . cc <nl> ppp b / src / heap / object - stats . cc <nl> <nl> <nl> # include " src / heap / object - stats . h " <nl> <nl> + # include < unordered_set > <nl> + <nl> # include " src / assembler - inl . h " <nl> # include " src / base / bits . h " <nl> # include " src / compilation - cache . h " <nl> namespace internal { <nl> <nl> static base : : LazyMutex object_stats_mutex = LAZY_MUTEX_INITIALIZER ; <nl> <nl> - <nl> void ObjectStats : : ClearObjectStats ( bool clear_last_time_stats ) { <nl> memset ( object_counts_ , 0 , sizeof ( object_counts_ ) ) ; <nl> memset ( object_sizes_ , 0 , sizeof ( object_sizes_ ) ) ; <nl> void ObjectStats : : PrintJSON ( const char * key ) { <nl> # define FIXED_ARRAY_SUB_INSTANCE_TYPE_WRAPPER ( name ) \ <nl> PrintInstanceTypeJSON ( key , gc_count , " * FIXED_ARRAY_ " # name , \ <nl> FIRST_FIXED_ARRAY_SUB_TYPE + name ) ; <nl> + # define VIRTUAL_INSTANCE_TYPE_WRAPPER ( name ) \ <nl> + PrintInstanceTypeJSON ( key , gc_count , # name , FIRST_VIRTUAL_TYPE + name ) ; <nl> <nl> INSTANCE_TYPE_LIST ( INSTANCE_TYPE_WRAPPER ) <nl> CODE_KIND_LIST ( CODE_KIND_WRAPPER ) <nl> FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST ( FIXED_ARRAY_SUB_INSTANCE_TYPE_WRAPPER ) <nl> + VIRTUAL_INSTANCE_TYPE_LIST ( VIRTUAL_INSTANCE_TYPE_WRAPPER ) <nl> <nl> # undef INSTANCE_TYPE_WRAPPER <nl> # undef CODE_KIND_WRAPPER <nl> # undef FIXED_ARRAY_SUB_INSTANCE_TYPE_WRAPPER <nl> - # undef PRINT_INSTANCE_TYPE_DATA <nl> - # undef PRINT_KEY_AND_ID <nl> + # undef VIRTUAL_INSTANCE_TYPE_WRAPPER <nl> } <nl> <nl> void ObjectStats : : DumpInstanceTypeData ( std : : stringstream & stream , <nl> void ObjectStats : : Dump ( std : : stringstream & stream ) { <nl> # define FIXED_ARRAY_SUB_INSTANCE_TYPE_WRAPPER ( name ) \ <nl> DumpInstanceTypeData ( stream , " * FIXED_ARRAY_ " # name , \ <nl> FIRST_FIXED_ARRAY_SUB_TYPE + name ) ; <nl> + # define VIRTUAL_INSTANCE_TYPE_WRAPPER ( name ) \ <nl> + DumpInstanceTypeData ( stream , # name , FIRST_VIRTUAL_TYPE + name ) ; <nl> <nl> INSTANCE_TYPE_LIST ( INSTANCE_TYPE_WRAPPER ) ; <nl> CODE_KIND_LIST ( CODE_KIND_WRAPPER ) ; <nl> FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST ( FIXED_ARRAY_SUB_INSTANCE_TYPE_WRAPPER ) ; <nl> + FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST ( VIRTUAL_INSTANCE_TYPE_WRAPPER ) <nl> stream < < " \ " END \ " : { } } } " ; <nl> <nl> # undef INSTANCE_TYPE_WRAPPER <nl> # undef CODE_KIND_WRAPPER <nl> # undef FIXED_ARRAY_SUB_INSTANCE_TYPE_WRAPPER <nl> - # undef PRINT_INSTANCE_TYPE_DATA <nl> + # undef VIRTUAL_INSTANCE_TYPE_WRAPPER <nl> } <nl> <nl> void ObjectStats : : CheckpointObjectStats ( ) { <nl> base : : LockGuard < base : : Mutex > lock_guard ( object_stats_mutex . Pointer ( ) ) ; <nl> - Counters * counters = isolate ( ) - > counters ( ) ; <nl> - # define ADJUST_LAST_TIME_OBJECT_COUNT ( name ) \ <nl> - counters - > count_of_ # # name ( ) - > Increment ( \ <nl> - static_cast < int > ( object_counts_ [ name ] ) ) ; \ <nl> - counters - > count_of_ # # name ( ) - > Decrement ( \ <nl> - static_cast < int > ( object_counts_last_time_ [ name ] ) ) ; \ <nl> - counters - > size_of_ # # name ( ) - > Increment ( \ <nl> - static_cast < int > ( object_sizes_ [ name ] ) ) ; \ <nl> - counters - > size_of_ # # name ( ) - > Decrement ( \ <nl> - static_cast < int > ( object_sizes_last_time_ [ name ] ) ) ; <nl> - INSTANCE_TYPE_LIST ( ADJUST_LAST_TIME_OBJECT_COUNT ) <nl> - # undef ADJUST_LAST_TIME_OBJECT_COUNT <nl> - int index ; <nl> - # define ADJUST_LAST_TIME_OBJECT_COUNT ( name ) \ <nl> - index = FIRST_CODE_KIND_SUB_TYPE + Code : : name ; \ <nl> - counters - > count_of_CODE_TYPE_ # # name ( ) - > Increment ( \ <nl> - static_cast < int > ( object_counts_ [ index ] ) ) ; \ <nl> - counters - > count_of_CODE_TYPE_ # # name ( ) - > Decrement ( \ <nl> - static_cast < int > ( object_counts_last_time_ [ index ] ) ) ; \ <nl> - counters - > size_of_CODE_TYPE_ # # name ( ) - > Increment ( \ <nl> - static_cast < int > ( object_sizes_ [ index ] ) ) ; \ <nl> - counters - > size_of_CODE_TYPE_ # # name ( ) - > Decrement ( \ <nl> - static_cast < int > ( object_sizes_last_time_ [ index ] ) ) ; <nl> - CODE_KIND_LIST ( ADJUST_LAST_TIME_OBJECT_COUNT ) <nl> - # undef ADJUST_LAST_TIME_OBJECT_COUNT <nl> - # define ADJUST_LAST_TIME_OBJECT_COUNT ( name ) \ <nl> - index = FIRST_FIXED_ARRAY_SUB_TYPE + name ; \ <nl> - counters - > count_of_FIXED_ARRAY_ # # name ( ) - > Increment ( \ <nl> - static_cast < int > ( object_counts_ [ index ] ) ) ; \ <nl> - counters - > count_of_FIXED_ARRAY_ # # name ( ) - > Decrement ( \ <nl> - static_cast < int > ( object_counts_last_time_ [ index ] ) ) ; \ <nl> - counters - > size_of_FIXED_ARRAY_ # # name ( ) - > Increment ( \ <nl> - static_cast < int > ( object_sizes_ [ index ] ) ) ; \ <nl> - counters - > size_of_FIXED_ARRAY_ # # name ( ) - > Decrement ( \ <nl> - static_cast < int > ( object_sizes_last_time_ [ index ] ) ) ; <nl> - FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST ( ADJUST_LAST_TIME_OBJECT_COUNT ) <nl> - # undef ADJUST_LAST_TIME_OBJECT_COUNT <nl> - <nl> MemCopy ( object_counts_last_time_ , object_counts_ , sizeof ( object_counts_ ) ) ; <nl> MemCopy ( object_sizes_last_time_ , object_sizes_ , sizeof ( object_sizes_ ) ) ; <nl> ClearObjectStats ( ) ; <nl> void ObjectStats : : RecordObjectStats ( InstanceType type , size_t size ) { <nl> size_histogram_ [ type ] [ HistogramIndexFromSize ( size ) ] + + ; <nl> } <nl> <nl> + void ObjectStats : : RecordVirtualObjectStats ( VirtualInstanceType type , <nl> + size_t size ) { <nl> + DCHECK_LE ( type , LAST_VIRTUAL_TYPE ) ; <nl> + object_counts_ [ FIRST_VIRTUAL_TYPE + type ] + + ; <nl> + object_sizes_ [ FIRST_VIRTUAL_TYPE + type ] + = size ; <nl> + size_histogram_ [ FIRST_VIRTUAL_TYPE + type ] [ HistogramIndexFromSize ( size ) ] + + ; <nl> + } <nl> + <nl> void ObjectStats : : RecordCodeSubTypeStats ( int code_sub_type , size_t size ) { <nl> int code_sub_type_index = FIRST_CODE_KIND_SUB_TYPE + code_sub_type ; <nl> DCHECK_GE ( code_sub_type_index , FIRST_CODE_KIND_SUB_TYPE ) ; <nl> class ObjectStatsCollectorImpl { <nl> ObjectStatsCollectorImpl ( Heap * heap , ObjectStats * stats ) ; <nl> <nl> void CollectGlobalStatistics ( ) ; <nl> + <nl> + / / Collects statistics of objects for virtual instance types . <nl> + void CollectVirtualStatistics ( HeapObject * obj ) ; <nl> + <nl> + / / Collects statistics of objects for regular instance types . <nl> void CollectStatistics ( HeapObject * obj ) ; <nl> <nl> private : <nl> class CompilationCacheTableVisitor ; <nl> <nl> + void RecordObjectStats ( HeapObject * obj , InstanceType type , size_t size ) ; <nl> void RecordBytecodeArrayDetails ( BytecodeArray * obj ) ; <nl> void RecordCodeDetails ( Code * code ) ; <nl> void RecordFixedArrayDetails ( FixedArray * array ) ; <nl> class ObjectStatsCollectorImpl { <nl> template < class HashTable > <nl> void RecordHashTableHelper ( HeapObject * parent , HashTable * array , int subtype ) ; <nl> bool SameLiveness ( HeapObject * obj1 , HeapObject * obj2 ) ; <nl> + <nl> + void RecordVirtualObjectStats ( HeapObject * obj , <nl> + ObjectStats : : VirtualInstanceType type , <nl> + size_t size ) ; <nl> + void RecordVirtualAllocationSiteDetails ( AllocationSite * site ) ; <nl> + <nl> Heap * heap_ ; <nl> ObjectStats * stats_ ; <nl> MarkCompactCollector : : NonAtomicMarkingState * marking_state_ ; <nl> + std : : unordered_set < HeapObject * > virtual_objects_ ; <nl> <nl> friend class ObjectStatsCollectorImpl : : CompilationCacheTableVisitor ; <nl> } ; <nl> ObjectStatsCollectorImpl : : ObjectStatsCollectorImpl ( Heap * heap , <nl> marking_state_ ( <nl> heap - > mark_compact_collector ( ) - > non_atomic_marking_state ( ) ) { } <nl> <nl> + void ObjectStatsCollectorImpl : : CollectVirtualStatistics ( HeapObject * obj ) { <nl> + if ( obj - > IsAllocationSite ( ) ) { <nl> + RecordVirtualAllocationSiteDetails ( AllocationSite : : cast ( obj ) ) ; <nl> + } <nl> + } <nl> + <nl> + void ObjectStatsCollectorImpl : : RecordVirtualObjectStats ( <nl> + HeapObject * obj , ObjectStats : : VirtualInstanceType type , size_t size ) { <nl> + virtual_objects_ . insert ( obj ) ; <nl> + stats_ - > RecordVirtualObjectStats ( type , size ) ; <nl> + } <nl> + <nl> + void ObjectStatsCollectorImpl : : RecordVirtualAllocationSiteDetails ( <nl> + AllocationSite * site ) { <nl> + if ( site - > PointsToLiteral ( ) ) { <nl> + JSObject * boilerplate = site - > boilerplate ( ) ; <nl> + if ( boilerplate - > IsJSArray ( ) ) { <nl> + RecordVirtualObjectStats ( boilerplate , <nl> + ObjectStats : : JS_ARRAY_BOILERPLATE_TYPE , <nl> + boilerplate - > Size ( ) ) ; <nl> + } else { <nl> + RecordVirtualObjectStats ( boilerplate , <nl> + ObjectStats : : JS_OBJECT_BOILERPLATE_TYPE , <nl> + boilerplate - > Size ( ) ) ; <nl> + } <nl> + } <nl> + } <nl> + <nl> void ObjectStatsCollectorImpl : : CollectStatistics ( HeapObject * obj ) { <nl> Map * map = obj - > map ( ) ; <nl> <nl> / / Record for the InstanceType . <nl> int object_size = obj - > Size ( ) ; <nl> - stats_ - > RecordObjectStats ( map - > instance_type ( ) , object_size ) ; <nl> + RecordObjectStats ( obj , map - > instance_type ( ) , object_size ) ; <nl> <nl> / / Record specific sub types where possible . <nl> if ( obj - > IsMap ( ) ) RecordMapDetails ( Map : : cast ( obj ) ) ; <nl> void ObjectStatsCollectorImpl : : CollectGlobalStatistics ( ) { <nl> compilation_cache - > Iterate ( & v ) ; <nl> } <nl> <nl> + void ObjectStatsCollectorImpl : : RecordObjectStats ( HeapObject * obj , <nl> + InstanceType type , <nl> + size_t size ) { <nl> + if ( virtual_objects_ . find ( obj ) = = virtual_objects_ . end ( ) ) <nl> + stats_ - > RecordObjectStats ( type , size ) ; <nl> + } <nl> + <nl> static bool CanRecordFixedArray ( Heap * heap , FixedArrayBase * array ) { <nl> return array - > map ( ) - > instance_type ( ) = = FIXED_ARRAY_TYPE & & <nl> array ! = heap - > empty_fixed_array ( ) & & <nl> void ObjectStatsCollectorImpl : : RecordFixedArrayDetails ( FixedArray * array ) { <nl> <nl> class ObjectStatsVisitor { <nl> public : <nl> + enum CollectionMode { <nl> + kRegular , <nl> + kVirtual , <nl> + } ; <nl> + <nl> ObjectStatsVisitor ( Heap * heap , ObjectStatsCollectorImpl * live_collector , <nl> - ObjectStatsCollectorImpl * dead_collector ) <nl> + ObjectStatsCollectorImpl * dead_collector , <nl> + CollectionMode mode ) <nl> : live_collector_ ( live_collector ) , <nl> dead_collector_ ( dead_collector ) , <nl> marking_state_ ( <nl> - heap - > mark_compact_collector ( ) - > non_atomic_marking_state ( ) ) { } <nl> + heap - > mark_compact_collector ( ) - > non_atomic_marking_state ( ) ) , <nl> + mode_ ( mode ) { } <nl> <nl> bool Visit ( HeapObject * obj , int size ) { <nl> if ( marking_state_ - > IsBlack ( obj ) ) { <nl> - live_collector_ - > CollectStatistics ( obj ) ; <nl> + Collect ( live_collector_ , obj ) ; <nl> } else { <nl> DCHECK ( ! marking_state_ - > IsGrey ( obj ) ) ; <nl> - dead_collector_ - > CollectStatistics ( obj ) ; <nl> + Collect ( dead_collector_ , obj ) ; <nl> } <nl> return true ; <nl> } <nl> <nl> private : <nl> + void Collect ( ObjectStatsCollectorImpl * collector , HeapObject * obj ) { <nl> + switch ( mode_ ) { <nl> + case kRegular : <nl> + collector - > CollectStatistics ( obj ) ; <nl> + break ; <nl> + case kVirtual : <nl> + collector - > CollectVirtualStatistics ( obj ) ; <nl> + break ; <nl> + } <nl> + } <nl> + <nl> ObjectStatsCollectorImpl * live_collector_ ; <nl> ObjectStatsCollectorImpl * dead_collector_ ; <nl> MarkCompactCollector : : NonAtomicMarkingState * marking_state_ ; <nl> + CollectionMode mode_ ; <nl> } ; <nl> <nl> namespace { <nl> void ObjectStatsCollector : : Collect ( ) { <nl> ObjectStatsCollectorImpl live_collector ( heap_ , live_ ) ; <nl> ObjectStatsCollectorImpl dead_collector ( heap_ , dead_ ) ; <nl> / / 1 . Collect system type otherwise indistinguishable from other types . <nl> - / / TODO ( mlippautz ) : Implement . <nl> + { <nl> + ObjectStatsVisitor visitor ( heap_ , & live_collector , & dead_collector , <nl> + ObjectStatsVisitor : : kVirtual ) ; <nl> + IterateHeap ( heap_ , & visitor ) ; <nl> + } <nl> + <nl> / / 2 . Collect globals ; only applies to live objects . <nl> live_collector . CollectGlobalStatistics ( ) ; <nl> / / 3 . Collect rest . <nl> - ObjectStatsVisitor visitor ( heap_ , & live_collector , & dead_collector ) ; <nl> - IterateHeap ( heap_ , & visitor ) ; <nl> + { <nl> + ObjectStatsVisitor visitor ( heap_ , & live_collector , & dead_collector , <nl> + ObjectStatsVisitor : : kRegular ) ; <nl> + IterateHeap ( heap_ , & visitor ) ; <nl> + } <nl> } <nl> <nl> } / / namespace internal <nl> mmm a / src / heap / object - stats . h <nl> ppp b / src / heap / object - stats . h <nl> <nl> # include " src / heap / objects - visiting . h " <nl> # include " src / objects . h " <nl> <nl> + / / These instance types do not exist for actual use but are merely introduced <nl> + / / for object stats tracing . In contrast to Code and FixedArray sub types <nl> + / / these types are not known to other counters outside of object stats <nl> + / / tracing . <nl> + / / <nl> + / / Update LAST_VIRTUAL_TYPE below when changing this macro . <nl> + # define VIRTUAL_INSTANCE_TYPE_LIST ( V ) \ <nl> + V ( JS_ARRAY_BOILERPLATE_TYPE ) \ <nl> + V ( JS_OBJECT_BOILERPLATE_TYPE ) <nl> + <nl> namespace v8 { <nl> namespace internal { <nl> <nl> class ObjectStats { <nl> public : <nl> explicit ObjectStats ( Heap * heap ) : heap_ ( heap ) { ClearObjectStats ( ) ; } <nl> <nl> + / / See description on VIRTUAL_INSTANCE_TYPE_LIST . <nl> + enum VirtualInstanceType { <nl> + # define DEFINE_VIRTUAL_INSTANCE_TYPE ( type ) type , <nl> + VIRTUAL_INSTANCE_TYPE_LIST ( DEFINE_VIRTUAL_INSTANCE_TYPE ) <nl> + # undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE <nl> + LAST_VIRTUAL_TYPE = JS_OBJECT_BOILERPLATE_TYPE , <nl> + } ; <nl> + <nl> / / ObjectStats are kept in two arrays , counts and sizes . Related stats are <nl> / / stored in a contiguous linear buffer . Stats groups are stored one after <nl> / / another . <nl> class ObjectStats { <nl> FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1 , <nl> FIRST_FIXED_ARRAY_SUB_TYPE = <nl> FIRST_CODE_KIND_SUB_TYPE + Code : : NUMBER_OF_KINDS , <nl> - OBJECT_STATS_COUNT = <nl> + FIRST_VIRTUAL_TYPE = <nl> FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1 , <nl> + OBJECT_STATS_COUNT = FIRST_VIRTUAL_TYPE + LAST_VIRTUAL_TYPE + 1 , <nl> } ; <nl> <nl> void ClearObjectStats ( bool clear_last_time_stats = false ) ; <nl> <nl> - void CheckpointObjectStats ( ) ; <nl> void PrintJSON ( const char * key ) ; <nl> void Dump ( std : : stringstream & stream ) ; <nl> <nl> + void CheckpointObjectStats ( ) ; <nl> void RecordObjectStats ( InstanceType type , size_t size ) ; <nl> + void RecordVirtualObjectStats ( VirtualInstanceType type , size_t size ) ; <nl> void RecordCodeSubTypeStats ( int code_sub_type , size_t size ) ; <nl> bool RecordFixedArraySubTypeStats ( FixedArrayBase * array , int array_sub_type , <nl> size_t size , size_t over_allocated ) ; <nl>
|
[ object - stats ] Add capability of recording virtual instance types
|
v8/v8
|
229a3e37f912a04a6ad44e9e837d4a472be81a57
|
2018-01-12T11:44:16Z
|
mmm a / stdlib / public / core / FloatingPoint . swift <nl> ppp b / stdlib / public / core / FloatingPoint . swift <nl> extension BinaryFloatingPoint { <nl> / / / - Parameter value : A floating - point value to be converted . <nl> @ inlinable <nl> public init < Source : BinaryFloatingPoint > ( _ value : Source ) { <nl> + / / If two IEEE 754 binary interchange formats share the same exponent bit <nl> + / / count and significand bit count , then they must share the same encoding <nl> + / / for finite and infinite values . <nl> + switch ( Source . exponentBitCount , Source . significandBitCount ) { <nl> # if ! os ( macOS ) & & ! ( os ( iOS ) & & targetEnvironment ( macCatalyst ) ) <nl> - if # available ( iOS 14 . 0 , watchOS 7 . 0 , tvOS 14 . 0 , * ) { <nl> - if case let value_ as Float16 = value { <nl> - self = Self ( Float ( value_ ) ) <nl> - return <nl> - } <nl> - } <nl> - # endif <nl> - switch value { <nl> - case let value_ as Float : <nl> - self = Self ( value_ ) <nl> - case let value_ as Double : <nl> - self = Self ( value_ ) <nl> - # if ! ( os ( Windows ) | | os ( Android ) ) & & ( arch ( i386 ) | | arch ( x86_64 ) ) <nl> - case let value_ as Float80 : <nl> - self = Self ( value_ ) <nl> - # endif <nl> - default : <nl> - if value . isFinite { <nl> - / / According to IEEE 754 : <nl> - / / - The set of finite floating - point numbers representable within a <nl> - / / particular format is determined by : the radix ( b ) , the precision <nl> - / / ( p , the number of digits in the significand ) , and the maximum and <nl> - / / minimum exponent ( emax and emin , respectively , where <nl> - / / emin = 1 - emax ) . <nl> - / / - In a binary interchange format , each floating - point number has only <nl> - / / one encoding . <nl> - / / <nl> - / / If two binary interchange formats have the same exponent bit count <nl> - / / ( w ) and significand bit count ( p - 1 ) , then they must share the same <nl> - / / encoding for finite values . <nl> - switch ( Source . exponentBitCount , Source . significandBitCount ) { <nl> - # if ! os ( macOS ) & & ! ( os ( iOS ) & & targetEnvironment ( macCatalyst ) ) <nl> - case ( 5 , 10 ) : <nl> - if # available ( iOS 14 . 0 , watchOS 7 . 0 , tvOS 14 . 0 , * ) { <nl> - let value_ = Float16 ( <nl> - sign : value . sign , <nl> - exponentBitPattern : Float16 . RawExponent ( value . exponentBitPattern ) , <nl> - significandBitPattern : <nl> - Float16 . RawSignificand ( value . significandBitPattern ) ) <nl> - self = Self ( Float ( value_ ) ) <nl> - return <nl> - } <nl> - # endif <nl> - case ( 8 , 23 ) : <nl> - let value_ = Float ( <nl> - sign : value . sign , <nl> - exponentBitPattern : Float . RawExponent ( value . exponentBitPattern ) , <nl> - significandBitPattern : <nl> - Float . RawSignificand ( value . significandBitPattern ) ) <nl> - self = Self ( value_ ) <nl> + case ( 5 , 10 ) : <nl> + if # available ( iOS 14 . 0 , watchOS 7 . 0 , tvOS 14 . 0 , * ) { <nl> + if case let value_ as Float16 = value { <nl> + self = Self ( Float ( value_ ) ) <nl> return <nl> - case ( 11 , 52 ) : <nl> - let value_ = Double ( <nl> - sign : value . sign , <nl> - exponentBitPattern : Double . RawExponent ( value . exponentBitPattern ) , <nl> - significandBitPattern : <nl> - Double . RawSignificand ( value . significandBitPattern ) ) <nl> - self = Self ( value_ ) <nl> - return <nl> - # if ! ( os ( Windows ) | | os ( Android ) ) & & ( arch ( i386 ) | | arch ( x86_64 ) ) <nl> - case ( 15 , 63 ) : <nl> - let value_ = Float80 ( <nl> + } <nl> + if ! value . isNaN { <nl> + let value_ = Float16 ( <nl> sign : value . sign , <nl> - exponentBitPattern : Float80 . RawExponent ( value . exponentBitPattern ) , <nl> - significandBitPattern : <nl> - Float80 . RawSignificand ( value . significandBitPattern ) ) <nl> - self = Self ( value_ ) <nl> + exponentBitPattern : UInt ( value . exponentBitPattern ) , <nl> + significandBitPattern : UInt16 ( value . significandBitPattern ) ) <nl> + self = Self ( Float ( value_ ) ) <nl> return <nl> - # endif <nl> - default : <nl> - break <nl> } <nl> } <nl> - self = Self . _convert ( from : value ) . value <nl> + # endif <nl> + case ( 8 , 7 ) : <nl> + if ! value . isNaN { <nl> + let value_ = Float ( <nl> + sign : value . sign , <nl> + exponentBitPattern : UInt ( value . exponentBitPattern ) , <nl> + significandBitPattern : UInt32 ( value . significandBitPattern ) & < < 16 ) <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + case ( 8 , 23 ) : <nl> + if case let value_ as Float = value { <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + if ! value . isNaN { <nl> + let value_ = Float ( <nl> + sign : value . sign , <nl> + exponentBitPattern : UInt ( value . exponentBitPattern ) , <nl> + significandBitPattern : UInt32 ( value . significandBitPattern ) ) <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + case ( 11 , 52 ) : <nl> + if case let value_ as Double = value { <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + if ! value . isNaN { <nl> + let value_ = Double ( <nl> + sign : value . sign , <nl> + exponentBitPattern : UInt ( value . exponentBitPattern ) , <nl> + significandBitPattern : UInt64 ( value . significandBitPattern ) ) <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + # if ! ( os ( Windows ) | | os ( Android ) ) & & ( arch ( i386 ) | | arch ( x86_64 ) ) <nl> + case ( 15 , 63 ) : <nl> + if case let value_ as Float80 = value { <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + if ! value . isNaN { <nl> + let value_ = Float80 ( <nl> + sign : value . sign , <nl> + exponentBitPattern : UInt ( value . exponentBitPattern ) , <nl> + significandBitPattern : UInt64 ( value . significandBitPattern ) ) <nl> + self = Self ( value_ ) <nl> + return <nl> + } <nl> + # endif <nl> + default : <nl> + break <nl> } <nl> + self = Self . _convert ( from : value ) . value <nl> } <nl> <nl> / / / Creates a new instance from the given value , if it can be represented <nl>
|
[ stdlib ] Refactor generic floating - point conversion fast paths
|
apple/swift
|
9a6900ad3ad338614836ede147af284759250683
|
2020-09-07T22:47:01Z
|
mmm a / stdlib / public / core / ExistentialCollection . swift . gyb <nl> ppp b / stdlib / public / core / ExistentialCollection . swift . gyb <nl> internal protocol _ForwardIndexBoxType : class { <nl> } <nl> <nl> internal class _ForwardIndexBox < <nl> - BaseIndex : ForwardIndexType <nl> + BaseIndex_ : ForwardIndexType <nl> > : _ForwardIndexBoxType { <nl> + typealias BaseIndex = BaseIndex_ <nl> + <nl> required init ( _ base : BaseIndex ) { <nl> self . base = base <nl> } <nl> internal protocol _BidirectionalIndexBoxType : _ForwardIndexBoxType { <nl> } <nl> <nl> internal class _BidirectionalIndexBox < <nl> - BaseIndex : BidirectionalIndexType <nl> - > : _ForwardIndexBox < BaseIndex > , _BidirectionalIndexBoxType { <nl> + BaseIndex__ : BidirectionalIndexType <nl> + > : _ForwardIndexBox < BaseIndex__ > , _BidirectionalIndexBoxType { <nl> required init ( _ base : BaseIndex ) { <nl> super . init ( base ) <nl> } <nl> internal class _BidirectionalIndexBox < <nl> internal protocol _RandomAccessIndexBoxType : _BidirectionalIndexBoxType { } <nl> <nl> internal final class _RandomAccessIndexBox < <nl> - BaseIndex : RandomAccessIndexType <nl> - > : _BidirectionalIndexBox < BaseIndex > , _RandomAccessIndexBoxType { <nl> + BaseIndex___ : RandomAccessIndexType <nl> + > : _BidirectionalIndexBox < BaseIndex___ > , _RandomAccessIndexBoxType { <nl> required init ( _ base : BaseIndex ) { <nl> super . init ( base ) <nl> } <nl>
|
[ stdlib ] Workaround for < rdar : / / 20409234 >
|
apple/swift
|
ed5156e3ee2eaec34f4d200c5ee494ffe5c8ea83
|
2015-04-07T15:12:12Z
|
mmm a / atom / app / atom_library_main . h <nl> ppp b / atom / app / atom_library_main . h <nl> <nl> # ifndef ATOM_APP_ATOM_LIBRARY_MAIN_H_ <nl> # define ATOM_APP_ATOM_LIBRARY_MAIN_H_ <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> <nl> # if defined ( OS_MACOSX ) <nl> extern " C " { <nl> mmm a / atom / browser / auto_updater . h <nl> ppp b / atom / browser / auto_updater . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> <nl> namespace base { <nl> class Time ; <nl> mmm a / atom / browser / browser . h <nl> ppp b / atom / browser / browser . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / compiler_specific . h " <nl> # include " base / observer_list . h " <nl> # include " base / strings / string16 . h " <nl> mmm a / atom / browser / javascript_environment . h <nl> ppp b / atom / browser / javascript_environment . h <nl> <nl> # ifndef ATOM_BROWSER_JAVASCRIPT_ENVIRONMENT_H_ <nl> # define ATOM_BROWSER_JAVASCRIPT_ENVIRONMENT_H_ <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " gin / public / isolate_holder . h " <nl> <nl> namespace atom { <nl> mmm a / atom / browser / ui / views / global_menu_bar_x11 . h <nl> ppp b / atom / browser / ui / views / global_menu_bar_x11 . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / compiler_specific . h " <nl> # include " ui / base / glib / glib_signal . h " <nl> # include " ui / gfx / native_widget_types . h " <nl> mmm a / atom / browser / ui / win / notify_icon . h <nl> ppp b / atom / browser / ui / win / notify_icon . h <nl> <nl> # include < string > <nl> <nl> # include " atom / browser / ui / tray_icon . h " <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / compiler_specific . h " <nl> # include " base / memory / scoped_ptr . h " <nl> # include " base / win / scoped_gdi_object . h " <nl> mmm a / atom / browser / window_list . h <nl> ppp b / atom / browser / window_list . h <nl> <nl> <nl> # include < vector > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / lazy_instance . h " <nl> # include " base / observer_list . h " <nl> <nl> mmm a / atom / common / api / object_life_monitor . h <nl> ppp b / atom / common / api / object_life_monitor . h <nl> <nl> # ifndef ATOM_COMMON_API_OBJECT_LIFE_MONITOR_H_ <nl> # define ATOM_COMMON_API_OBJECT_LIFE_MONITOR_H_ <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / memory / weak_ptr . h " <nl> # include " v8 / include / v8 . h " <nl> <nl> mmm a / atom / common / atom_command_line . h <nl> ppp b / atom / common / atom_command_line . h <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> <nl> namespace atom { <nl> <nl> mmm a / atom / common / crash_reporter / crash_reporter . h <nl> ppp b / atom / common / crash_reporter / crash_reporter . h <nl> <nl> # include < utility > <nl> # include < vector > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> <nl> namespace crash_reporter { <nl> <nl> mmm a / atom / common / crash_reporter / linux / crash_dump_handler . h <nl> ppp b / atom / common / crash_reporter / linux / crash_dump_handler . h <nl> <nl> # ifndef ATOM_COMMON_CRASH_REPORTER_LINUX_CRASH_DUMP_HANDLER_H_ <nl> # define ATOM_COMMON_CRASH_REPORTER_LINUX_CRASH_DUMP_HANDLER_H_ <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " vendor / breakpad / src / common / simple_string_dictionary . h " <nl> <nl> namespace crash_reporter { <nl> mmm a / atom / common / crash_reporter / win / crash_service . h <nl> ppp b / atom / common / crash_reporter / win / crash_service . h <nl> <nl> <nl> # include < string > <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / files / file_path . h " <nl> # include " base / synchronization / lock . h " <nl> <nl> mmm a / atom / common / native_mate_converters / v8_value_converter . h <nl> ppp b / atom / common / native_mate_converters / v8_value_converter . h <nl> <nl> # ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_V8_VALUE_CONVERTER_H_ <nl> # define ATOM_COMMON_NATIVE_MATE_CONVERTERS_V8_VALUE_CONVERTER_H_ <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / compiler_specific . h " <nl> # include " v8 / include / v8 . h " <nl> <nl> mmm a / atom / common / node_bindings . h <nl> ppp b / atom / common / node_bindings . h <nl> <nl> # ifndef ATOM_COMMON_NODE_BINDINGS_H_ <nl> # define ATOM_COMMON_NODE_BINDINGS_H_ <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " base / memory / weak_ptr . h " <nl> # include " v8 / include / v8 . h " <nl> # include " vendor / node / deps / uv / include / uv . h " <nl> mmm a / atom / renderer / node_array_buffer_bridge . cc <nl> ppp b / atom / renderer / node_array_buffer_bridge . cc <nl> <nl> <nl> # include " atom / renderer / node_array_buffer_bridge . h " <nl> <nl> - # include " base / basictypes . h " <nl> + # include " base / macros . h " <nl> # include " atom / common / node_includes . h " <nl> # include " native_mate / converter . h " <nl> # include " third_party / WebKit / public / web / WebArrayBuffer . h " <nl>
|
basictypes . h = > macros . h
|
electron/electron
|
d2944c62a5dd58de13ebed4e7b55529c9c309b74
|
2016-03-10T08:06:21Z
|
mmm a / include / simdjson / implementation . h <nl> ppp b / include / simdjson / implementation . h <nl> <nl> <nl> namespace simdjson { <nl> <nl> + / * * <nl> + * Validate the UTF - 8 string . <nl> + * <nl> + * @ param buf the string to validate . <nl> + * @ param len the length of the string in bytes . <nl> + * @ return true if the string is valid UTF - 8 . <nl> + * / <nl> + WARN_UNUSED bool validate_utf8 ( const char * buf , size_t length ) noexcept ; <nl> + <nl> + <nl> + / * * <nl> + * Validate the UTF - 8 string . <nl> + * <nl> + * @ param p the string_view to validate . <nl> + * @ return true if the string is valid UTF - 8 . <nl> + * / <nl> + WARN_UNUSED bool validate_utf8 ( std : : string_view & p ) noexcept ; <nl> + <nl> namespace dom { <nl> class document ; <nl> } / / namespace dom <nl> mmm a / include / simdjson / simdjson . h <nl> ppp b / include / simdjson / simdjson . h <nl> <nl> <nl> # include " simdjson / compiler_check . h " <nl> # include " simdjson / error . h " <nl> - <nl> # endif / / SIMDJSON_H <nl> mmm a / src / arm64 / dom_parser_implementation . cpp <nl> ppp b / src / arm64 / dom_parser_implementation . cpp <nl> WARN_UNUSED error_code dom_parser_implementation : : stage1 ( const uint8_t * _buf , si <nl> return arm64 : : stage1 : : json_structural_indexer : : index < 64 > ( buf , len , * this , streaming ) ; <nl> } <nl> # include " generic / stage1 / utf8_validator . h " <nl> + WARN_UNUSED bool implementation : : validate_utf8 ( const char * buf , size_t len ) const noexcept { <nl> + return simdjson : : arm64 : : stage1 : : utf8_validate ( buf , len ) ; <nl> + } <nl> } / / namespace arm64 <nl> } / / namespace simdjson <nl> <nl> mmm a / src / implementation . cpp <nl> ppp b / src / implementation . cpp <nl> SIMDJSON_DLLIMPORTEXPORT internal : : atomic_ptr < const implementation > active_imple <nl> WARN_UNUSED error_code minify ( const char * buf , size_t len , char * dst , size_t & dst_len ) noexcept { <nl> return active_implementation - > minify ( ( const uint8_t * ) buf , len , ( uint8_t * ) dst , dst_len ) ; <nl> } <nl> + WARN_UNUSED bool validate_utf8 ( const char * buf , size_t len ) noexcept { <nl> + return active_implementation - > validate_utf8 ( buf , len ) ; <nl> + } <nl> <nl> <nl> } / / namespace simdjson <nl> mmm a / src / westmere / dom_parser_implementation . cpp <nl> ppp b / src / westmere / dom_parser_implementation . cpp <nl> WARN_UNUSED error_code dom_parser_implementation : : stage1 ( const uint8_t * _buf , si <nl> return westmere : : stage1 : : json_structural_indexer : : index < 64 > ( _buf , _len , * this , streaming ) ; <nl> } <nl> # include " generic / stage1 / utf8_validator . h " <nl> + WARN_UNUSED bool implementation : : validate_utf8 ( const char * buf , size_t len ) const noexcept { <nl> + return simdjson : : westmere : : stage1 : : utf8_validate ( buf , len ) ; <nl> + } <nl> } / / namespace westmere <nl> } / / namespace simdjson <nl> UNTARGET_REGION <nl> mmm a / tests / basictests . cpp <nl> ppp b / tests / basictests . cpp <nl> namespace type_tests { <nl> } <nl> <nl> <nl> + namespace validate_tests { <nl> + bool test_validate ( ) { <nl> + std : : cout < < " Running " < < __func__ < < std : : endl ; <nl> + const std : : string test = R " ( { " foo " : 1 , " bar " : [ 1 , 2 , 3 ] , " baz " : { " a " : 1 , " b " : 2 , " c " : 3 } } ) " ; <nl> + if ( ! simdjson : : validate_utf8 ( test . data ( ) , test . size ( ) ) ) { <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + bool test_bad_validate ( ) { <nl> + std : : cout < < " Running " < < __func__ < < std : : endl ; <nl> + const std : : string test = " \ x80 \ x81 " ; <nl> + if ( simdjson : : validate_utf8 ( test . data ( ) , test . size ( ) ) ) { <nl> + return false ; <nl> + } <nl> + return true ; <nl> + } <nl> + bool run ( ) { <nl> + return test_validate ( ) & & <nl> + test_bad_validate ( ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> <nl> namespace minify_tests { <nl> <nl> int main ( int argc , char * argv [ ] ) { <nl> printf ( " unsupported CPU \ n " ) ; <nl> } <nl> std : : cout < < " Running basic tests . " < < std : : endl ; <nl> - if ( minify_tests : : run ( ) & & <nl> + if ( validate_tests : : run ( ) & & <nl> + minify_tests : : run ( ) & & <nl> parse_api_tests : : run ( ) & & <nl> dom_api_tests : : run ( ) & & <nl> type_tests : : run ( ) & & <nl>
|
Ok
|
simdjson/simdjson
|
5dbcdf148440e9895383724dbda4fb4036db5ceb
|
2020-06-21T21:52:30Z
|
mmm a / hphp / runtime / base / apc - local - array . cpp <nl> ppp b / hphp / runtime / base / apc - local - array . cpp <nl> bool APCLocalArray : : Uasort ( ArrayData * , const Variant & cmp_function ) { <nl> } <nl> <nl> ssize_t APCLocalArray : : IterBegin ( const ArrayData * ad ) { <nl> - return 0 ; <nl> - } <nl> - <nl> - ssize_t APCLocalArray : : IterLast ( const ArrayData * ad ) { <nl> auto a = asSharedArray ( ad ) ; <nl> - auto n = a - > m_size ; <nl> - return n > 0 ? ssize_t ( n - 1 ) : 0 ; <nl> + return a - > m_size > 0 ? 0 : invalid_index ; <nl> } <nl> <nl> ssize_t APCLocalArray : : IterEnd ( const ArrayData * ad ) { <nl> auto a = asSharedArray ( ad ) ; <nl> auto n = a - > m_size ; <nl> - return n ; <nl> + return n > 0 ? ssize_t ( n - 1 ) : invalid_index ; <nl> } <nl> <nl> ssize_t APCLocalArray : : IterAdvance ( const ArrayData * ad , ssize_t prev ) { <nl> ssize_t APCLocalArray : : IterAdvance ( const ArrayData * ad , ssize_t prev ) { <nl> } <nl> <nl> ssize_t APCLocalArray : : IterRewind ( const ArrayData * ad , ssize_t prev ) { <nl> - auto a = asSharedArray ( ad ) ; <nl> - assert ( prev > = 0 & & prev < a - > m_size ) ; <nl> + assert ( prev > = 0 & & prev < asSharedArray ( ad ) - > m_size ) ; <nl> ssize_t next = prev - 1 ; <nl> - return next > = 0 ? next : a - > m_size ; <nl> + return next > = 0 ? next : invalid_index ; <nl> } <nl> <nl> bool APCLocalArray : : ValidMArrayIter ( const ArrayData * ad , <nl> mmm a / hphp / runtime / base / apc - local - array . h <nl> ppp b / hphp / runtime / base / apc - local - array . h <nl> struct APCLocalArray : private ArrayData <nl> static void NvGetKey ( const ArrayData * , TypedValue * out , ssize_t pos ) ; <nl> static bool IsVectorData ( const ArrayData * ad ) ; <nl> static ssize_t IterBegin ( const ArrayData * ) ; <nl> - static ssize_t IterLast ( const ArrayData * ) ; <nl> static ssize_t IterEnd ( const ArrayData * ) ; <nl> static ssize_t IterAdvance ( const ArrayData * , ssize_t prev ) ; <nl> static ssize_t IterRewind ( const ArrayData * , ssize_t prev ) ; <nl> struct APCLocalArray : private ArrayData <nl> ssize_t iterAdvanceImpl ( ssize_t prev ) const { <nl> assert ( prev > = 0 & & prev < m_size ) ; <nl> ssize_t next = prev + 1 ; <nl> - return next < m_size ? next : m_size ; <nl> + return next < m_size ? next : invalid_index ; <nl> } <nl> <nl> / / Only explicit conversions are allowed to and from ArrayData * . <nl> mmm a / hphp / runtime / base / array - common . cpp <nl> ppp b / hphp / runtime / base / array - common . cpp <nl> namespace HPHP { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> ssize_t ArrayCommon : : ReturnInvalidIndex ( const ArrayData * ) { <nl> - return 0 ; <nl> + return ArrayData : : invalid_index ; <nl> } <nl> <nl> bool ArrayCommon : : ValidMArrayIter ( const ArrayData * ad , const MArrayIter & fp ) { <nl> bool ArrayCommon : : ValidMArrayIter ( const ArrayData * ad , const MArrayIter & fp ) { <nl> } <nl> assert ( fp . getContainer ( ) = = ad ) ; <nl> if ( fp . getResetFlag ( ) ) return false ; <nl> - return fp . m_pos ! = ( ad - > isPacked ( ) ? ad - > getSize ( ) <nl> - : MixedArray : : asMixed ( ad ) - > iterLimit ( ) ) ; <nl> + return fp . m_pos ! = ArrayData : : invalid_index ; <nl> } <nl> <nl> ArrayData * ArrayCommon : : Pop ( ArrayData * a , Variant & value ) { <nl> if ( ! a - > empty ( ) ) { <nl> - auto const pos = a - > iter_last ( ) ; <nl> + auto const pos = a - > iter_end ( ) ; <nl> value = a - > getValue ( pos ) ; <nl> return a - > remove ( a - > getKey ( pos ) , a - > hasMultipleRefs ( ) ) ; <nl> } <nl> mmm a / hphp / runtime / base / array - data - defs . h <nl> ppp b / hphp / runtime / base / array - data - defs . h <nl> inline ssize_t ArrayData : : iter_begin ( ) const { <nl> return g_array_funcs . iterBegin [ m_kind ] ( this ) ; <nl> } <nl> <nl> - inline ssize_t ArrayData : : iter_last ( ) const { <nl> - return g_array_funcs . iterLast [ m_kind ] ( this ) ; <nl> - } <nl> - <nl> inline ssize_t ArrayData : : iter_end ( ) const { <nl> return g_array_funcs . iterEnd [ m_kind ] ( this ) ; <nl> } <nl> mmm a / hphp / runtime / base / array - data . cpp <nl> ppp b / hphp / runtime / base / array - data . cpp <nl> extern const ArrayFunctions g_array_funcs = { <nl> DISPATCH_INTMAP_SPECIALIZED ( RemoveStr ) <nl> <nl> / * <nl> - * ssize_t IterEnd ( const ArrayData * ) <nl> - * <nl> - * Returns the canonical invalid position for this array . Note <nl> - * that if elements are added or removed from the array , the value <nl> - * of the array ' s canonical invalid position may change . <nl> - * <nl> * ssize_t IterBegin ( const ArrayData * ) <nl> + * ssize_t IterEnd ( const ArrayData * ) <nl> * <nl> - * Returns the position of the first element , or the canonical <nl> - * invalid position if this array is empty . <nl> - * <nl> - * ssize_t IterLast ( const ArrayData * ) <nl> - * <nl> - * Returns the position of the last element , or the canonical <nl> - * invalid position if this array is empty . <nl> + * Array positions are represented as an opaque ssize_t . <nl> + * IterBegin returns the position of the first element in the <nl> + * array , and IterEnd returns the position of the last element in <nl> + * the array . Either function may return ArrayData : : invalid_index <nl> + * if there is no first or last element . <nl> * / <nl> DISPATCH ( IterBegin ) <nl> - DISPATCH ( IterLast ) <nl> DISPATCH ( IterEnd ) <nl> <nl> / * <nl> - * ssize_t IterAdvance ( const ArrayData * , size_t pos ) <nl> + * ssize_t IterAdvance ( const ArrayData * , ssize_t pos ) <nl> * <nl> - * Returns the position of the element that comes after pos , or the <nl> - * canonical invalid position if there are no more elements after pos . <nl> - * If pos is the canonical invalid position , this method will return <nl> - * the canonical invalid position . <nl> + * Advance ` pos ' to the next position in the array . ` pos ' may be <nl> + * invalid_index , in which case this function returns the position <nl> + * of the first element in the array . Returns invalid_index if <nl> + * there is no next position in the array . <nl> * / <nl> DISPATCH ( IterAdvance ) <nl> <nl> / * <nl> - * ssize_t IterRewind ( const ArrayData * , size_t pos ) <nl> + * ssize_t IterRewind ( const ArrayData * , ssize_t pos ) <nl> * <nl> - * Returns the position of the element that comes before pos , or the <nl> - * canonical invalid position if there are no elements before pos . If <nl> - * pos is the canonical invalid position , no guarantees are made about <nl> - * what this method returns . <nl> + * Move ` pos ' to the position of the previous element in the <nl> + * array . ` pos ' may be invalid_index , in which case this function <nl> + * returns invalid_index . Returns invalid_index if there is no <nl> + * previous position in the array . <nl> * / <nl> DISPATCH ( IterRewind ) <nl> <nl> bool ArrayData : : equal ( const ArrayData * v2 , bool strict ) const { <nl> <nl> Variant ArrayData : : reset ( ) { <nl> setPosition ( iter_begin ( ) ) ; <nl> - return m_pos ! = iter_end ( ) ? getValue ( m_pos ) : Variant ( false ) ; <nl> - } <nl> - <nl> - Variant ArrayData : : next ( ) { <nl> - / / We call iter_advance ( ) without checking if m_pos is the canonical invalid <nl> - / / position . This is okay , since all IterAdvance ( ) impls handle this <nl> - / / correctly , but it means that EmptyArray : : IterAdvance ( ) is reachable . <nl> - setPosition ( iter_advance ( m_pos ) ) ; <nl> - return m_pos ! = iter_end ( ) ? getValue ( m_pos ) : Variant ( false ) ; <nl> + return m_pos ! = invalid_index ? getValue ( m_pos ) : Variant ( false ) ; <nl> } <nl> <nl> Variant ArrayData : : prev ( ) { <nl> - / / We only call iter_rewind ( ) if m_pos is not the canonical invalid position . <nl> - / / Thus , EmptyArray : : IterRewind ( ) is not reachable . <nl> - auto pos_limit = iter_end ( ) ; <nl> - if ( m_pos ! = pos_limit ) { <nl> + if ( m_pos ! = invalid_index ) { <nl> setPosition ( iter_rewind ( m_pos ) ) ; <nl> - if ( m_pos ! = pos_limit ) { <nl> + if ( m_pos ! = invalid_index ) { <nl> + return getValue ( m_pos ) ; <nl> + } <nl> + } <nl> + return Variant ( false ) ; <nl> + } <nl> + <nl> + Variant ArrayData : : next ( ) { <nl> + if ( m_pos ! = invalid_index ) { <nl> + setPosition ( iter_advance ( m_pos ) ) ; <nl> + if ( m_pos ! = invalid_index ) { <nl> return getValue ( m_pos ) ; <nl> } <nl> } <nl> Variant ArrayData : : prev ( ) { <nl> } <nl> <nl> Variant ArrayData : : end ( ) { <nl> - setPosition ( iter_last ( ) ) ; <nl> - return m_pos ! = iter_end ( ) ? getValue ( m_pos ) : Variant ( false ) ; <nl> + setPosition ( iter_end ( ) ) ; <nl> + return m_pos ! = invalid_index ? getValue ( m_pos ) : Variant ( false ) ; <nl> } <nl> <nl> Variant ArrayData : : key ( ) const { <nl> - return m_pos ! = iter_end ( ) ? getKey ( m_pos ) : uninit_null ( ) ; <nl> + return m_pos ! = invalid_index ? getKey ( m_pos ) : uninit_null ( ) ; <nl> } <nl> <nl> Variant ArrayData : : value ( int32_t & pos ) const { <nl> - return pos ! = iter_end ( ) ? getValue ( pos ) : Variant ( false ) ; <nl> + return pos ! = invalid_index ? getValue ( pos ) : Variant ( false ) ; <nl> } <nl> <nl> Variant ArrayData : : current ( ) const { <nl> - return m_pos ! = iter_end ( ) ? getValue ( m_pos ) : Variant ( false ) ; <nl> + return m_pos ! = invalid_index ? getValue ( m_pos ) : Variant ( false ) ; <nl> } <nl> <nl> const StaticString <nl> const StaticString <nl> s_key ( " key " ) ; <nl> <nl> Variant ArrayData : : each ( ) { <nl> - if ( m_pos ! = iter_end ( ) ) { <nl> + if ( m_pos ! = invalid_index ) { <nl> ArrayInit ret ( 4 , ArrayInit : : Mixed { } ) ; <nl> Variant key ( getKey ( m_pos ) ) ; <nl> Variant value ( getValue ( m_pos ) ) ; <nl> mmm a / hphp / runtime / base / array - data . h <nl> ppp b / hphp / runtime / base / array - data . h <nl> struct ArrayData { <nl> kNumKinds / / insert new values before kNumKinds . <nl> } ; <nl> <nl> + static constexpr ssize_t invalid_index = - 1 ; <nl> + <nl> protected : <nl> / * <nl> * NOTE : MixedArray no longer calls this constructor . If you change <nl> struct ArrayData { <nl> Variant each ( ) ; <nl> <nl> bool isHead ( ) const { return m_pos = = iter_begin ( ) ; } <nl> - bool isTail ( ) const { return m_pos = = iter_last ( ) ; } <nl> - bool isInvalid ( ) const { return m_pos = = iter_end ( ) ; } <nl> + bool isTail ( ) const { return m_pos = = iter_end ( ) ; } <nl> + bool isInvalid ( ) const { return m_pos = = invalid_index ; } <nl> <nl> / * * <nl> * Testing whether a key exists . <nl> struct ArrayData { <nl> ArrayData * remove ( const String & k , bool copy ) ; <nl> ArrayData * remove ( const Variant & k , bool copy ) ; <nl> <nl> - / / See the documentation for IterEnd , IterBegin , etc . in array - data . cpp <nl> ssize_t iter_begin ( ) const ; <nl> - ssize_t iter_last ( ) const ; <nl> ssize_t iter_end ( ) const ; <nl> ssize_t iter_advance ( ssize_t prev ) const ; <nl> ssize_t iter_rewind ( ssize_t prev ) const ; <nl> struct ArrayFunctions { <nl> ArrayData * ( * removeInt [ NK ] ) ( ArrayData * , int64_t k , bool copy ) ; <nl> ArrayData * ( * removeStr [ NK ] ) ( ArrayData * , const StringData * k , bool copy ) ; <nl> ssize_t ( * iterBegin [ NK ] ) ( const ArrayData * ) ; <nl> - ssize_t ( * iterLast [ NK ] ) ( const ArrayData * ) ; <nl> ssize_t ( * iterEnd [ NK ] ) ( const ArrayData * ) ; <nl> ssize_t ( * iterAdvance [ NK ] ) ( const ArrayData * , ssize_t pos ) ; <nl> ssize_t ( * iterRewind [ NK ] ) ( const ArrayData * , ssize_t pos ) ; <nl> mmm a / hphp / runtime / base / array - iterator . cpp <nl> ppp b / hphp / runtime / base / array - iterator . cpp <nl> ArrayIter : : ArrayIter ( const Array & array ) { <nl> arrInit ( array . get ( ) ) ; <nl> } <nl> <nl> - ArrayIter : : ArrayIter ( ObjectData * obj ) { <nl> + ArrayIter : : ArrayIter ( ObjectData * obj ) <nl> + : m_pos ( ArrayData : : invalid_index ) { <nl> objInit < true > ( obj ) ; <nl> } <nl> <nl> - ArrayIter : : ArrayIter ( ObjectData * obj , NoInc ) { <nl> + ArrayIter : : ArrayIter ( ObjectData * obj , NoInc ) <nl> + : m_pos ( ArrayData : : invalid_index ) { <nl> objInit < false > ( obj ) ; <nl> } <nl> <nl> - ArrayIter : : ArrayIter ( const Object & obj ) { <nl> + ArrayIter : : ArrayIter ( const Object & obj ) <nl> + : m_pos ( ArrayData : : invalid_index ) { <nl> objInit < true > ( obj . get ( ) ) ; <nl> } <nl> <nl> void ArrayIter : : arrInit ( const ArrayData * arr ) { <nl> if ( arr ) { <nl> arr - > incRefCount ( ) ; <nl> m_pos = arr - > iter_begin ( ) ; <nl> + } else { <nl> + m_pos = ArrayData : : invalid_index ; <nl> } <nl> } <nl> <nl> Variant ArrayIter : : firstHelper ( ) { <nl> <nl> Variant ArrayIter : : second ( ) { <nl> if ( LIKELY ( hasArrayData ( ) ) ) { <nl> + assert ( m_pos ! = ArrayData : : invalid_index ) ; <nl> const ArrayData * ad = getArrayData ( ) ; <nl> assert ( ad ) ; <nl> - assert ( m_pos ! = ad - > iter_end ( ) ) ; <nl> return ad - > getValue ( m_pos ) ; <nl> } <nl> switch ( getCollectionType ( ) ) { <nl> const Variant & ArrayIter : : secondRef ( ) { <nl> throw FatalErrorException ( " taking reference on iterator objects " ) ; <nl> } <nl> assert ( hasArrayData ( ) ) ; <nl> + assert ( m_pos ! = ArrayData : : invalid_index ) ; <nl> const ArrayData * ad = getArrayData ( ) ; <nl> assert ( ad ) ; <nl> - assert ( m_pos ! = ad - > iter_end ( ) ) ; <nl> return ad - > getValueRef ( m_pos ) ; <nl> } <nl> <nl> const Variant & ArrayIter : : secondRefPlus ( ) { <nl> if ( LIKELY ( hasArrayData ( ) ) ) { <nl> + assert ( m_pos ! = ArrayData : : invalid_index ) ; <nl> const ArrayData * ad = getArrayData ( ) ; <nl> assert ( ad ) ; <nl> - assert ( m_pos ! = ad - > iter_end ( ) ) ; <nl> return ad - > getValueRef ( m_pos ) ; <nl> } <nl> switch ( getCollectionType ( ) ) { <nl> static int64_t iter_next_apc_array ( Iter * iter , <nl> auto const arrIter = & iter - > arr ( ) ; <nl> auto const arr = APCLocalArray : : asSharedArray ( ad ) ; <nl> ssize_t const pos = arr - > iterAdvanceImpl ( arrIter - > getPos ( ) ) ; <nl> - if ( UNLIKELY ( pos = = ad - > getSize ( ) ) ) { <nl> + if ( UNLIKELY ( pos = = ArrayData : : invalid_index ) ) { <nl> if ( UNLIKELY ( arr - > hasExactlyOneRef ( ) ) ) { <nl> return iter_next_free_apc ( iter , arr ) ; <nl> } <nl> mmm a / hphp / runtime / base / array - iterator . h <nl> ppp b / hphp / runtime / base / array - iterator . h <nl> struct ArrayIter { <nl> * Constructors . Note that sometimes ArrayIter objects are created <nl> * without running their C + + constructor . ( See new_iter_array . ) <nl> * / <nl> - ArrayIter ( ) { <nl> + ArrayIter ( ) : m_pos ( ArrayData : : invalid_index ) { <nl> m_data = nullptr ; <nl> } <nl> explicit ArrayIter ( const ArrayData * data ) ; <nl> struct ArrayIter { <nl> setArrayData ( data ) ; <nl> if ( data ) { <nl> m_pos = data - > iter_begin ( ) ; <nl> + } else { <nl> + m_pos = ArrayData : : invalid_index ; <nl> } <nl> } <nl> explicit ArrayIter ( const MixedArray * ) = delete ; <nl> struct ArrayIter { <nl> void operator + + ( ) { next ( ) ; } <nl> bool end ( ) { <nl> if ( LIKELY ( hasArrayData ( ) ) ) { <nl> - auto * ad = getArrayData ( ) ; <nl> - return ! ad | | m_pos = = ad - > iter_end ( ) ; <nl> + return m_pos = = ArrayData : : invalid_index ; <nl> } <nl> return endHelper ( ) ; <nl> } <nl> struct ArrayIter { <nl> if ( LIKELY ( hasArrayData ( ) ) ) { <nl> const ArrayData * ad = getArrayData ( ) ; <nl> assert ( ad ) ; <nl> - assert ( m_pos ! = ad - > iter_end ( ) ) ; <nl> + assert ( m_pos ! = ArrayData : : invalid_index ) ; <nl> m_pos = ad - > iter_advance ( m_pos ) ; <nl> return ; <nl> } <nl> struct ArrayIter { <nl> if ( LIKELY ( hasArrayData ( ) ) ) { <nl> const ArrayData * ad = getArrayData ( ) ; <nl> assert ( ad ) ; <nl> - assert ( m_pos ! = ad - > iter_end ( ) ) ; <nl> + assert ( m_pos ! = ArrayData : : invalid_index ) ; <nl> return ad - > getKey ( m_pos ) ; <nl> } <nl> return firstHelper ( ) ; <nl> struct ArrayIter { <nl> Variant firstHelper ( ) ; <nl> void nvFirst ( TypedValue * out ) { <nl> const ArrayData * ad = getArrayData ( ) ; <nl> - assert ( ad & & m_pos ! = ad - > iter_end ( ) ) ; <nl> + assert ( ad & & m_pos ! = ArrayData : : invalid_index ) ; <nl> const_cast < ArrayData * > ( ad ) - > nvGetKey ( out , m_pos ) ; <nl> } <nl> <nl> struct ArrayIter { <nl> / / Inline version of secondRef . Only for use in iterator helpers . <nl> const TypedValue * nvSecond ( ) const { <nl> const ArrayData * ad = getArrayData ( ) ; <nl> - assert ( ad & & m_pos ! = ad - > iter_end ( ) ) ; <nl> + assert ( ad & & m_pos ! = ArrayData : : invalid_index ) ; <nl> return ad - > getValueRef ( m_pos ) . asTypedValue ( ) ; <nl> } <nl> <nl> struct ArrayIter { <nl> ObjectData * m_obj ; <nl> } ; <nl> public : <nl> - / / m_pos is used by the array implementation to track the current position <nl> - / / in the array . Beware that when m_data is null , m_pos is uninitialized . <nl> ssize_t m_pos ; <nl> private : <nl> int m_version ; <nl> struct MArrayIter { <nl> ArrayData * m_data ; <nl> } ; <nl> public : <nl> - / / m_pos is used by the array implementation to track the current position <nl> - / / in the array . <nl> + / / m_pos is an opaque value used by the array implementation to track the <nl> + / / current position in the array . <nl> ssize_t m_pos ; <nl> private : <nl> / / m_container keeps track of which array we ' re " registered " with . Normally <nl> mmm a / hphp / runtime / base / array - util . cpp <nl> ppp b / hphp / runtime / base / array - util . cpp <nl> Variant ArrayUtil : : Reverse ( const Array & input , bool preserve_keys / * = false * / ) <nl> } <nl> <nl> Array ret = Array : : Create ( ) ; <nl> - auto pos_limit = input - > iter_end ( ) ; <nl> - for ( ssize_t pos = input - > iter_last ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = input - > iter_end ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = input - > iter_rewind ( pos ) ) { <nl> Variant key ( input - > getKey ( pos ) ) ; <nl> if ( preserve_keys | | key . isString ( ) ) { <nl> Variant ArrayUtil : : Shuffle ( const Array & input ) { <nl> <nl> std : : vector < ssize_t > indices ; <nl> indices . reserve ( count ) ; <nl> - auto pos_limit = input - > iter_end ( ) ; <nl> - for ( ssize_t pos = input - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = input - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = input - > iter_advance ( pos ) ) { <nl> indices . push_back ( pos ) ; <nl> } <nl> Variant ArrayUtil : : RandomKeys ( const Array & input , int num_req / * = 1 * / ) { <nl> <nl> std : : vector < ssize_t > indices ; <nl> indices . reserve ( count ) ; <nl> - auto pos_limit = input - > iter_end ( ) ; <nl> - for ( ssize_t pos = input - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = input - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = input - > iter_advance ( pos ) ) { <nl> indices . push_back ( pos ) ; <nl> } <nl> mmm a / hphp / runtime / base / empty - array . cpp <nl> ppp b / hphp / runtime / base / empty - array . cpp <nl> struct EmptyArray : : Initializer { <nl> auto const ad = static_cast < ArrayData * > ( vpEmpty ) ; <nl> ad - > m_kind = ArrayData : : kEmptyKind ; <nl> ad - > m_size = 0 ; <nl> - ad - > m_pos = 0 ; <nl> + ad - > m_pos = ArrayData : : invalid_index ; <nl> ad - > m_count = 0 ; <nl> ad - > setStatic ( ) ; <nl> } <nl> const Variant & EmptyArray : : GetValueRef ( const ArrayData * ad , ssize_t pos ) { <nl> not_reached ( ) ; <nl> } <nl> <nl> - / / EmptyArray : : IterAdvance ( ) is reachable ; see ArrayData : : next ( ) for details <nl> + / / Iterators can ' t be advanced or rewinded , because we have no valid <nl> + / / iterators . <nl> ssize_t EmptyArray : : IterAdvance ( const ArrayData * , ssize_t prev ) { <nl> - return 0 ; <nl> + not_reached ( ) ; <nl> } <nl> - <nl> - / / EmptyArray : : IterRewind ( ) is NOT reachable ; see ArrayData : : prev ( ) for details <nl> ssize_t EmptyArray : : IterRewind ( const ArrayData * , ssize_t prev ) { <nl> not_reached ( ) ; <nl> } <nl> mmm a / hphp / runtime / base / empty - array . h <nl> ppp b / hphp / runtime / base / empty - array . h <nl> struct EmptyArray { <nl> static constexpr auto AddInt = & SetInt ; <nl> static constexpr auto AddStr = & SetStr ; <nl> static constexpr auto IterBegin = & ArrayCommon : : ReturnInvalidIndex ; <nl> - static constexpr auto IterLast = & ArrayCommon : : ReturnInvalidIndex ; <nl> static constexpr auto IterEnd = & ArrayCommon : : ReturnInvalidIndex ; <nl> static ssize_t IterAdvance ( const ArrayData * , ssize_t prev ) ; <nl> static ssize_t IterRewind ( const ArrayData * , ssize_t prev ) ; <nl> mmm a / hphp / runtime / base / mixed - array - defs . h <nl> ppp b / hphp / runtime / base / mixed - array - defs . h <nl> MixedArray : : Elm & MixedArray : : allocElm ( int32_t * ei ) { <nl> size_t i = m_used ; <nl> ( * ei ) = i ; <nl> m_used = i + 1 ; <nl> + if ( m_pos = = invalid_index ) m_pos = i ; <nl> return data ( ) [ i ] ; <nl> } <nl> <nl> mmm a / hphp / runtime / base / mixed - array . cpp <nl> ppp b / hphp / runtime / base / mixed - array . cpp <nl> ArrayData * MixedArray : : MakeReserveMixed ( uint32_t capacity ) { <nl> auto const ad = smartAllocArray ( cap , mask ) ; <nl> <nl> ad - > m_kindAndSize = kMixedKind < < 24 ; / / zero ' s size <nl> - ad - > m_posAndCount = uint64_t { 1 } < < 32 ; / / zero ' s pos <nl> + ad - > m_posAndCount = uint64_t { 1 } < < 32 | <nl> + static_cast < uint32_t > ( ArrayData : : invalid_index ) ; <nl> ad - > m_capAndUsed = cap ; <nl> ad - > m_tableMask = mask ; <nl> ad - > m_nextKI = 0 ; <nl> ArrayData * MixedArray : : MakeReserveMixed ( uint32_t capacity ) { <nl> <nl> assert ( ad - > m_kind = = kMixedKind ) ; <nl> assert ( ad - > m_size = = 0 ) ; <nl> - assert ( ad - > m_pos = = 0 ) ; <nl> + assert ( ad - > m_pos = = ArrayData : : invalid_index ) ; <nl> assert ( ad - > m_count = = 1 ) ; <nl> assert ( ad - > m_cap = = cap ) ; <nl> assert ( ad - > m_used = = 0 ) ; <nl> ArrayData * MixedArray : : MakeReserveIntMap ( uint32_t capacity ) { <nl> auto const ad = smartAllocArray ( cap , mask ) ; <nl> <nl> ad - > m_kindAndSize = kIntMapKind < < 24 ; / / zero ' s size <nl> - ad - > m_posAndCount = uint64_t { 1 } < < 32 ; / / zero ' s pos <nl> + ad - > m_posAndCount = uint64_t { 1 } < < 32 | <nl> + static_cast < uint32_t > ( ArrayData : : invalid_index ) ; <nl> ad - > m_capAndUsed = cap ; <nl> ad - > m_tableMask = mask ; <nl> ad - > m_nextKI = 0 ; <nl> ArrayData * MixedArray : : MakeReserveIntMap ( uint32_t capacity ) { <nl> <nl> assert ( ad - > m_kind = = kIntMapKind ) ; <nl> assert ( ad - > m_size = = 0 ) ; <nl> - assert ( ad - > m_pos = = 0 ) ; <nl> + assert ( ad - > m_pos = = ArrayData : : invalid_index ) ; <nl> assert ( ad - > m_count = = 1 ) ; <nl> assert ( ad - > m_cap = = cap ) ; <nl> assert ( ad - > m_used = = 0 ) ; <nl> ArrayData * MixedArray : : MakePacked ( uint32_t size , const TypedValue * values ) { <nl> ad = MakePackedHelper ( size , values ) ; <nl> } <nl> <nl> - ad - > m_posAndCount = uint64_t { 1 } < < 32 ; / / zero ' s pos <nl> - <nl> + ad - > m_posAndCount = uint64_t { 1 } < < 32 ; <nl> / / Append values by moving - - Caller assumes we update refcount . <nl> / / Values are in reverse order since they come from the stack , which <nl> / / grows down . <nl> MixedArray : : MakePackedHelper ( uint32_t size , const TypedValue * values ) { <nl> return ad ; <nl> } <nl> <nl> + <nl> MixedArray * MixedArray : : MakeStruct ( uint32_t size , StringData * * keys , <nl> const TypedValue * values ) { <nl> assert ( size > 0 ) ; <nl> MixedArray * MixedArray : : MakeStruct ( uint32_t size , StringData * * keys , <nl> <nl> auto const shiftedSize = uint64_t { size } < < 32 ; <nl> ad - > m_kindAndSize = shiftedSize | kMixedKind < < 24 ; <nl> - ad - > m_posAndCount = uint64_t { 1 } < < 32 ; / / zero ' s pos <nl> + ad - > m_posAndCount = uint64_t { 1 } < < 32 ; <nl> ad - > m_capAndUsed = shiftedSize | cap ; <nl> ad - > m_tableMask = mask ; <nl> ad - > m_nextKI = 0 ; <nl> MixedArray * MixedArray : : CopyMixed ( const MixedArray & other , <nl> auto const otherKind = other . m_kind ; <nl> <nl> ad - > m_kindAndSize = uint64_t { other . m_size } < < 32 | otherKind < < 24 ; <nl> - ad - > m_posAndCount = static_cast < uint32_t > ( other . m_pos ) ; / / zero ' s count <nl> + ad - > m_posAndCount = static_cast < uint32_t > ( other . m_pos ) ; <nl> ad - > m_capAndUsed = uint64_t { other . m_used } < < 32 | cap ; <nl> ad - > m_tableMask = mask ; <nl> ad - > m_nextKI = other . m_nextKI ; <nl> bool MixedArray : : checkInvariants ( ) const { <nl> / / Non - zombie : <nl> assert ( m_size < = m_used ) ; <nl> assert ( m_used < = m_cap ) ; <nl> - if ( m_pos ! = m_used ) { <nl> + if ( m_pos ! = invalid_index ) { <nl> assert ( size_t ( m_pos ) < m_used ) ; <nl> assert ( ! isTombstone ( data ( ) [ m_pos ] . data . m_type ) ) ; <nl> } <nl> bool MixedArray : : checkInvariants ( ) const { <nl> / / Iteration . <nl> <nl> inline ssize_t MixedArray : : prevElm ( Elm * elms , ssize_t ei ) const { <nl> - assert ( ei < ssize_t ( m_used ) ) ; <nl> + assert ( ei < = ssize_t ( m_used ) ) ; <nl> while ( ei > 0 ) { <nl> - - ei ; <nl> if ( ! isTombstone ( elms [ ei ] . data . m_type ) ) { <nl> return ei ; <nl> } <nl> } <nl> - return m_used ; <nl> + return invalid_index ; <nl> } <nl> <nl> ssize_t MixedArray : : IterBegin ( const ArrayData * ad ) { <nl> auto a = asMixed ( ad ) ; <nl> - return a - > nextElm ( a - > data ( ) , - 1 ) ; <nl> - } <nl> - <nl> - ssize_t MixedArray : : IterLast ( const ArrayData * ad ) { <nl> - auto a = asMixed ( ad ) ; <nl> - auto * elms = a - > data ( ) ; <nl> - ssize_t ei = a - > m_used ; <nl> - while ( ei > 0 ) { <nl> - - - ei ; <nl> - if ( ! isTombstone ( elms [ ei ] . data . m_type ) ) { <nl> - return ei ; <nl> - } <nl> - } <nl> - return a - > m_used ; <nl> + return a - > nextElm ( a - > data ( ) , invalid_index ) ; <nl> } <nl> <nl> ssize_t MixedArray : : IterEnd ( const ArrayData * ad ) { <nl> auto a = asMixed ( ad ) ; <nl> - return a - > m_used ; <nl> + return a - > prevElm ( a - > data ( ) , a - > m_used ) ; <nl> } <nl> <nl> ssize_t MixedArray : : IterAdvance ( const ArrayData * ad , ssize_t pos ) { <nl> auto a = asMixed ( ad ) ; <nl> - + + pos ; <nl> - if ( pos > = a - > m_used ) return a - > m_used ; <nl> - if ( ! isTombstone ( a - > data ( ) [ pos ] . data . m_type ) ) { <nl> + / / Since m_used is always less than 2 ^ 32 and invalid_index = = - 1 , <nl> + / / we can save a check by doing an unsigned comparison instead <nl> + / / of a signed comparison . <nl> + if ( size_t ( + + pos ) < a - > m_used & & ! isTombstone ( a - > data ( ) [ pos ] . data . m_type ) ) { <nl> return pos ; <nl> } <nl> return a - > iter_advance_helper ( pos ) ; <nl> + static_assert ( invalid_index = = - 1 , " " ) ; <nl> } <nl> <nl> / / caller has already incremented pos but encountered a tombstone <nl> ssize_t MixedArray : : iter_advance_helper ( ssize_t next_pos ) const { <nl> Elm * elms = data ( ) ; <nl> + / / Since m_used is always less than 2 ^ 32 and invalid_index = = - 1 , <nl> + / / we can save a check by doing an unsigned comparison instead of <nl> + / / a signed comparison . <nl> for ( auto limit = m_used ; size_t ( next_pos ) < limit ; + + next_pos ) { <nl> if ( ! isTombstone ( elms [ next_pos ] . data . m_type ) ) { <nl> return next_pos ; <nl> } <nl> } <nl> - return m_used ; <nl> + return invalid_index ; <nl> } <nl> <nl> ssize_t MixedArray : : IterRewind ( const ArrayData * ad , ssize_t pos ) { <nl> + if ( pos = = invalid_index ) return invalid_index ; <nl> auto a = asMixed ( ad ) ; <nl> return a - > prevElm ( a - > data ( ) , pos ) ; <nl> } <nl> size_t MixedArray : : Vsize ( const ArrayData * ) { not_reached ( ) ; } <nl> const Variant & MixedArray : : GetValueRef ( const ArrayData * ad , ssize_t pos ) { <nl> auto a = asMixed ( ad ) ; <nl> assert ( a - > checkInvariants ( ) ) ; <nl> - assert ( pos ! = a - > m_used ) ; <nl> + assert ( pos ! = invalid_index ) ; <nl> auto & e = a - > data ( ) [ pos ] ; <nl> assert ( ! isTombstone ( e . data . m_type ) ) ; <nl> return tvAsCVarRef ( & e . data ) ; <nl> int32_t * MixedArray : : findForInsertImpl ( size_t h0 , Hit hit ) const { <nl> return ei ; <nl> } <nl> } else if ( pos = = Empty ) { <nl> - return ei ; <nl> + return ei ; <nl> } <nl> probeIndex + = i ; <nl> assert ( i < = tableMask & & probeIndex = = h0 + ( i + i * i ) / 2 ) ; <nl> ssize_t MixedArray : : findForRemove ( int64_t ki , bool updateNext ) { <nl> } , <nl> [ this , ki , updateNext ] ( Elm & e ) { <nl> assert ( ki = = e . ikey ) ; <nl> - / / Conform to PHP5 behavior <nl> + / / Match PHP 5 . 3 . 1 semantics <nl> / / Hacky : don ' t removed the unsigned cast , else g + + can optimize away <nl> / / the check for = = 0x7fff . . . , since there is no signed int k <nl> / / for which k - 1 = = 0x7fff . . . <nl> MixedArray : : Grow ( MixedArray * old , uint32_t newCap , uint32_t newMask ) { <nl> auto const oldUsed = old - > m_used ; <nl> <nl> ad - > m_kindAndSize = uint64_t { oldSize } < < 32 | oldKind < < 24 ; <nl> - ad - > m_posAndCount = oldPosUnsigned ; / / zero ' s count <nl> + ad - > m_posAndCount = oldPosUnsigned ; <nl> ad - > m_capAndUsed = uint64_t { oldUsed } < < 32 | cap ; <nl> ad - > m_tableMask = mask ; <nl> ad - > m_nextKI = old - > m_nextKI ; <nl> struct ElmKey { <nl> void MixedArray : : compact ( bool renumber / * = false * / ) { <nl> assert ( ! isPacked ( ) ) ; <nl> ElmKey mPos ; <nl> + if ( m_pos ! = invalid_index ) { <nl> + / / Cache key for element associated with m_pos in order to update m_pos <nl> + / / below . <nl> + assert ( size_t ( m_pos ) < m_used ) ; <nl> + auto & e = data ( ) [ m_pos ] ; <nl> + mPos . hash = e . hasIntKey ( ) ? 0 : e . hash ( ) ; <nl> + mPos . skey = e . skey ; <nl> + } else { <nl> + / / Silence compiler warnings . <nl> + mPos . hash = 0 ; <nl> + mPos . skey = nullptr ; <nl> + } <nl> <nl> - bool updatePosAfterCompact ; <nl> - bool hasStrongIters ; <nl> TinyVector < ElmKey , 3 > siKeys ; <nl> - <nl> - / / Prep work before beginning the compaction process <nl> - if ( LIKELY ( ! renumber ) ) { <nl> - if ( ( updatePosAfterCompact = ( m_pos ! = 0 & & m_pos ! = m_used ) ) ) { <nl> - / / Cache key for element associated with m_pos in order to <nl> - / / update m_pos after the compaction has been performed . <nl> - / / We only need to do this if m_pos is nonzero and is not <nl> - / / the canonical invalid position . <nl> - assert ( size_t ( m_pos ) < m_used ) ; <nl> - auto & e = data ( ) [ m_pos ] ; <nl> - mPos . hash = e . hasIntKey ( ) ? 0 : e . hash ( ) ; <nl> - mPos . skey = e . skey ; <nl> - } else { <nl> - if ( m_pos = = m_used ) { <nl> - / / If m_pos is the canonical invalid position , we need to update <nl> - / / it to what the new canonical invalid position will be after <nl> - / / compaction <nl> - m_pos = m_size ; <nl> - } <nl> - mPos . hash = 0 ; <nl> - mPos . skey = nullptr ; <nl> - } <nl> - if ( UNLIKELY ( ( hasStrongIters = strong_iterators_exist ( ) ) ) ) { <nl> - for_each_strong_iterator ( [ & ] ( const MIterTable : : Ent & miEnt ) { <nl> - if ( miEnt . array ! = this ) return ; <nl> - if ( miEnt . iter - > getResetFlag ( ) ) return ; <nl> - auto const ei = miEnt . iter - > m_pos ; <nl> - if ( ei = = m_used ) return ; <nl> + auto const checkingStrongIterators = strong_iterators_exist ( ) ; <nl> + if ( UNLIKELY ( checkingStrongIterators ) ) { <nl> + for_each_strong_iterator ( [ & ] ( const MIterTable : : Ent & miEnt ) { <nl> + if ( miEnt . array ! = this ) return ; <nl> + auto const ei = miEnt . iter - > m_pos ; <nl> + if ( ei ! = invalid_index ) { <nl> auto & e = data ( ) [ ei ] ; <nl> siKeys . push_back ( ElmKey ( e . hash ( ) , e . skey ) ) ; <nl> - } ) ; <nl> - } <nl> - } else { <nl> - / / To conform to PHP5 behavior , when array ' s integer keys are renumbered <nl> - / / we invalidate all strong iterators and we reset the array ' s internal <nl> - / / cursor ( even if the array is empty or has no integer keys ) . <nl> - if ( UNLIKELY ( strong_iterators_exist ( ) ) ) { <nl> - free_strong_iterators ( this ) ; <nl> - } <nl> - m_pos = 0 ; <nl> - mPos . hash = 0 ; <nl> - mPos . skey = nullptr ; <nl> - updatePosAfterCompact = false ; <nl> - hasStrongIters = false ; <nl> - / / Set m_nextKI to 0 for now to prepare for renumbering integer keys <nl> - m_nextKI = 0 ; <nl> + } <nl> + } ) ; <nl> } <nl> <nl> - / / Perform compaction <nl> + if ( renumber ) { <nl> + m_nextKI = 0 ; <nl> + } <nl> auto elms = data ( ) ; <nl> auto mask = m_tableMask ; <nl> size_t tableSize = mask + 1 ; <nl> void MixedArray : : compact ( bool renumber / * = false * / ) { <nl> if ( toPos ! = frPos ) { <nl> toE = elms [ frPos ] ; <nl> } <nl> - if ( UNLIKELY ( renumber & & ! toE . hasStrKey ( ) ) ) { <nl> + if ( renumber & & ! toE . hasStrKey ( ) ) { <nl> toE . ikey = m_nextKI + + ; <nl> } <nl> auto ie = findForNewInsert ( table , mask , <nl> toE . hasIntKey ( ) ? toE . ikey : toE . hash ( ) ) ; <nl> * ie = toPos ; <nl> } <nl> - <nl> - if ( updatePosAfterCompact ) { <nl> - / / Update m_pos , now that compaction is complete <nl> - m_pos = mPos . hash ? ssize_t ( find ( mPos . skey , mPos . hash ) ) <nl> - : ssize_t ( find ( mPos . ikey ) ) ; <nl> + m_used = m_size ; <nl> + if ( m_pos ! = invalid_index ) { <nl> + / / Update m_pos , now that compaction is complete . <nl> + if ( mPos . hash ) { <nl> + m_pos = ssize_t ( find ( mPos . skey , mPos . hash ) ) ; <nl> + } else { <nl> + m_pos = ssize_t ( find ( mPos . ikey ) ) ; <nl> + } <nl> } <nl> <nl> - if ( LIKELY ( ! hasStrongIters ) ) { <nl> - / / In the common case there aren ' t any strong iterators , so we <nl> - / / can just update m_used and return <nl> - m_used = m_size ; <nl> - return ; <nl> - } <nl> + / / Update strong iterators , now that compaction is complete . <nl> + if ( LIKELY ( ! checkingStrongIterators ) ) return ; <nl> <nl> - / / Update strong iterators now that compaction is complete . Note <nl> - / / that we wait to update m_used until after we ' ve updated the <nl> - / / strong iterators because we need to consult what the _old_ value <nl> - / / of m_used before compaction was performed . <nl> int key = 0 ; <nl> - for_each_strong_iterator ( <nl> - [ & ] ( MIterTable : : Ent & miEnt ) { <nl> - if ( miEnt . array ! = this ) return ; <nl> - auto const iter = miEnt . iter ; <nl> - if ( iter - > getResetFlag ( ) ) return ; <nl> - if ( iter - > m_pos = = m_used ) { <nl> - / / If this iterator was set to the _old_ canonical invalid position , <nl> - / / we need to update it to the _new_ canonical invalid position after <nl> - / / compaction . <nl> - iter - > m_pos = m_size ; <nl> - return ; <nl> - } <nl> - auto & k = siKeys [ key ] ; <nl> - key + + ; <nl> - iter - > m_pos = k . hash ? ssize_t ( find ( k . skey , k . hash ) ) <nl> - : ssize_t ( find ( k . ikey ) ) ; <nl> + for_each_strong_iterator ( [ & ] ( MIterTable : : Ent & miEnt ) { <nl> + if ( miEnt . array ! = this ) return ; <nl> + auto const iter = miEnt . iter ; <nl> + if ( iter - > m_pos = = invalid_index ) return ; <nl> + auto & k = siKeys [ key ] ; <nl> + key + + ; <nl> + if ( k . hash ) { / / string key <nl> + iter - > m_pos = ssize_t ( find ( k . skey , k . hash ) ) ; <nl> + } else { / / int key <nl> + iter - > m_pos = ssize_t ( find ( k . ikey ) ) ; <nl> } <nl> - ) ; <nl> - / / Finally , update m_used and return <nl> - m_used = m_size ; <nl> + } ) ; <nl> } <nl> <nl> bool MixedArray : : nextInsert ( const Variant & data ) { <nl> MixedArray : : ZAppend ( ArrayData * ad , RefData * v , int64_t * key_ptr ) { <nl> <nl> NEVER_INLINE <nl> void MixedArray : : adjustMArrayIter ( ssize_t pos ) { <nl> - assert ( pos > = 0 & & pos < m_used ) ; <nl> ssize_t eIPrev = Tombstone ; <nl> for_each_strong_iterator ( [ & ] ( MIterTable : : Ent & miEnt ) { <nl> if ( miEnt . array ! = this ) return ; <nl> auto const iter = miEnt . iter ; <nl> - if ( iter - > getResetFlag ( ) ) return ; <nl> if ( iter - > m_pos = = pos ) { <nl> if ( eIPrev = = Tombstone ) { <nl> / / eIPrev will actually be used , so properly initialize it with the <nl> - / / previous element before pos ( or an invalid position if pos was the <nl> - / / first element ) . <nl> + / / previous element before pos , or invalid_index if pos is the first <nl> + / / element . <nl> eIPrev = prevElm ( data ( ) , pos ) ; <nl> } <nl> - <nl> - if ( eIPrev = = m_used ) { <nl> + if ( eIPrev = = Empty ) { <nl> iter - > setResetFlag ( true ) ; <nl> } <nl> iter - > m_pos = eIPrev ; <nl> MixedArray : : NvGetStrImpl < ArrayData : : kIntMapKind > ( const ArrayData * ad , <nl> <nl> void MixedArray : : NvGetKey ( const ArrayData * ad , TypedValue * out , ssize_t pos ) { <nl> auto a = asMixed ( ad ) ; <nl> - assert ( pos ! = a - > m_used ) ; <nl> + assert ( pos ! = ArrayData : : invalid_index ) ; <nl> assert ( ! isTombstone ( a - > data ( ) [ pos ] . data . m_type ) ) ; <nl> getElmKey ( a - > data ( ) [ pos ] , out ) ; <nl> } <nl> MixedArray * MixedArray : : CopyReserve ( const MixedArray * src , <nl> / / the key for element associated with src - > m_pos so that we can <nl> / / properly initialize ad - > m_pos below . <nl> ElmKey mPos ; <nl> - if ( src - > m_pos ! = src - > m_used ) { <nl> + if ( src - > m_pos ! = invalid_index ) { <nl> assert ( size_t ( src - > m_pos ) < src - > m_used ) ; <nl> auto & e = srcElm [ src - > m_pos ] ; <nl> mPos . hash = e . hasIntKey ( ) ? 0 : e . hash ( ) ; <nl> MixedArray * MixedArray : : CopyReserve ( const MixedArray * src , <nl> if ( hasIntKey ) { <nl> dstElm - > setIntKey ( srcElm - > ikey ) ; <nl> } else { <nl> + srcElm - > skey - > incRefCount ( ) ; <nl> dstElm - > setStrKey ( srcElm - > skey , hash ) ; <nl> } <nl> * ad - > findForNewInsert ( table , mask , hash ) = i ; <nl> MixedArray * MixedArray : : CopyReserve ( const MixedArray * src , <nl> } <nl> <nl> / / Now that we have finished copying the elements , update ad - > m_pos <nl> - if ( src - > m_pos ! = src - > m_used ) { <nl> + if ( src - > m_pos ! = invalid_index ) { <nl> ad - > m_pos = mPos . hash <nl> ? ssize_t ( ad - > find ( mPos . skey , mPos . hash ) ) <nl> : ssize_t ( ad - > find ( mPos . ikey ) ) ; <nl> ArrayData * MixedArray : : PopImpl ( ArrayData * ad , Variant & value ) { <nl> MixedArray : : downgradeAndWarn ( a , Reason : : kPop ) ; <nl> } <nl> auto elms = a - > data ( ) ; <nl> - if ( a - > m_size ) { <nl> - ssize_t pos = IterLast ( a ) ; <nl> - assert ( pos > = 0 & & pos < a - > m_used ) ; <nl> + ssize_t pos = IterEnd ( a ) ; <nl> + if ( validPos ( pos ) ) { <nl> auto & e = elms [ pos ] ; <nl> assert ( ! isTombstone ( e . data . m_type ) ) ; <nl> value = tvAsCVarRef ( & e . data ) ; <nl> ArrayData * MixedArray : : PopImpl ( ArrayData * ad , Variant & value ) { <nl> } else { <nl> value = uninit_null ( ) ; <nl> } <nl> - / / To conform to PHP5 behavior , the pop operation resets the array ' s <nl> + / / To conform to PHP behavior , the pop operation resets the array ' s <nl> / / internal iterator . <nl> - a - > m_pos = a - > nextElm ( elms , - 1 ) ; <nl> + a - > m_pos = a - > nextElm ( elms , invalid_index ) ; <nl> return a ; <nl> } <nl> <nl> ArrayData * MixedArray : : DequeueImpl ( ArrayData * adInput , Variant & value ) { <nl> if ( aKind ! = kMixedKind ) { <nl> MixedArray : : downgradeAndWarn ( a , Reason : : kDequeue ) ; <nl> } <nl> + / / To conform to PHP behavior , we invalidate all strong iterators when an <nl> + / / element is removed from the beginning of the array . <nl> + if ( UNLIKELY ( strong_iterators_exist ( ) ) ) { <nl> + free_strong_iterators ( a ) ; <nl> + } <nl> auto elms = a - > data ( ) ; <nl> - if ( a - > m_size ) { <nl> - ssize_t pos = a - > nextElm ( elms , - 1 ) ; <nl> - assert ( pos > = 0 & & pos < a - > m_used ) ; <nl> + ssize_t pos = a - > nextElm ( elms , invalid_index ) ; <nl> + if ( validPos ( pos ) ) { <nl> auto & e = elms [ pos ] ; <nl> - assert ( ! isTombstone ( e . data . m_type ) ) ; <nl> value = tvAsCVarRef ( & e . data ) ; <nl> auto pos2 = e . hasStrKey ( ) ? a - > findForRemove ( e . skey , e . hash ( ) ) : <nl> a - > findForRemove ( e . ikey , false ) ; <nl> assert ( pos2 = = pos ) ; <nl> a - > erase ( pos2 ) ; <nl> + a - > compact ( true ) ; <nl> } else { <nl> value = uninit_null ( ) ; <nl> } <nl> - / / Even if the array is empty , for PHP5 conformity we need call <nl> - / / compact ( ) because it has side - effects that are important <nl> - a - > compact ( true ) ; <nl> + / / To conform to PHP behavior , the dequeue operation resets the array ' s <nl> + / / internal iterator <nl> + a - > m_pos = a - > nextElm ( elms , invalid_index ) ; <nl> return a ; <nl> } <nl> <nl> ArrayData * MixedArray : : Prepend ( ArrayData * adInput , <nl> MixedArray : : downgradeAndWarn ( a , Reason : : kPrepend ) ; <nl> } <nl> <nl> + / / To conform to PHP behavior , we invalidate all strong iterators when an <nl> + / / element is added to the beginning of the array . <nl> + if ( UNLIKELY ( strong_iterators_exist ( ) ) ) { <nl> + free_strong_iterators ( a ) ; <nl> + } <nl> + <nl> auto elms = a - > data ( ) ; <nl> if ( a - > m_used = = 0 | | ! isTombstone ( elms [ 0 ] . data . m_type ) ) { <nl> / / Make sure there is room to insert an element . <nl> ArrayData * MixedArray : : Prepend ( ArrayData * adInput , <nl> <nl> / / Renumber . <nl> a - > compact ( true ) ; <nl> + / / To conform to PHP behavior , the prepend operation resets the array ' s <nl> + / / internal iterator <nl> + a - > m_pos = a - > nextElm ( elms , invalid_index ) ; <nl> return a ; <nl> } <nl> <nl> bool MixedArray : : AdvanceMArrayIterImpl ( ArrayData * ad , MArrayIter & fp ) { <nl> Elm * elms = a - > data ( ) ; <nl> if ( fp . getResetFlag ( ) ) { <nl> fp . setResetFlag ( false ) ; <nl> - fp . m_pos = a - > nextElm ( elms , - 1 ) ; <nl> - } else if ( fp . m_pos = = a - > m_used ) { <nl> + fp . m_pos = invalid_index ; <nl> + } else if ( fp . m_pos = = invalid_index ) { <nl> return false ; <nl> - } else { <nl> - fp . m_pos = a - > nextElm ( elms , fp . m_pos ) ; <nl> } <nl> - if ( fp . m_pos = = a - > m_used ) { <nl> + fp . m_pos = a - > nextElm ( elms , fp . m_pos ) ; <nl> + if ( fp . m_pos = = invalid_index ) { <nl> return false ; <nl> } <nl> - / / To conform to PHP5 behavior , we need to set the internal <nl> + / / To conform to PHP behavior , we need to set the internal <nl> / / cursor to point to the next element . <nl> a - > m_pos = a - > nextElm ( elms , fp . m_pos ) ; <nl> return true ; <nl> mmm a / hphp / runtime / base / mixed - array . h <nl> ppp b / hphp / runtime / base / mixed - array . h <nl> struct MixedArray : private ArrayData { <nl> static const TypedValue * NvGetStr ( const ArrayData * , const StringData * k ) ; <nl> static void NvGetKey ( const ArrayData * , TypedValue * out , ssize_t pos ) ; <nl> static ssize_t IterBegin ( const ArrayData * ) ; <nl> - static ssize_t IterLast ( const ArrayData * ) ; <nl> static ssize_t IterEnd ( const ArrayData * ) ; <nl> static ssize_t IterAdvance ( const ArrayData * , ssize_t pos ) ; <nl> static ssize_t IterRewind ( const ArrayData * , ssize_t pos ) ; <nl> struct MixedArray : private ArrayData { <nl> / / 32 - bit ints than it does for 64 - bit ints . As such , we have deliberately <nl> / / chosen to use ssize_t in some places where ideally we * should * have used <nl> / / int32_t . <nl> - static const int32_t Empty = - 1 ; <nl> + static const int32_t Empty = - 1 ; / / = = ArrayData : : invalid_index <nl> static const int32_t Tombstone = - 2 ; <nl> <nl> / / Use a minimum of an 4 - element hash table . Valid range : [ 2 . . 32 ] <nl> struct MixedArray : private ArrayData { <nl> return ei ; <nl> } <nl> } <nl> - return m_used ; <nl> + return invalid_index ; <nl> } <nl> - <nl> ssize_t prevElm ( Elm * elms , ssize_t ei ) const ; <nl> <nl> / / Assert a bunch of invariants about this array then return true . <nl> mmm a / hphp / runtime / base / object - data . cpp <nl> ppp b / hphp / runtime / base / object - data . cpp <nl> Array ObjectData : : o_toIterArray ( const String & context , <nl> <nl> / / Now get dynamic properties . <nl> if ( dynProps ) { <nl> - auto ad = dynProps - > get ( ) ; <nl> - ssize_t iter = ad - > iter_begin ( ) ; <nl> - auto pos_limit = ad - > iter_end ( ) ; <nl> - while ( iter ! = pos_limit ) { <nl> + ssize_t iter = dynProps - > get ( ) - > iter_begin ( ) ; <nl> + while ( iter ! = ArrayData : : invalid_index ) { <nl> TypedValue key ; <nl> dynProps - > get ( ) - > nvGetKey ( & key , iter ) ; <nl> iter = dynProps - > get ( ) - > iter_advance ( iter ) ; <nl> void ObjectData : : DeleteObject ( ObjectData * objectData ) { <nl> Object ObjectData : : FromArray ( ArrayData * properties ) { <nl> ObjectData * retval = ObjectData : : newInstance ( SystemLib : : s_stdclassClass ) ; <nl> auto & dynArr = retval - > reserveProperties ( properties - > size ( ) ) ; <nl> - auto pos_limit = properties - > iter_end ( ) ; <nl> - for ( ssize_t pos = properties - > iter_begin ( ) ; <nl> - pos ! = pos_limit ; <nl> + for ( ssize_t pos = properties - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = properties - > iter_advance ( pos ) ) { <nl> auto const value = properties - > getValueRef ( pos ) ; <nl> TypedValue key ; <nl> void ObjectData : : cloneSet ( ObjectData * clone ) { <nl> auto & dynProps = dynPropArray ( ) ; <nl> auto & cloneProps = clone - > reserveProperties ( dynProps . size ( ) ) ; <nl> <nl> - auto const props = dynProps . get ( ) ; <nl> - ssize_t iter = props - > iter_begin ( ) ; <nl> - auto pos_limit = props - > iter_end ( ) ; <nl> - while ( iter ! = pos_limit ) { <nl> + ssize_t iter = dynProps . get ( ) - > iter_begin ( ) ; <nl> + while ( iter ! = ArrayData : : invalid_index ) { <nl> + auto const props = dynProps . get ( ) ; <nl> assert ( MixedArray : : asMixed ( props ) ) ; <nl> <nl> TypedValue key ; <nl> void ObjectData : : cloneSet ( ObjectData * clone ) { <nl> } <nl> <nl> tvDupFlattenVars ( val , ret , cloneProps . get ( ) ) ; <nl> - iter = MixedArray : : IterAdvance ( props , iter ) ; <nl> + iter = MixedArray : : IterAdvance ( dynProps . get ( ) , iter ) ; <nl> } <nl> } <nl> } <nl> mmm a / hphp / runtime / base / packed - array . cpp <nl> ppp b / hphp / runtime / base / packed - array . cpp <nl> namespace HPHP { <nl> bool PackedArray : : checkInvariants ( const ArrayData * arr ) { <nl> assert ( arr - > isPacked ( ) ) ; <nl> assert ( arr - > m_size < = packedCodeToCap ( arr - > m_packedCapCode ) ) ; <nl> - assert ( arr - > m_pos > = 0 & & arr - > m_pos < = arr - > m_size ) ; <nl> static_assert ( ArrayData : : kPackedKind = = 0 , " " ) ; <nl> / / Note that m_pos < m_size is not an invariant , because an array <nl> / / that grows will only adjust m_size to zero on the old array . <nl> MixedArray * PackedArray : : ToMixed ( ArrayData * old ) { <nl> } <nl> <nl> old - > m_size = 0 ; <nl> - if ( debug ) { <nl> - / / For debug builds , set m_pos to 0 as well to make the <nl> - / / asserts in checkInvariants ( ) happy . <nl> - old - > m_pos = 0 ; <nl> - } <nl> <nl> assert ( ad - > checkInvariants ( ) ) ; <nl> assert ( ! ad - > isFull ( ) ) ; <nl> ArrayData * PackedArray : : Grow ( ArrayData * old ) { <nl> / / smaller than subtracting sizeof ( ArrayData ) from rax to return . <nl> auto const oldSize = old - > m_size ; <nl> old - > m_size = 0 ; <nl> - if ( debug ) { <nl> - / / For debug builds , set m_pos to 0 as well to make the <nl> - / / asserts in checkInvariants ( ) happy . <nl> - old - > m_pos = 0 ; <nl> - } <nl> std : : memcpy ( packedData ( ad ) , packedData ( old ) , oldSize * sizeof ( TypedValue ) ) ; <nl> <nl> / / TODO ( # 2926276 ) : it would be good to refactor callers to expect <nl> ArrayData * PackedArray : : NonSmartConvert ( const ArrayData * arr ) { <nl> <nl> ad - > m_posAndCount = static_cast < uint32_t > ( arr - > m_pos ) ; <nl> auto data = reinterpret_cast < TypedValue * > ( ad + 1 ) ; <nl> - auto pos_limit = arr - > iter_end ( ) ; <nl> - for ( auto pos = arr - > iter_begin ( ) ; pos ! = pos_limit ; <nl> - pos = arr - > iter_advance ( pos ) , + + data ) { <nl> + for ( auto pos = arr - > iter_begin ( ) ; <nl> + pos ! = ArrayData : : invalid_index ; <nl> + pos = arr - > iter_advance ( pos ) , + + data ) { <nl> tvDupFlattenVars ( arr - > getValueRef ( pos ) . asTypedValue ( ) , data , arr ) ; <nl> } <nl> <nl> ArrayData * MixedArray : : MakeReserve ( uint32_t capacity ) { <nl> ad = MakeReserveSlow ( capacity ) ; <nl> } <nl> <nl> - ad - > m_posAndCount = uint64_t { 1 } < < 32 ; / / zero ' s pos <nl> + ad - > m_posAndCount = uint64_t { 1 } < < 32 | <nl> + static_cast < uint32_t > ( ArrayData : : invalid_index ) ; <nl> <nl> assert ( ad - > m_count = = 1 ) ; <nl> - assert ( ad - > m_pos = = 0 ) ; <nl> + assert ( ad - > m_pos = = ArrayData : : invalid_index ) ; <nl> assert ( PackedArray : : checkInvariants ( ad ) ) ; <nl> return ad ; <nl> } <nl> const TypedValue * PackedArray : : NvGetInt ( const ArrayData * ad , int64_t ki ) { <nl> <nl> void PackedArray : : NvGetKey ( const ArrayData * ad , TypedValue * out , ssize_t pos ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> - assert ( pos ! = ad - > m_size ) ; <nl> + assert ( pos ! = ArrayData : : invalid_index ) ; <nl> out - > m_data . num = pos ; <nl> out - > m_type = KindOfInt64 ; <nl> } <nl> size_t PackedArray : : Vsize ( const ArrayData * ) { not_reached ( ) ; } <nl> <nl> const Variant & PackedArray : : GetValueRef ( const ArrayData * ad , ssize_t pos ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> - assert ( pos ! = ad - > m_size ) ; <nl> + assert ( pos ! = ArrayData : : invalid_index ) ; <nl> return tvAsCVarRef ( & packedData ( ad ) [ pos ] ) ; <nl> } <nl> <nl> ArrayData * PackedArray : : LvalNew ( ArrayData * adIn , Variant * & ret , bool copy ) { <nl> auto const mixed = copy ? ToMixedCopy ( adIn ) : ToMixed ( ad ) ; <nl> return MixedArray : : LvalNew ( mixed , ret , copy ) ; <nl> } <nl> + <nl> + if ( ad - > m_pos = = ArrayData : : invalid_index ) { <nl> + ad - > m_pos = ad - > m_size ; <nl> + } <nl> auto & tv = packedData ( ad ) [ ad - > m_size + + ] ; <nl> tv . m_type = KindOfNull ; <nl> ret = & tvAsVariant ( & tv ) ; <nl> PackedArray : : RemoveStr ( ArrayData * adIn , const StringData * , bool ) { <nl> <nl> ssize_t PackedArray : : IterBegin ( const ArrayData * ad ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - ssize_t PackedArray : : IterLast ( const ArrayData * ad ) { <nl> - assert ( checkInvariants ( ad ) ) ; <nl> - return ad - > m_size ? ad - > m_size - 1 : 0 ; <nl> + return ad - > m_size ? 0 : ArrayData : : invalid_index ; <nl> } <nl> <nl> ssize_t PackedArray : : IterEnd ( const ArrayData * ad ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> - return ad - > m_size ; <nl> + static_assert ( ArrayData : : invalid_index = = - 1 , " " ) ; <nl> + return static_cast < ssize_t > ( ad - > m_size ) - 1 ; <nl> } <nl> <nl> ssize_t PackedArray : : IterAdvance ( const ArrayData * ad , ssize_t pos ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> - if ( pos < ad - > m_size ) { <nl> - + + pos ; <nl> + if ( size_t ( + + pos ) < ad - > m_size ) { <nl> + return pos ; <nl> } <nl> - return pos ; <nl> + return ArrayData : : invalid_index ; <nl> } <nl> <nl> ssize_t PackedArray : : IterRewind ( const ArrayData * ad , ssize_t pos ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> - if ( pos > 0 ) { <nl> - return pos - 1 ; <nl> - } <nl> - return ad - > m_size ; <nl> + if ( pos = = ArrayData : : invalid_index ) return ArrayData : : invalid_index ; <nl> + return pos - 1 ; <nl> } <nl> <nl> bool PackedArray : : AdvanceMArrayIter ( ArrayData * ad , MArrayIter & fp ) { <nl> assert ( checkInvariants ( ad ) ) ; <nl> if ( fp . getResetFlag ( ) ) { <nl> fp . setResetFlag ( false ) ; <nl> - fp . m_pos = 0 ; <nl> - } else if ( fp . m_pos = = ad - > m_size ) { <nl> + fp . m_pos = ArrayData : : invalid_index ; <nl> + } else if ( fp . m_pos = = ArrayData : : invalid_index ) { <nl> return false ; <nl> - } else { <nl> - fp . m_pos = IterAdvance ( ad , fp . m_pos ) ; <nl> } <nl> - if ( fp . m_pos = = ad - > m_size ) { <nl> + fp . m_pos = IterAdvance ( ad , fp . m_pos ) ; <nl> + if ( fp . m_pos = = ArrayData : : invalid_index ) { <nl> return false ; <nl> } <nl> - / / We set ad ' s internal cursor to point to the next element <nl> - / / to conform with PHP5 behavior <nl> + / / To conform to PHP behavior , we need to set the internal <nl> + / / cursor to point to the next element . <nl> ad - > m_pos = IterAdvance ( ad , fp . m_pos ) ; <nl> return true ; <nl> } <nl> ArrayData * PackedArray : : Append ( ArrayData * adIn , const Variant & v , bool copy ) { <nl> return MixedArray : : Append ( mixed , v , copy ) ; <nl> } <nl> <nl> + if ( ad - > m_pos = = ArrayData : : invalid_index ) { <nl> + ad - > m_pos = ad - > m_size ; <nl> + } <nl> auto & dst = packedData ( ad ) [ ad - > m_size + + ] ; <nl> cellDup ( * v . asCell ( ) , dst ) ; <nl> / / TODO ( # 3888164 ) : restructure this so we don ' t need KindOfUninit checks . <nl> ArrayData * PackedArray : : AppendRef ( ArrayData * adIn , <nl> return MixedArray : : AppendRef ( mixed , v , copy ) ; <nl> } <nl> <nl> + if ( ad - > m_pos = = ArrayData : : invalid_index ) { <nl> + ad - > m_pos = ad - > m_size ; <nl> + } <nl> auto & dst = packedData ( ad ) [ ad - > m_size + + ] ; <nl> dst . m_data . pref = v . asRef ( ) - > m_data . pref ; <nl> dst . m_type = KindOfRef ; <nl> ArrayData * PackedArray : : AppendWithRef ( ArrayData * adIn , <nl> return MixedArray : : AppendRef ( mixed , const_cast < Variant & > ( v ) , copy ) ; <nl> } <nl> <nl> + if ( ad - > m_pos = = ArrayData : : invalid_index ) { <nl> + ad - > m_pos = ad - > m_size ; <nl> + } <nl> auto & dst = packedData ( ad ) [ ad - > m_size + + ] ; <nl> dst . m_type = KindOfNull ; <nl> tvAsVariant ( & dst ) . setWithRef ( v ) ; <nl> ArrayData * PackedArray : : Merge ( ArrayData * adIn , const ArrayData * elems ) { <nl> } <nl> <nl> static void adjustMArrayIter ( ArrayData * ad , ssize_t pos ) { <nl> - assert ( ad - > isPacked ( ) ) ; <nl> for_each_strong_iterator ( [ & ] ( MIterTable : : Ent & miEnt ) { <nl> if ( miEnt . array ! = ad ) return ; <nl> auto const iter = miEnt . iter ; <nl> - if ( iter - > getResetFlag ( ) ) return ; <nl> if ( iter - > m_pos = = pos ) { <nl> - if ( pos < = 0 ) { <nl> - iter - > m_pos = ad - > getSize ( ) ; <nl> + if ( pos - 1 < 0 ) { <nl> + iter - > m_pos = ArrayData : : invalid_index ; <nl> iter - > setResetFlag ( true ) ; <nl> } else { <nl> iter - > m_pos = pos - 1 ; <nl> ArrayData * PackedArray : : Pop ( ArrayData * adIn , Variant & value ) { <nl> auto const ad = adIn - > hasMultipleRefs ( ) ? Copy ( adIn ) : adIn ; <nl> <nl> if ( UNLIKELY ( ad - > m_size = = 0 ) ) { <nl> - assert ( ad - > m_pos = = 0 ) ; <nl> value = uninit_null ( ) ; <nl> + ad - > m_pos = ArrayData : : invalid_index ; <nl> return ad ; <nl> } <nl> <nl> ArrayData * PackedArray : : Pop ( ArrayData * adIn , Variant & value ) { <nl> auto const oldType = tv . m_type ; <nl> auto const oldDatum = tv . m_data . num ; <nl> ad - > m_size = oldSize - 1 ; <nl> - ad - > m_pos = 0 ; <nl> + ad - > m_pos = oldSize - 1 > 0 ? 0 : ArrayData : : invalid_index ; <nl> tvRefcountedDecRefHelper ( oldType , oldDatum ) ; <nl> return ad ; <nl> } <nl> ArrayData * PackedArray : : Dequeue ( ArrayData * adIn , Variant & value ) { <nl> <nl> if ( UNLIKELY ( ad - > m_size = = 0 ) ) { <nl> value = uninit_null ( ) ; <nl> + ad - > m_pos = ArrayData : : invalid_index ; <nl> return ad ; <nl> } <nl> <nl> ArrayData * PackedArray : : Dequeue ( ArrayData * adIn , Variant & value ) { <nl> value = std : : move ( tvAsVariant ( data ) ) ; / / no incref + decref <nl> std : : memmove ( data , data + 1 , n * sizeof * data ) ; <nl> ad - > m_size = n ; <nl> - ad - > m_pos = 0 ; <nl> + ad - > m_pos = n > 0 ? 0 : ArrayData : : invalid_index ; <nl> return ad ; <nl> } <nl> <nl> mmm a / hphp / runtime / base / packed - array . h <nl> ppp b / hphp / runtime / base / packed - array . h <nl> struct PackedArray { <nl> static ArrayData * RemoveInt ( ArrayData * , int64_t k , bool copy ) ; <nl> static ArrayData * RemoveStr ( ArrayData * , const StringData * k , bool copy ) ; <nl> static ssize_t IterBegin ( const ArrayData * ) ; <nl> - static ssize_t IterLast ( const ArrayData * ) ; <nl> static ssize_t IterEnd ( const ArrayData * ) ; <nl> static ssize_t IterAdvance ( const ArrayData * , ssize_t pos ) ; <nl> static ssize_t IterRewind ( const ArrayData * , ssize_t pos ) ; <nl> mmm a / hphp / runtime / base / proxy - array . cpp <nl> ppp b / hphp / runtime / base / proxy - array . cpp <nl> ProxyArray * ProxyArray : : Make ( ArrayData * ad ) { <nl> auto ret = static_cast < ProxyArray * > ( MM ( ) . objMallocLogged ( sizeof ( ProxyArray ) ) ) ; <nl> ret - > m_size = - 1 ; <nl> ret - > m_kind = kProxyKind ; <nl> - ret - > m_pos = 0 ; <nl> + ret - > m_pos = ArrayData : : invalid_index ; <nl> ret - > m_count = 1 ; <nl> ret - > m_destructor = ZvalPtrDtor ; <nl> ret - > m_ref = RefData : : Make ( make_tv < KindOfArray > ( ad ) ) ; <nl> ssize_t ProxyArray : : IterBegin ( const ArrayData * ad ) { <nl> return innerArr ( ad ) - > iter_begin ( ) ; <nl> } <nl> <nl> - ssize_t ProxyArray : : IterLast ( const ArrayData * ad ) { <nl> - return innerArr ( ad ) - > iter_last ( ) ; <nl> - } <nl> - <nl> ssize_t ProxyArray : : IterEnd ( const ArrayData * ad ) { <nl> return innerArr ( ad ) - > iter_end ( ) ; <nl> } <nl> mmm a / hphp / runtime / base / proxy - array . h <nl> ppp b / hphp / runtime / base / proxy - array . h <nl> struct ProxyArray : public ArrayData { <nl> static ArrayData * Escalate ( const ArrayData * ad ) ; <nl> <nl> static ssize_t IterBegin ( const ArrayData * ) ; <nl> - static ssize_t IterLast ( const ArrayData * ) ; <nl> static ssize_t IterEnd ( const ArrayData * ) ; <nl> static ssize_t IterAdvance ( const ArrayData * , ssize_t prev ) ; <nl> static ssize_t IterRewind ( const ArrayData * , ssize_t prev ) ; <nl> mmm a / hphp / runtime / base / type - array . cpp <nl> ppp b / hphp / runtime / base / type - array . cpp <nl> void Array : : SortImpl ( std : : vector < int > & indices , const Array & source , <nl> opaque . cmp_func = cmp_func ; <nl> opaque . data = data ; <nl> opaque . positions . reserve ( count ) ; <nl> - auto pos_limit = source - > iter_end ( ) ; <nl> - for ( ssize_t pos = source - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = source - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = source - > iter_advance ( pos ) ) { <nl> opaque . positions . push_back ( pos ) ; <nl> } <nl> bool Array : : MultiSort ( std : : vector < SortData > & data , bool renumber ) { <nl> opaque . positions . reserve ( size ) ; <nl> const Array & arr = * opaque . array ; <nl> if ( ! arr . empty ( ) ) { <nl> - auto pos_limit = arr - > iter_end ( ) ; <nl> - for ( ssize_t pos = arr - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = arr - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = arr - > iter_advance ( pos ) ) { <nl> opaque . positions . push_back ( pos ) ; <nl> } <nl> mmm a / hphp / runtime / ext / asio / gen_array_wait_handle . cpp <nl> ppp b / hphp / runtime / ext / asio / gen_array_wait_handle . cpp <nl> void c_GenArrayWaitHandle : : enterContextImpl ( context_idx_t ctx_idx ) { <nl> <nl> / / recursively import current child <nl> { <nl> - assert ( m_iterPos ! = m_deps - > iter_end ( ) ) ; <nl> + assert ( m_iterPos ! = ArrayData : : invalid_index ) ; <nl> auto const current = tvAssertCell ( <nl> m_deps - > getValueRef ( m_iterPos ) . asTypedValue ( ) ) ; <nl> <nl> void c_GenArrayWaitHandle : : enterContextImpl ( context_idx_t ctx_idx ) { <nl> <nl> / / try to import other children <nl> try { <nl> - auto iter_limit = m_deps - > iter_end ( ) ; <nl> - for ( size_t iter_pos = m_deps - > iter_advance ( m_iterPos ) ; <nl> - iter_pos ! = iter_limit ; <nl> + for ( ssize_t iter_pos = m_deps - > iter_advance ( m_iterPos ) ; <nl> + iter_pos ! = ArrayData : : invalid_index ; <nl> iter_pos = m_deps - > iter_advance ( iter_pos ) ) { <nl> <nl> auto const current = tvAssertCell ( <nl> mmm a / hphp / runtime / ext / ext_array . cpp <nl> ppp b / hphp / runtime / ext / ext_array . cpp <nl> Variant f_array_unshift ( int _argc , VRefParam array , const Variant & var , const Ar <nl> if ( cell_array - > m_type = = KindOfArray ) { <nl> if ( array . toArray ( ) - > isVectorData ( ) ) { <nl> if ( ! _argv . empty ( ) ) { <nl> - auto pos_limit = _argv - > iter_end ( ) ; <nl> - for ( ssize_t pos = _argv - > iter_last ( ) ; pos ! = pos_limit ; <nl> - pos = _argv - > iter_rewind ( pos ) ) { <nl> + for ( ssize_t pos = _argv - > iter_end ( ) ; pos ! = ArrayData : : invalid_index ; <nl> + pos = _argv - > iter_rewind ( pos ) ) { <nl> array . wrapped ( ) . toArrRef ( ) . prepend ( _argv - > getValueRef ( pos ) ) ; <nl> } <nl> } <nl> Variant f_array_unshift ( int _argc , VRefParam array , const Variant & var , const Ar <nl> Array newArray ; <nl> newArray . append ( var ) ; <nl> if ( ! _argv . empty ( ) ) { <nl> - auto pos_limit = _argv - > iter_end ( ) ; <nl> - for ( ssize_t pos = _argv - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = _argv - > iter_begin ( ) ; <nl> + pos ! = ArrayData : : invalid_index ; <nl> pos = _argv - > iter_advance ( pos ) ) { <nl> newArray . append ( _argv - > getValueRef ( pos ) ) ; <nl> } <nl> Variant f_array_unshift ( int _argc , VRefParam array , const Variant & var , const Ar <nl> case Collection : : VectorType : { <nl> auto * vec = static_cast < c_Vector * > ( obj ) ; <nl> if ( ! _argv . empty ( ) ) { <nl> - auto pos_limit = _argv - > iter_end ( ) ; <nl> - for ( ssize_t pos = _argv - > iter_last ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = _argv - > iter_end ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = _argv - > iter_rewind ( pos ) ) { <nl> vec - > addFront ( _argv - > getValueRef ( pos ) . asCell ( ) ) ; <nl> } <nl> Variant f_array_unshift ( int _argc , VRefParam array , const Variant & var , const Ar <nl> case Collection : : SetType : { <nl> auto * st = static_cast < c_Set * > ( obj ) ; <nl> if ( ! _argv . empty ( ) ) { <nl> - auto pos_limit = _argv - > iter_end ( ) ; <nl> - for ( ssize_t pos = _argv - > iter_last ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = _argv - > iter_end ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = _argv - > iter_rewind ( pos ) ) { <nl> st - > addFront ( _argv - > getValueRef ( pos ) . asCell ( ) ) ; <nl> } <nl> mmm a / hphp / runtime / ext / ext_collections . cpp <nl> ppp b / hphp / runtime / ext / ext_collections . cpp <nl> Array BaseVector : : toArrayImpl ( ) const { <nl> if ( ! m_size ) { <nl> return empty_array ( ) ; <nl> } <nl> - return Array ( const_cast < ArrayData * > ( arrayData ( ) ) ) ; <nl> + auto ad = const_cast < ArrayData * > ( arrayData ( ) ) ; <nl> + / / When Vector : : toArray ( ) returns a non - empty array , we want the returned <nl> + / / array to have its internal cursor pointing at the first element , so we <nl> + / / set m_pos accordingly here . It ' s safe to write to m_pos even if ad ' s <nl> + / / refcount is greater than 1 because we know one of the following is true : <nl> + / / either ( 1 ) this array has never been exposed outside of the Vector <nl> + / / implementation , in which case we know it ' s not referenced outside by <nl> + / / anything outside the Vector implementation , or ( 2 ) this array has been <nl> + / / exposed by the Vector implementation , in which case m_pos already points <nl> + / / to the first element ( and COW semantics ensures that m_pos couldn ' t have <nl> + / / been changed by user code ) . <nl> + assert ( m_size ) ; <nl> + if ( ad - > m_pos ! = 0 ) { <nl> + ad - > m_pos = 0 ; <nl> + } <nl> + return Array ( ad ) ; <nl> } <nl> <nl> NEVER_INLINE <nl> void BaseVector : : addFront ( const TypedValue * val ) { <nl> Variant BaseVector : : popFront ( ) { <nl> if ( m_size ) { <nl> mutateAndBump ( ) ; <nl> + / / We ' re removing an element , so we make sure m_pos is not pointing at <nl> + / / garbage by setting it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> Variant ret ( tvAsCVarRef ( & m_data [ 0 ] ) , Variant : : CellCopy ( ) ) ; <nl> decSize ( ) ; <nl> memmove ( m_data , m_data + 1 , m_size * sizeof ( TypedValue ) ) ; <nl> void BaseVector : : reserveImpl ( uint32_t newCap ) { <nl> assert ( oldAd ! = staticEmptyArray ( ) ) ; <nl> assert ( oldAd - > isPacked ( ) ) ; <nl> oldAd - > m_size = 0 ; <nl> + oldAd - > m_pos = ArrayData : : invalid_index ; <nl> decRefArr ( oldAd ) ; <nl> } else { <nl> auto * dst = m_data ; <nl> Object c_Vector : : t_append ( const Variant & val ) { <nl> Variant c_Vector : : t_pop ( ) { <nl> if ( m_size ) { <nl> mutateAndBump ( ) ; <nl> + / / We ' re removing an element , so we make sure m_pos is not pointing at <nl> + / / garbage by setting it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> decSize ( ) ; <nl> return Variant ( tvAsCVarRef ( & m_data [ m_size ] ) , Variant : : CellCopy ( ) ) ; <nl> } else { <nl> void c_Vector : : t_resize ( const Variant & sz , const Variant & value ) { <nl> + + m_version ; <nl> uint32_t requestedSize = ( uint32_t ) intSz ; <nl> if ( m_size > requestedSize ) { <nl> + / / We ' re removing elements , so we make sure m_pos is not pointing at <nl> + / / garbage by setting it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> do { <nl> decSize ( ) ; <nl> tvRefcountedDecRef ( & m_data [ m_size ] ) ; <nl> Object c_Vector : : t_removekey ( const Variant & key ) { <nl> return this ; <nl> } <nl> mutateAndBump ( ) ; <nl> + / / We ' re removing an element , so we make sure m_pos is not pointing at <nl> + / / garbage by setting it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> uint64_t datum = m_data [ k ] . m_data . num ; <nl> DataType t = m_data [ k ] . m_type ; <nl> if ( k + 1 < m_size ) { <nl> void c_Vector : : t_splice ( const Variant & offset , const Variant & len / * = null * / , <nl> endPos = sz ; <nl> } <nl> mutateAndBump ( ) ; <nl> + / / We ' re removing elements , so we make sure m_pos is not pointing at <nl> + / / garbage by setting it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> / / Null out each element before decreffing it . We need to do this in case <nl> / / a __destruct method reenters and accesses this Vector object . <nl> for ( int64_t i = startPos ; i < endPos ; + + i ) { <nl> Object c_Vector : : ti_fromarray ( const Variant & arr ) { <nl> auto * data = target - > m_data ; <nl> ssize_t pos = ad - > iter_begin ( ) ; <nl> for ( uint32_t i = 0 ; i < sz ; + + i , pos = ad - > iter_advance ( pos ) ) { <nl> - assert ( pos ! = ad - > iter_end ( ) ) ; <nl> + assert ( pos ! = ArrayData : : invalid_index ) ; <nl> cellDup ( * ( ad - > getValueRef ( pos ) . asCell ( ) ) , data [ i ] ) ; <nl> } <nl> return ret ; <nl> Variant c_VectorIterator : : t_key ( ) { <nl> } <nl> <nl> bool c_VectorIterator : : t_valid ( ) { <nl> + assert ( m_pos > = 0 ) ; <nl> BaseVector * vec = m_obj . get ( ) ; <nl> return vec & & ( m_pos < ( ssize_t ) vec - > m_size ) ; <nl> } <nl> struct HashCollection : : EmptyMixedInitializer { <nl> auto const ad = static_cast < MixedArray * > ( vpEmpty ) ; <nl> ad - > m_kind = ArrayData : : kEmptyKind ; <nl> ad - > m_size = 0 ; <nl> - ad - > m_pos = 0 ; <nl> + ad - > m_pos = ArrayData : : invalid_index ; <nl> ad - > m_count = 0 ; <nl> ad - > m_used = 0 ; <nl> ad - > m_cap = 0 ; <nl> Array HashCollection : : toArrayImpl ( ) const { <nl> auto ad = const_cast < ArrayData * > ( <nl> reinterpret_cast < const ArrayData * > ( arrayData ( ) ) <nl> ) ; <nl> + / / When HashCollection : toArray ( ) returns a non - empty array , we want the <nl> + / / returned array to have its internal cursor pointing at the first element , <nl> + / / so we set m_pos accordingly here . It ' s safe to write to m_pos even if <nl> + / / ad ' s refcount is greater than 1 because we know one of the following is <nl> + / / true : either ( 1 ) this array has never been exposed outside of the <nl> + / / HashCollection implementation , in which case we know it ' s not referenced <nl> + / / outside by anything outside the AssoCollection implementation , or ( 2 ) this <nl> + / / array has been exposed by the AssoCollection implementation , in which case <nl> + / / m_pos was already set to point to the first element ( and COW semantics <nl> + / / ensures that m_pos couldn ' t have been changed by user code ) . <nl> assert ( m_size ) ; <nl> - assert ( ad - > m_pos = = nthElmPos ( 0 ) ) ; <nl> + auto firstPos = nthElmPos ( 0 ) ; <nl> + if ( ad - > m_pos ! = firstPos ) { <nl> + ad - > m_pos = firstPos ; <nl> + } <nl> return Array ( ad ) ; <nl> } <nl> <nl> void HashCollection : : eraseNoCompact ( ssize_t pos ) { <nl> assert ( canMutateBuffer ( ) ) ; <nl> assert ( validPos ( pos ) & & ! isTombstone ( pos ) ) ; <nl> assert ( m_size > 0 ) ; <nl> - arrayData ( ) - > eraseNoCompact ( pos ) ; <nl> + / / We ' re removing an element , so we make sure m_pos is not pointing at <nl> + / / garbage by setting it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> + ( ( MixedArray * ) arrayData ( ) ) - > eraseNoCompact ( pos ) ; <nl> - - m_size ; <nl> } <nl> <nl> void HashCollection : : resizeHelper ( uint32_t newCap ) { <nl> / / all the elements ( without copying over tombstones ) . <nl> auto * ad = ( arrayData ( ) = = staticEmptyMixedArray ( ) ) ? <nl> reinterpret_cast < MixedArray * > ( MixedArray : : MakeReserveMixed ( newCap ) ) : <nl> - MixedArray : : CopyReserve ( arrayData ( ) , newCap ) ; <nl> + MixedArray : : CopyReserve ( ( MixedArray * ) arrayData ( ) , newCap ) ; <nl> decRefArr ( arrayData ( ) ) ; <nl> m_data = mixedData ( ad ) ; <nl> assert ( canMutateBuffer ( ) ) ; <nl> void HashCollection : : grow ( uint32_t newCap , uint32_t newMask ) { <nl> if ( m_size > 0 & & ! oldAd - > hasMultipleRefs ( ) ) { <nl> / / MixedArray : : Grow can only handle non - empty cases where the <nl> / / buffer ' s refcount is 1 . <nl> - m_data = mixedData ( MixedArray : : Grow ( oldAd , newCap , newMask ) ) ; <nl> + m_data = mixedData ( MixedArray : : Grow ( ( MixedArray * ) oldAd , newCap , newMask ) ) ; <nl> arrayData ( ) - > incRefCount ( ) ; <nl> decRefArr ( oldAd ) ; <nl> } else { <nl> void HashCollection : : compact ( ) { <nl> if ( ! arrayData ( ) - > hasMultipleRefs ( ) ) { <nl> / / MixedArray : : compact can only handle cases where the buffer ' s <nl> / / refcount is 1 . <nl> - arrayData ( ) - > compact ( false ) ; <nl> + ( ( MixedArray * ) arrayData ( ) ) - > compact ( false ) ; <nl> } else { <nl> / / For cases where the buffer ' s refcount is greater than 1 , call <nl> / / resizeHelper ( ) . <nl> void HashCollection : : shrink ( uint32_t oldCap / * = 0 * / ) { <nl> copyElm ( oldBuf [ frPos ] , data [ toPos ] ) ; <nl> * findForNewInsert ( table , tableMask ( ) , data [ toPos ] . probe ( ) ) = toPos ; <nl> } <nl> - oldAd - > setZombie ( ) ; <nl> + ( ( MixedArray * ) oldAd ) - > setZombie ( ) ; <nl> decRefArr ( oldAd ) ; <nl> } else { <nl> / / For cases where the buffer ' s refcount is greater than 1 , call <nl> HashCollection : : Elm & HashCollection : : allocElmFront ( int32_t * ei ) { <nl> / / Move the existing elements to make element slot 0 available . <nl> memmove ( data ( ) + 1 , data ( ) , posLimit ( ) * sizeof ( Elm ) ) ; <nl> incPosLimit ( ) ; <nl> - / / Update the hashtable to reflect the fact that everything was <nl> - / / moved over one position <nl> + / / Update the hashtable to reflect the fact that everything was moved <nl> + / / over one position <nl> auto * hash = hashTab ( ) ; <nl> auto * hashEnd = hash + hashSize ( ) ; <nl> for ( ; hash ! = hashEnd ; + + hash ) { <nl> HashCollection : : Elm & HashCollection : : allocElmFront ( int32_t * ei ) { <nl> } <nl> / / Set the hash entry we found to point to element slot 0 . <nl> ( * ei ) = 0 ; <nl> - / / Adjust m_pos so that is points at this new first element . <nl> - arrayData ( ) - > m_pos = 0 ; <nl> - / / Adjust size to reflect that we ' re adding a new element . <nl> - incSize ( ) ; <nl> / / Store the value into element slot 0 . <nl> + + + m_size ; <nl> return data ( ) [ 0 ] ; <nl> } <nl> <nl> BaseMap : : php_map ( const Variant & callback , MakeArgs makeArgs ) const { <nl> " Parameter must be a valid callback " ) ) ; <nl> throw e ; <nl> } <nl> - TMap * mp = NEWOBJ ( TMap ) ( ) ; <nl> + auto * mp = NEWOBJ ( TMap ) ( ) ; <nl> Object obj = mp ; <nl> if ( ! m_size ) return obj ; <nl> assert ( posLimit ( ) ! = 0 ) ; <nl> BaseMap : : php_map ( const Variant & callback , MakeArgs makeArgs ) const { <nl> ) ; <nl> mp - > setIntLikeStrKeys ( intLikeStrKeys ( ) ) ; <nl> wordcpy ( mp - > hashTab ( ) , hashTab ( ) , hashSize ( ) ) ; <nl> - { <nl> - uint32_t used = posLimit ( ) ; <nl> - int32_t version = m_version ; <nl> - uint32_t i = 0 ; <nl> - / / When the loop below finishes or when an exception is thrown , <nl> - / / make sure that posLimit ( ) get set to the correct value and <nl> - / / that m_pos gets set to point to the first element . <nl> - SCOPE_EXIT { <nl> - mp - > setPosLimit ( i ) ; <nl> - mp - > arrayData ( ) - > m_pos = mp - > nthElmPos ( 0 ) ; <nl> - } ; <nl> - for ( ; i < used ; + + i ) { <nl> - const Elm & e = data ( ) [ i ] ; <nl> - Elm & ne = mp - > data ( ) [ i ] ; <nl> - if ( isTombstone ( i ) ) { <nl> - ne . data . m_type = e . data . m_type ; <nl> - continue ; <nl> - } <nl> - TypedValue * tv = & ne . data ; <nl> - auto args = makeArgs ( e ) ; <nl> - g_context - > invokeFuncFew ( tv , ctx , args . size ( ) , & ( args [ 0 ] ) ) ; <nl> - if ( UNLIKELY ( version ! = m_version ) ) { <nl> - tvRefcountedDecRef ( tv ) ; <nl> - throw_collection_modified ( ) ; <nl> - } <nl> - if ( e . hasStrKey ( ) ) { <nl> - e . skey - > incRefCount ( ) ; <nl> - } <nl> - ne . ikey = e . ikey ; <nl> - ne . data . hash ( ) = e . data . hash ( ) ; <nl> - mp - > incSize ( ) ; <nl> + uint32_t used = posLimit ( ) ; <nl> + int32_t version = m_version ; <nl> + for ( uint32_t i = 0 ; i < used ; + + i , mp - > incPosLimit ( ) ) { <nl> + const Elm & e = data ( ) [ i ] ; <nl> + Elm & ne = mp - > data ( ) [ i ] ; <nl> + if ( isTombstone ( i ) ) { <nl> + ne . data . m_type = e . data . m_type ; <nl> + continue ; <nl> + } <nl> + TypedValue * tv = & ne . data ; <nl> + auto args = makeArgs ( e ) ; <nl> + g_context - > invokeFuncFew ( tv , ctx , args . size ( ) , & ( args [ 0 ] ) ) ; <nl> + if ( UNLIKELY ( version ! = m_version ) ) { <nl> + tvRefcountedDecRef ( tv ) ; <nl> + throw_collection_modified ( ) ; <nl> + } <nl> + if ( e . hasStrKey ( ) ) { <nl> + e . skey - > incRefCount ( ) ; <nl> } <nl> + ne . ikey = e . ikey ; <nl> + ne . data . hash ( ) = e . data . hash ( ) ; <nl> + mp - > incSize ( ) ; <nl> } <nl> return obj ; <nl> } <nl> BaseMap : : php_mapFromArray ( const Variant & arr ) { <nl> auto * mp = NEWOBJ ( TMap ) ( ) ; <nl> Object ret = mp ; <nl> ArrayData * ad = arr . getArrayData ( ) ; <nl> - auto pos_limit = ad - > iter_end ( ) ; <nl> - for ( ssize_t pos = ad - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = ad - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = ad - > iter_advance ( pos ) ) { <nl> Variant k = ad - > getKey ( pos ) ; <nl> auto * tv = ad - > getValueRef ( pos ) . asCell ( ) ; <nl> HashCollection : : preSort ( const AccessorT & acc , bool checkTypes ) { <nl> } <nl> done : <nl> setPosLimit ( start - data ( ) ) ; <nl> - / / The logic above possibly moved elements and tombstones around <nl> - / / within the buffer , so we make sure m_pos is not pointing at <nl> - / / garbage by resetting it . The logic above ensures that the first <nl> - / / slot is not a tombstone , so it ' s safe to set m_pos to 0 . <nl> - arrayData ( ) - > m_pos = 0 ; <nl> + / / The logic above possibly moved elements and tombstones around within <nl> + / / the buffer , so we make sure m_pos is not pointing at garbage by setting <nl> + / / it to invalid_index <nl> + arrayData ( ) - > m_pos = ArrayData : : invalid_index ; <nl> assert ( ! hasTombstones ( ) ) ; <nl> if ( checkTypes ) { <nl> return allStrs ? StringSort : allInts ? IntegerSort : GenericSort ; <nl> BaseSet : : php_fromArray ( const Variant & arr ) { <nl> ArrayData * ad = arr . getArrayData ( ) ; <nl> auto oldCap = st - > cap ( ) ; <nl> st - > reserve ( ad - > size ( ) ) ; / / presume minimum collisions . . . <nl> - ssize_t pos_limit = ad - > iter_end ( ) ; <nl> - for ( ssize_t pos = ad - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = ad - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = ad - > iter_advance ( pos ) ) { <nl> st - > addRaw ( ad - > getValueRef ( pos ) ) ; <nl> } <nl> BaseSet : : php_fromArrays ( int _argc , const Array & _argv / * = null_array * / ) { <nl> } <nl> ArrayData * ad = arr . getArrayData ( ) ; <nl> st - > reserve ( st - > size ( ) + ad - > size ( ) ) ; / / presume minimum collisions . . . <nl> - ssize_t pos_limit = ad - > iter_end ( ) ; <nl> - for ( ssize_t pos = ad - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = ad - > iter_begin ( ) ; pos ! = ArrayData : : invalid_index ; <nl> pos = ad - > iter_advance ( pos ) ) { <nl> st - > addRaw ( ad - > getValueRef ( pos ) ) ; <nl> } <nl> mmm a / hphp / runtime / ext / ext_collections . h <nl> ppp b / hphp / runtime / ext / ext_collections . h <nl> class HashCollection : public ExtCollectionObjectData { <nl> <nl> static bool validPos ( ssize_t pos ) { <nl> return pos > = 0 ; <nl> + static_assert ( ssize_t ( Empty ) = = ssize_t ( - 1 ) , " " ) ; <nl> } <nl> <nl> static bool validPos ( int32_t pos ) { <nl> return pos > = 0 ; <nl> + static_assert ( Empty = = - 1 , " " ) ; <nl> } <nl> <nl> / / The skipTombstonesNoBoundsCheck helper functions assume that either <nl> mmm a / hphp / runtime / ext / icu / ext_icu_collator . cpp <nl> ppp b / hphp / runtime / ext / icu / ext_icu_collator . cpp <nl> static bool HHVM_METHOD ( Collator , sortWithSortKeys , VRefParam arr ) { <nl> SCOPE_EXIT { smart_free ( sortIndex ) ; } ; <nl> <nl> / / Translate input hash to sortable index <nl> - auto pos_limit = hash - > iter_end ( ) ; <nl> - for ( ssize_t pos = hash - > iter_begin ( ) ; pos ! = pos_limit ; <nl> + for ( ssize_t pos = hash - > iter_begin ( ) ; <nl> + pos ! = ArrayData : : invalid_index ; <nl> pos = hash - > iter_advance ( pos ) ) { <nl> Variant val ( hash - > getValue ( pos ) ) ; <nl> <nl> mmm a / hphp / runtime / ext / icu / ext_icu_msg_fmt . cpp <nl> ppp b / hphp / runtime / ext / icu / ext_icu_msg_fmt . cpp <nl> bool MessageFormatter : : mapArgs ( std : : vector < icu : : Formattable > & types , <nl> int32_t count = args . size ( ) , arg_num = 0 ; <nl> types . resize ( count ) ; <nl> names . resize ( count ) ; <nl> - auto idx_limit = args - > iter_end ( ) ; <nl> - for ( auto idx = args - > iter_begin ( ) ; idx ! = idx_limit ; <nl> + for ( auto idx = args - > iter_begin ( ) ; <nl> + idx ! = ArrayData : : invalid_index ; <nl> idx = args - > iter_advance ( idx ) , + + arg_num ) { <nl> auto key = args - > getKey ( idx ) ; <nl> icu : : Formattable : : Type type = icu : : Formattable : : kObject ; / / unknown <nl> mmm a / hphp / runtime / ext_zend_compat / php - src / Zend / zend_hash . cpp <nl> ppp b / hphp / runtime / ext_zend_compat / php - src / Zend / zend_hash . cpp <nl> ZEND_API void zend_hash_apply_with_argument ( HashTable * ht , apply_func_arg_t appl <nl> always_assert ( ht - > isProxyArray ( ) ) ; <nl> HPHP : : ProxyArray * proxy = static_cast < HPHP : : ProxyArray * > ( ht ) ; <nl> proxy - > escalate ( ) ; <nl> - for ( HPHP : : MArrayIter pos ( proxy - > innerRef ( ) ) ; pos . advance ( ) ; ) { <nl> + for ( HPHP : : MArrayIter pos ( proxy - > innerRef ( ) ) ; pos . advance ( ) ; ) { <nl> void * data = proxy - > proxyGet ( pos ) ; <nl> int result = apply_func ( data , arg TSRMLS_CC ) ; <nl> <nl> ZEND_API int zend_hash_exists ( const HashTable * ht , const char * arKey , uint nKeyL <nl> <nl> ZEND_API ulong zend_hash_next_free_element ( const HashTable * ht ) { <nl> / / TODO : What the caller really wants here is MixedArray : : m_nextKI <nl> - / / Previously ht - > iter_end ( ) was returned , but that will give some <nl> + / / Previously ht - > iter_end ( ) + 1 was returned , but that will give some <nl> / / vaguely related number like MixedArray : : m_used or APCLocalArray : : m_size , <nl> / / certainly not the key of the next append operation . <nl> not_implemented ( ) ; <nl> mmm a / hphp / runtime / vm / name - value - table - wrapper . cpp <nl> ppp b / hphp / runtime / vm / name - value - table - wrapper . cpp <nl> size_t NameValueTableWrapper : : Vsize ( const ArrayData * ad ) { <nl> / / KindOfUninit . <nl> auto a = asNVTW ( ad ) ; <nl> size_t count = 0 ; <nl> - auto iter_limit = IterEnd ( a ) ; <nl> for ( auto iter = IterBegin ( a ) ; <nl> - iter ! = iter_limit ; <nl> - iter = IterAdvance ( a , iter ) ) { <nl> + iter ! = invalid_index ; <nl> + iter = IterAdvance ( a , iter ) ) { <nl> + + count ; <nl> } <nl> return count ; <nl> ssize_t NameValueTableWrapper : : IterBegin ( const ArrayData * ad ) { <nl> return iter . toInteger ( ) ; <nl> } <nl> <nl> - ssize_t NameValueTableWrapper : : IterLast ( const ArrayData * ad ) { <nl> - auto a = asNVTW ( ad ) ; <nl> - return NameValueTable : : Iterator : : getLast ( a - > m_tab ) . toInteger ( ) ; <nl> - } <nl> - <nl> ssize_t NameValueTableWrapper : : IterEnd ( const ArrayData * ad ) { <nl> auto a = asNVTW ( ad ) ; <nl> return NameValueTable : : Iterator : : getEnd ( a - > m_tab ) . toInteger ( ) ; <nl> NameValueTableWrapper : : ValidMArrayIter ( const ArrayData * ad , <nl> assert ( fp . getContainer ( ) = = ad ) ; <nl> auto a = asNVTW ( ad ) ; <nl> if ( fp . getResetFlag ( ) ) return false ; <nl> - if ( fp . m_pos = = IterEnd ( a ) ) return false ; <nl> + if ( fp . m_pos = = invalid_index ) return false ; <nl> NameValueTable : : Iterator iter ( a - > m_tab , fp . m_pos ) ; <nl> return iter . valid ( ) ; <nl> } <nl> mmm a / hphp / runtime / vm / name - value - table - wrapper . h <nl> ppp b / hphp / runtime / vm / name - value - table - wrapper . h <nl> struct NameValueTableWrapper : private ArrayData { <nl> static ArrayData * CopyWithStrongIterators ( const ArrayData * ) ; <nl> <nl> static ssize_t IterBegin ( const ArrayData * ) ; <nl> - static ssize_t IterLast ( const ArrayData * ) ; <nl> static ssize_t IterEnd ( const ArrayData * ) ; <nl> static ssize_t IterAdvance ( const ArrayData * , ssize_t prev ) ; <nl> static ssize_t IterRewind ( const ArrayData * , ssize_t prev ) ; <nl> mmm a / hphp / runtime / vm / name - value - table . cpp <nl> ppp b / hphp / runtime / vm / name - value - table . cpp <nl> NameValueTable : : Iterator : : Iterator ( const NameValueTable * tab ) <nl> if ( ! valid ( ) ) next ( ) ; <nl> } <nl> <nl> - NameValueTable : : Iterator <nl> - NameValueTable : : Iterator : : getLast ( const NameValueTable * tab ) { <nl> - Iterator it ; <nl> - it . m_tab = tab ; <nl> - it . m_idx = tab - > m_tabMask + 1 ; <nl> - it . prev ( ) ; <nl> - return it ; <nl> - } <nl> - <nl> NameValueTable : : Iterator <nl> NameValueTable : : Iterator : : getEnd ( const NameValueTable * tab ) { <nl> Iterator it ; <nl> it . m_tab = tab ; <nl> it . m_idx = tab - > m_tabMask + 1 ; <nl> + it . prev ( ) ; <nl> return it ; <nl> } <nl> <nl> NameValueTable : : Iterator : : Iterator ( const NameValueTable * tab , <nl> } <nl> <nl> ssize_t NameValueTable : : Iterator : : toInteger ( ) const { <nl> - const ssize_t invalid = m_tab - > m_tabMask + 1 ; <nl> + const ssize_t invalid = ArrayData : : invalid_index ; <nl> return valid ( ) ? m_idx : invalid ; <nl> } <nl> <nl> const TypedValue * NameValueTable : : Iterator : : curVal ( ) const { <nl> <nl> void NameValueTable : : Iterator : : next ( ) { <nl> size_t const sz = m_tab - > m_tabMask + 1 ; <nl> - if ( m_idx + 1 > = sz ) { <nl> - m_idx = sz ; <nl> - return ; <nl> - } <nl> - + + m_idx ; <nl> - if ( LIKELY ( ! atEmpty ( ) ) ) { <nl> - return ; <nl> - } <nl> do { <nl> + + m_idx ; <nl> } while ( size_t ( m_idx ) < sz & & atEmpty ( ) ) ; <nl> mmm a / hphp / runtime / vm / name - value - table . h <nl> ppp b / hphp / runtime / vm / name - value - table . h <nl> struct ActRec ; <nl> struct NameValueTable : private boost : : noncopyable { <nl> struct Iterator { <nl> explicit Iterator ( const NameValueTable * tab ) ; <nl> - static Iterator getLast ( const NameValueTable * tab ) ; <nl> static Iterator getEnd ( const NameValueTable * tab ) ; <nl> <nl> / * <nl> deleted file mode 100644 <nl> index cfabbd0a45f . . 00000000000 <nl> mmm a / hphp / test / quick / array - cursor - bugs . php <nl> ppp / dev / null <nl> <nl> - < ? php <nl> - function main ( ) { <nl> - $ a = array ( ) ; <nl> - $ x = array_shift ( $ a ) ; <nl> - var_dump ( $ x ) ; <nl> - unset ( $ a , $ x ) ; <nl> - $ a = array ( ) ; <nl> - $ x = array_pop ( $ a ) ; <nl> - var_dump ( $ x ) ; <nl> - unset ( $ a , $ x ) ; <nl> - $ a = array ( ) ; <nl> - $ x = next ( $ a ) ; <nl> - var_dump ( $ x ) ; <nl> - unset ( $ a , $ x ) ; <nl> - $ a = array ( ) ; <nl> - $ x = prev ( $ a ) ; <nl> - var_dump ( $ x ) ; <nl> - unset ( $ a , $ x ) ; <nl> - } <nl> - main ( ) ; <nl> deleted file mode 100644 <nl> index 65dc8db78db . . 00000000000 <nl> mmm a / hphp / test / quick / array - cursor - bugs . php . expect <nl> ppp / dev / null <nl> <nl> - NULL <nl> - NULL <nl> - bool ( false ) <nl> - bool ( false ) <nl> mmm a / hphp / util / word - mem . h <nl> ppp b / hphp / util / word - mem . h <nl> template < class T > <nl> T * wordfill ( T * ptr , T value , size_t numT ) { <nl> assert ( numT < std : : numeric_limits < int64_t > : : max ( ) & & <nl> ( numT * sizeof ( T ) ) % 8 = = 0 ) ; <nl> - assert ( numT ! = 0 ) ; <nl> auto numWords = numT * sizeof ( T ) / 8 ; <nl> auto d = ( int64_t * ) ptr ; <nl> do { <nl>
|
Revert " Adjust the encoding m_pos uses when pointing past the last element "
|
facebook/hhvm
|
f1baf8809ac954dabb338e342de62ff3e12b53de
|
2014-07-10T20:30:21Z
|
mmm a / src / dbg / expressionfunctions . cpp <nl> ppp b / src / dbg / expressionfunctions . cpp <nl> void ExpressionFunctions : : Init ( ) <nl> / / TODO : register more functions <nl> using namespace Exprfunc ; <nl> <nl> - / / undocumented <nl> + / / GUI interaction <nl> + RegisterEasy ( " disasm . sel \ 1dis . sel " , disasmsel ) ; <nl> + RegisterEasy ( " dump . sel " , dumpsel ) ; <nl> + RegisterEasy ( " stack . sel " , stacksel ) ; <nl> + <nl> + / / Source <nl> RegisterEasy ( " src . line " , srcline ) ; <nl> RegisterEasy ( " src . disp " , srcdisp ) ; <nl> <nl> + / / Modules <nl> RegisterEasy ( " mod . party " , modparty ) ; <nl> RegisterEasy ( " mod . base " , ModBaseFromAddr ) ; <nl> RegisterEasy ( " mod . size " , ModSizeFromAddr ) ; <nl> RegisterEasy ( " mod . hash " , ModHashFromAddr ) ; <nl> RegisterEasy ( " mod . entry " , ModEntryFromAddr ) ; <nl> <nl> - RegisterEasy ( " disasm . sel \ 1dis . sel " , disasmsel ) ; <nl> - RegisterEasy ( " dump . sel " , dumpsel ) ; <nl> - RegisterEasy ( " stack . sel " , stacksel ) ; <nl> - <nl> + / / Process information <nl> RegisterEasy ( " peb \ 1PEB " , peb ) ; <nl> RegisterEasy ( " teb \ 1TEB " , teb ) ; <nl> RegisterEasy ( " tid \ 1TID \ 1ThreadId " , tid ) ; <nl> - RegisterEasy ( " GetTickCount \ 1gettickcount " , gettickcount ) ; <nl> <nl> + / / General purpose <nl> RegisterEasy ( " bswap " , bswap ) ; <nl> RegisterEasy ( " ternary \ 1tern " , ternary ) ; <nl> + RegisterEasy ( " GetTickCount \ 1gettickcount " , gettickcount ) ; <nl> <nl> + / / Memory <nl> RegisterEasy ( " mem . valid " , memvalid ) ; <nl> RegisterEasy ( " mem . base " , membase ) ; <nl> RegisterEasy ( " mem . size " , memsize ) ; <nl> RegisterEasy ( " mem . iscode " , memiscode ) ; <nl> RegisterEasy ( " mem . decodepointer " , memdecodepointer ) ; <nl> <nl> + / / Disassembly <nl> RegisterEasy ( " dis . len " , dislen ) ; <nl> RegisterEasy ( " dis . iscond " , disiscond ) ; <nl> RegisterEasy ( " dis . isbranch " , disisbranch ) ; <nl> void ExpressionFunctions : : Init ( ) <nl> RegisterEasy ( " dis . brtrue " , disbrtrue ) ; <nl> RegisterEasy ( " dis . brfalse " , disbrfalse ) ; <nl> <nl> + / / Trace record <nl> RegisterEasy ( " tr . enabled " , trenabled ) ; <nl> RegisterEasy ( " tr . hitcount " , trhitcount ) ; <nl> } <nl>
|
DBG : better structured expressionfunctions
|
x64dbg/x64dbg
|
63171e77a3dc735d9b405e0aea4a60dee2ec90be
|
2016-09-12T14:09:32Z
|
mmm a / modules / features2d / include / opencv2 / features2d / features2d . hpp <nl> ppp b / modules / features2d / include / opencv2 / features2d / features2d . hpp <nl> class CV_EXPORTS OrbFeatureDetector : public cv : : FeatureDetector <nl> mutable ORB orb_ ; <nl> } ; <nl> <nl> - class CV_EXPORTS SimpleBlobDetector : public cv : : FeatureDetector <nl> + class CV_EXPORTS_W SimpleBlobDetector : public FeatureDetector <nl> { <nl> public : <nl> - struct CV_EXPORTS Params <nl> + struct CV_EXPORTS_W_SIMPLE Params <nl> { <nl> - Params ( ) ; <nl> - float thresholdStep ; <nl> - float minThreshold ; <nl> - float maxThreshold ; <nl> - size_t minRepeatability ; <nl> - float minDistBetweenBlobs ; <nl> + CV_WRAP Params ( ) ; <nl> + CV_PROP_RW float thresholdStep ; <nl> + CV_PROP_RW float minThreshold ; <nl> + CV_PROP_RW float maxThreshold ; <nl> + CV_PROP_RW size_t minRepeatability ; <nl> + CV_PROP_RW float minDistBetweenBlobs ; <nl> <nl> - bool filterByColor ; <nl> - uchar blobColor ; <nl> + CV_PROP_RW bool filterByColor ; <nl> + CV_PROP_RW uchar blobColor ; <nl> <nl> - bool filterByArea ; <nl> - float minArea , maxArea ; <nl> + CV_PROP_RW bool filterByArea ; <nl> + CV_PROP_RW float minArea , maxArea ; <nl> <nl> - bool filterByCircularity ; <nl> - float minCircularity , maxCircularity ; <nl> + CV_PROP_RW bool filterByCircularity ; <nl> + CV_PROP_RW float minCircularity , maxCircularity ; <nl> <nl> - bool filterByInertia ; <nl> - float minInertiaRatio , maxInertiaRatio ; <nl> + CV_PROP_RW bool filterByInertia ; <nl> + CV_PROP_RW float minInertiaRatio , maxInertiaRatio ; <nl> <nl> - bool filterByConvexity ; <nl> - float minConvexity , maxConvexity ; <nl> + CV_PROP_RW bool filterByConvexity ; <nl> + CV_PROP_RW float minConvexity , maxConvexity ; <nl> <nl> void read ( const FileNode & fn ) ; <nl> void write ( FileStorage & fs ) const ; <nl> } ; <nl> <nl> - SimpleBlobDetector ( const SimpleBlobDetector : : Params & parameters = SimpleBlobDetector : : Params ( ) ) ; <nl> + CV_WRAP SimpleBlobDetector ( const SimpleBlobDetector : : Params & parameters = SimpleBlobDetector : : Params ( ) ) ; <nl> <nl> virtual void read ( const FileNode & fn ) ; <nl> virtual void write ( FileStorage & fs ) const ; <nl> mmm a / modules / python / src2 / cv2 . cpp <nl> ppp b / modules / python / src2 / cv2 . cpp <nl> typedef Ptr < FeatureDetector > Ptr_FeatureDetector ; <nl> typedef Ptr < DescriptorExtractor > Ptr_DescriptorExtractor ; <nl> typedef Ptr < DescriptorMatcher > Ptr_DescriptorMatcher ; <nl> <nl> + typedef SimpleBlobDetector : : Params SimpleBlobDetector_Params ; <nl> + <nl> typedef cvflann : : flann_distance_t cvflann_flann_distance_t ; <nl> typedef cvflann : : flann_algorithm_t cvflann_flann_algorithm_t ; <nl> typedef Ptr < flann : : IndexParams > Ptr_flann_IndexParams ; <nl> static bool pyopencv_to ( PyObject * obj , int & value , const char * name = " < unknown > <nl> return value ! = - 1 | | ! PyErr_Occurred ( ) ; <nl> } <nl> <nl> + static PyObject * pyopencv_from ( uchar value ) <nl> + { <nl> + return PyInt_FromLong ( value ) ; <nl> + } <nl> + <nl> + static bool pyopencv_to ( PyObject * obj , uchar & value , const char * name = " < unknown > " ) <nl> + { <nl> + if ( ! obj | | obj = = Py_None ) <nl> + return true ; <nl> + value = ( int ) PyInt_AsLong ( obj ) ; <nl> + return value ! = - 1 | | ! PyErr_Occurred ( ) ; <nl> + } <nl> + <nl> static PyObject * pyopencv_from ( double value ) <nl> { <nl> return PyFloat_FromDouble ( value ) ; <nl>
|
Wraped SimpleBlobDetector for Python
|
opencv/opencv
|
df6a95ed8786ad5af899efaf841f065ad05bf9f0
|
2012-03-12T11:39:48Z
|
mmm a / arangod / CMakeLists . txt <nl> ppp b / arangod / CMakeLists . txt <nl> add_executable ( <nl> V8Server / v8 - vocbase . cpp <nl> VocBase / auth . cpp <nl> VocBase / barrier . cpp <nl> - VocBase / cleanup . c <nl> + VocBase / cleanup . cpp <nl> VocBase / collection . cpp <nl> - VocBase / compactor . c <nl> - VocBase / datafile . c <nl> + VocBase / compactor . cpp <nl> + VocBase / datafile . cpp <nl> VocBase / document - collection . cpp <nl> VocBase / edge - collection . cpp <nl> VocBase / general - cursor . cpp <nl> VocBase / headers . cpp <nl> - VocBase / index . c <nl> + VocBase / index . cpp <nl> VocBase / key - generator . cpp <nl> VocBase / marker . cpp <nl> VocBase / primary - collection . cpp <nl> - VocBase / replication - applier . c <nl> - VocBase / replication - common . c <nl> - VocBase / replication - dump . c <nl> - VocBase / replication - logger . c <nl> - VocBase / replication - master . c <nl> - VocBase / server . c <nl> - VocBase / synchroniser . c <nl> + VocBase / replication - applier . cpp <nl> + VocBase / replication - common . cpp <nl> + VocBase / replication - dump . cpp <nl> + VocBase / replication - logger . cpp <nl> + VocBase / replication - master . cpp <nl> + VocBase / server . cpp <nl> + VocBase / synchroniser . cpp <nl> VocBase / transaction . cpp <nl> VocBase / update - policy . cpp <nl> - VocBase / voc - shaper . c <nl> - VocBase / vocbase . c <nl> + VocBase / voc - shaper . cpp <nl> + VocBase / vocbase . cpp <nl> VocBase / vocbase - defaults . cpp <nl> Wal / AllocatorThread . cpp <nl> Wal / CollectorThread . cpp <nl> mmm a / arangod / Makefile . files <nl> ppp b / arangod / Makefile . files <nl> bin_arangod_SOURCES = \ <nl> arangod / V8Server / v8 - vocbase . cpp \ <nl> arangod / VocBase / auth . cpp \ <nl> arangod / VocBase / barrier . cpp \ <nl> - arangod / VocBase / cleanup . c \ <nl> + arangod / VocBase / cleanup . cpp \ <nl> arangod / VocBase / collection . cpp \ <nl> - arangod / VocBase / compactor . c \ <nl> - arangod / VocBase / datafile . c \ <nl> + arangod / VocBase / compactor . cpp \ <nl> + arangod / VocBase / datafile . cpp \ <nl> arangod / VocBase / document - collection . cpp \ <nl> arangod / VocBase / edge - collection . cpp \ <nl> arangod / VocBase / general - cursor . cpp \ <nl> arangod / VocBase / headers . cpp \ <nl> - arangod / VocBase / index . c \ <nl> + arangod / VocBase / index . cpp \ <nl> arangod / VocBase / key - generator . cpp \ <nl> arangod / VocBase / marker . cpp \ <nl> arangod / VocBase / primary - collection . cpp \ <nl> - arangod / VocBase / replication - applier . c \ <nl> - arangod / VocBase / replication - common . c \ <nl> - arangod / VocBase / replication - dump . c \ <nl> - arangod / VocBase / replication - logger . c \ <nl> - arangod / VocBase / replication - master . c \ <nl> - arangod / VocBase / server . c \ <nl> - arangod / VocBase / synchroniser . c \ <nl> + arangod / VocBase / replication - applier . cpp \ <nl> + arangod / VocBase / replication - common . cpp \ <nl> + arangod / VocBase / replication - dump . cpp \ <nl> + arangod / VocBase / replication - logger . cpp \ <nl> + arangod / VocBase / replication - master . cpp \ <nl> + arangod / VocBase / server . cpp \ <nl> + arangod / VocBase / synchroniser . cpp \ <nl> arangod / VocBase / transaction . cpp \ <nl> arangod / VocBase / update - policy . cpp \ <nl> - arangod / VocBase / voc - shaper . c \ <nl> - arangod / VocBase / vocbase . c \ <nl> + arangod / VocBase / voc - shaper . cpp \ <nl> + arangod / VocBase / vocbase . cpp \ <nl> arangod / VocBase / vocbase - defaults . cpp \ <nl> arangod / Wal / AllocatorThread . cpp \ <nl> arangod / Wal / CollectorThread . cpp \ <nl> similarity index 99 % <nl> rename from arangod / VocBase / cleanup . c <nl> rename to arangod / VocBase / cleanup . cpp <nl> mmm a / arangod / VocBase / cleanup . c <nl> ppp b / arangod / VocBase / cleanup . cpp <nl> static void CleanupCursors ( TRI_vocbase_t * const vocbase , <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> void TRI_CleanupVocBase ( void * data ) { <nl> - TRI_vocbase_t * vocbase ; <nl> TRI_vector_pointer_t collections ; <nl> uint64_t iterations = 0 ; <nl> <nl> - vocbase = data ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( data ) ; <nl> assert ( vocbase ) ; <nl> assert ( vocbase - > _state = = 1 ) ; <nl> <nl> similarity index 94 % <nl> rename from arangod / VocBase / compactor . c <nl> rename to arangod / VocBase / compactor . cpp <nl> mmm a / arangod / VocBase / compactor . c <nl> ppp b / arangod / VocBase / compactor . cpp <nl> static int CopyMarker ( TRI_document_collection_t * document , <nl> static bool LocateDatafile ( TRI_vector_pointer_t const * vector , <nl> const TRI_voc_fid_t fid , <nl> size_t * position ) { <nl> - size_t i , n ; <nl> - <nl> - n = vector - > _length ; <nl> + size_t const n = vector - > _length ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_datafile_t * df = vector - > _buffer [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_datafile_t * df = static_cast < TRI_datafile_t * > ( vector - > _buffer [ i ] ) ; <nl> <nl> if ( df - > _fid = = fid ) { <nl> * position = i ; <nl> static bool Compactifier ( TRI_df_marker_t const * marker , <nl> marker - > _type = = TRI_DOC_MARKER_KEY_EDGE ) { <nl> <nl> TRI_doc_document_key_marker_t const * d ; <nl> - TRI_doc_mptr_t * found2 ; <nl> TRI_voc_key_t key ; <nl> bool deleted ; <nl> <nl> static bool Compactifier ( TRI_df_marker_t const * marker , <nl> / / check if the document is still active <nl> TRI_READ_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION ( primary ) ; <nl> <nl> - found = TRI_LookupByKeyAssociativePointer ( & primary - > _primaryIndex , key ) ; <nl> + found = static_cast < TRI_doc_mptr_t const * > ( TRI_LookupByKeyAssociativePointer ( & primary - > _primaryIndex , key ) ) ; <nl> deleted = ( found = = NULL | | found - > _rid > d - > _rid ) ; <nl> <nl> TRI_READ_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION ( primary ) ; <nl> static bool Compactifier ( TRI_df_marker_t const * marker , <nl> / / check if the document is still active <nl> TRI_WRITE_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION ( primary ) ; <nl> <nl> - found = TRI_LookupByKeyAssociativePointer ( & primary - > _primaryIndex , key ) ; <nl> + found = static_cast < TRI_doc_mptr_t const * > ( TRI_LookupByKeyAssociativePointer ( & primary - > _primaryIndex , key ) ) ; <nl> deleted = found = = NULL ; <nl> <nl> if ( deleted ) { <nl> static bool Compactifier ( TRI_df_marker_t const * marker , <nl> return true ; <nl> } <nl> <nl> - found2 = CONST_CAST ( found ) ; <nl> + TRI_doc_mptr_t * found2 = const_cast < TRI_doc_mptr_t * > ( found ) ; <nl> assert ( found2 - > _data ! = NULL ) ; <nl> assert ( ( ( TRI_df_marker_t * ) found2 - > _data ) - > _size > 0 ) ; <nl> <nl> static bool CalculateSize ( TRI_df_marker_t const * marker , <nl> void * data , <nl> TRI_datafile_t * datafile , <nl> bool journal ) { <nl> - TRI_document_collection_t * document ; <nl> - TRI_primary_collection_t * primary ; <nl> - compaction_initial_context_t * context ; <nl> - TRI_voc_size_t alignedSize ; <nl> - <nl> - context = data ; <nl> - document = context - > _document ; <nl> - primary = & document - > base ; <nl> + compaction_initial_context_t * context = static_cast < compaction_initial_context_t * > ( data ) ; <nl> + TRI_document_collection_t * document = context - > _document ; <nl> + TRI_primary_collection_t * primary = & document - > base ; <nl> <nl> - alignedSize = TRI_DF_ALIGN_BLOCK ( marker - > _size ) ; <nl> + TRI_voc_size_t alignedSize = TRI_DF_ALIGN_BLOCK ( marker - > _size ) ; <nl> <nl> / / new or updated document <nl> if ( marker - > _type = = TRI_DOC_MARKER_KEY_DOCUMENT | | <nl> marker - > _type = = TRI_DOC_MARKER_KEY_EDGE ) { <nl> <nl> TRI_doc_document_key_marker_t const * d ; <nl> - TRI_doc_mptr_t const * found ; <nl> TRI_voc_key_t key ; <nl> bool deleted ; <nl> <nl> static bool CalculateSize ( TRI_df_marker_t const * marker , <nl> / / check if the document is still active <nl> TRI_READ_LOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION ( primary ) ; <nl> <nl> - found = TRI_LookupByKeyAssociativePointer ( & primary - > _primaryIndex , key ) ; <nl> + TRI_doc_mptr_t const * found = static_cast < TRI_doc_mptr_t const * > ( TRI_LookupByKeyAssociativePointer ( & primary - > _primaryIndex , key ) ) ; <nl> deleted = ( found = = NULL | | found - > _rid > d - > _rid ) ; <nl> <nl> TRI_READ_UNLOCK_DOCUMENTS_INDEXES_PRIMARY_COLLECTION ( primary ) ; <nl> static compaction_initial_context_t InitCompaction ( TRI_document_collection_t * d <nl> <nl> n = compactions - > _length ; <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_datafile_t * df ; <nl> - compaction_info_t * compaction ; <nl> - bool ok ; <nl> - <nl> - compaction = TRI_AtVector ( compactions , i ) ; <nl> - df = compaction - > _datafile ; <nl> + compaction_info_t * compaction = static_cast < compaction_info_t * > ( TRI_AtVector ( compactions , i ) ) ; <nl> + TRI_datafile_t * df = compaction - > _datafile ; <nl> <nl> if ( i = = 0 ) { <nl> / / extract and store fid <nl> static compaction_initial_context_t InitCompaction ( TRI_document_collection_t * d <nl> <nl> context . _keepDeletions = compaction - > _keepDeletions ; <nl> <nl> - ok = TRI_IterateDatafile ( df , CalculateSize , & context , false , false ) ; <nl> + bool ok = TRI_IterateDatafile ( df , CalculateSize , & context , false , false ) ; <nl> <nl> if ( ! ok ) { <nl> context . _failed = true ; <nl> static void CompactifyDatafiles ( TRI_document_collection_t * document , <nl> <nl> / / now compact all datafiles <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - compaction_info_t * compaction ; <nl> - TRI_datafile_t * df ; <nl> - bool ok ; <nl> - <nl> - compaction = TRI_AtVector ( compactions , i ) ; <nl> - df = compaction - > _datafile ; <nl> + compaction_info_t * compaction = static_cast < compaction_info_t * > ( TRI_AtVector ( compactions , i ) ) ; <nl> + TRI_datafile_t * df = compaction - > _datafile ; <nl> <nl> LOG_DEBUG ( " compacting datafile ' % s ' into ' % s ' , number : % d , keep deletions : % d " , <nl> df - > getName ( df ) , <nl> static void CompactifyDatafiles ( TRI_document_collection_t * document , <nl> context . _keepDeletions = compaction - > _keepDeletions ; <nl> <nl> / / run the actual compaction of a single datafile <nl> - ok = TRI_IterateDatafile ( df , Compactifier , & context , false , false ) ; <nl> + bool ok = TRI_IterateDatafile ( df , Compactifier , & context , false , false ) ; <nl> <nl> if ( ! ok ) { <nl> LOG_WARNING ( " failed to compact datafile ' % s ' " , df - > getName ( df ) ) ; <nl> static void CompactifyDatafiles ( TRI_document_collection_t * document , <nl> if ( n > 1 ) { <nl> / / create . dead files for all collected files <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - compaction_info_t * compaction ; <nl> - TRI_datafile_t * datafile ; <nl> - <nl> - compaction = TRI_AtVector ( compactions , i ) ; <nl> - datafile = compaction - > _datafile ; <nl> + compaction_info_t * compaction = static_cast < compaction_info_t * > ( TRI_AtVector ( compactions , i ) ) ; <nl> + TRI_datafile_t * datafile = compaction - > _datafile ; <nl> <nl> if ( datafile - > isPhysical ( datafile ) ) { <nl> char * filename = TRI_Concatenate2String ( datafile - > getName ( datafile ) , " . dead " ) ; <nl> static void CompactifyDatafiles ( TRI_document_collection_t * document , <nl> RemoveCompactor ( document , compactor ) ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - compaction_info_t * compaction ; <nl> - <nl> - compaction = TRI_AtVector ( compactions , i ) ; <nl> + compaction_info_t * compaction = static_cast < compaction_info_t * > ( TRI_AtVector ( compactions , i ) ) ; <nl> <nl> / / datafile is also empty after compaction and thus useless <nl> RemoveDatafile ( document , compaction - > _datafile ) ; <nl> static void CompactifyDatafiles ( TRI_document_collection_t * document , <nl> if ( n > 1 ) { <nl> / / create . dead files for all collected files but the first <nl> for ( i = 1 ; i < n ; + + i ) { <nl> - compaction_info_t * compaction ; <nl> - TRI_datafile_t * datafile ; <nl> - <nl> - compaction = TRI_AtVector ( compactions , i ) ; <nl> - datafile = compaction - > _datafile ; <nl> + compaction_info_t * compaction = static_cast < compaction_info_t * > ( TRI_AtVector ( compactions , i ) ) ; <nl> + TRI_datafile_t * datafile = compaction - > _datafile ; <nl> <nl> if ( datafile - > isPhysical ( datafile ) ) { <nl> char * filename = TRI_Concatenate2String ( datafile - > getName ( datafile ) , " . dead " ) ; <nl> static void CompactifyDatafiles ( TRI_document_collection_t * document , <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> TRI_barrier_t * b ; <nl> - compaction_info_t * compaction ; <nl> - <nl> - compaction = TRI_AtVector ( compactions , i ) ; <nl> + compaction_info_t * compaction = static_cast < compaction_info_t * > ( TRI_AtVector ( compactions , i ) ) ; <nl> <nl> if ( i = = 0 ) { <nl> / / add a rename marker <nl> static bool CompactifyDocumentCollection ( TRI_document_collection_t * document ) { <nl> numAlive = 0 ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_datafile_t * df ; <nl> TRI_doc_datafile_info_t * dfi ; <nl> compaction_info_t compaction ; <nl> uint64_t totalSize = 0 ; <nl> bool shouldCompact ; <nl> <nl> - df = primary - > base . _datafiles . _buffer [ i ] ; <nl> + TRI_datafile_t * df = static_cast < TRI_datafile_t * > ( primary - > base . _datafiles . _buffer [ i ] ) ; <nl> <nl> assert ( df ! = NULL ) ; <nl> <nl> static void UnlockCompaction ( TRI_vocbase_t * vocbase ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static bool CheckAndLockCompaction ( TRI_vocbase_t * vocbase ) { <nl> - double now ; <nl> - size_t i , n ; <nl> - <nl> - now = TRI_microtime ( ) ; <nl> + double now = TRI_microtime ( ) ; <nl> <nl> / / check if we can acquire the write lock instantly <nl> if ( ! TryLockCompaction ( vocbase ) ) { <nl> static bool CheckAndLockCompaction ( TRI_vocbase_t * vocbase ) { <nl> / / we are now holding the write lock <nl> <nl> / / check if we have a still - valid compaction blocker <nl> - n = vocbase - > _compactionBlockers . _data . _length ; <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - compaction_blocker_t * blocker = TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ; <nl> + size_t const n = vocbase - > _compactionBlockers . _data . _length ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + compaction_blocker_t * blocker = static_cast < compaction_blocker_t * > ( TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ) ; <nl> <nl> if ( blocker - > _expires > now ) { <nl> / / found a compaction blocker . unlock and return <nl> void TRI_DestroyCompactorVocBase ( TRI_vocbase_t * vocbase ) { <nl> <nl> bool TRI_CleanupCompactorVocBase ( TRI_vocbase_t * vocbase ) { <nl> double now ; <nl> - size_t i , n ; <nl> <nl> now = TRI_microtime ( ) ; <nl> <nl> bool TRI_CleanupCompactorVocBase ( TRI_vocbase_t * vocbase ) { <nl> <nl> / / we are now holding the write lock <nl> <nl> - n = vocbase - > _compactionBlockers . _data . _length ; <nl> - <nl> - i = 0 ; <nl> + size_t n = vocbase - > _compactionBlockers . _data . _length ; <nl> + size_t i = 0 ; <nl> while ( i < n ) { <nl> - compaction_blocker_t * blocker = TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ; <nl> + compaction_blocker_t * blocker = static_cast < compaction_blocker_t * > ( TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ) ; <nl> <nl> if ( blocker - > _expires < now ) { <nl> TRI_RemoveVector ( & vocbase - > _compactionBlockers . _data , i ) ; <nl> int TRI_InsertBlockerCompactorVocBase ( TRI_vocbase_t * vocbase , <nl> int TRI_TouchBlockerCompactorVocBase ( TRI_vocbase_t * vocbase , <nl> TRI_voc_tick_t id , <nl> double lifetime ) { <nl> - size_t i , n ; <nl> - bool found ; <nl> - <nl> - found = false ; <nl> + bool found = false ; <nl> <nl> if ( lifetime < = 0 . 0 ) { <nl> return TRI_ERROR_BAD_PARAMETER ; <nl> int TRI_TouchBlockerCompactorVocBase ( TRI_vocbase_t * vocbase , <nl> <nl> LockCompaction ( vocbase ) ; <nl> <nl> - n = vocbase - > _compactionBlockers . _data . _length ; <nl> + size_t const n = vocbase - > _compactionBlockers . _data . _length ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - compaction_blocker_t * blocker = TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + compaction_blocker_t * blocker = static_cast < compaction_blocker_t * > ( TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ) ; <nl> <nl> if ( blocker - > _id = = id ) { <nl> blocker - > _expires = TRI_microtime ( ) + lifetime ; <nl> void TRI_UnlockCompactorVocBase ( TRI_vocbase_t * vocbase ) { <nl> <nl> int TRI_RemoveBlockerCompactorVocBase ( TRI_vocbase_t * vocbase , <nl> TRI_voc_tick_t id ) { <nl> - size_t i , n ; <nl> - bool found ; <nl> - <nl> - found = false ; <nl> + bool found = false ; <nl> <nl> LockCompaction ( vocbase ) ; <nl> <nl> - n = vocbase - > _compactionBlockers . _data . _length ; <nl> + size_t const n = vocbase - > _compactionBlockers . _data . _length ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - compaction_blocker_t * blocker = TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + compaction_blocker_t * blocker = static_cast < compaction_blocker_t * > ( TRI_AtVector ( & vocbase - > _compactionBlockers . _data , i ) ) ; <nl> <nl> if ( blocker - > _id = = id ) { <nl> TRI_RemoveVector ( & vocbase - > _compactionBlockers . _data , i ) ; <nl> similarity index 98 % <nl> rename from arangod / VocBase / datafile . c <nl> rename to arangod / VocBase / datafile . cpp <nl> mmm a / arangod / VocBase / datafile . c <nl> ppp b / arangod / VocBase / datafile . cpp <nl> static int TruncateAndSealDatafile ( TRI_datafile_t * datafile , <nl> <nl> TRI_CLOSE ( datafile - > _fd ) ; <nl> <nl> - datafile - > _data = data ; <nl> + datafile - > _data = static_cast < char * > ( data ) ; <nl> datafile - > _next = ( char * ) ( data ) + vocSize ; <nl> datafile - > _currentSize = vocSize ; <nl> datafile - > _maximalSize = maximalSize ; <nl> static int TruncateAndSealDatafile ( TRI_datafile_t * datafile , <nl> datafile - > _state = TRI_DF_STATE_CLOSED ; <nl> datafile - > _full = false ; <nl> datafile - > _isSealed = false ; <nl> - datafile - > _synced = data ; <nl> + datafile - > _synced = static_cast < char * > ( data ) ; <nl> datafile - > _written = datafile - > _next ; <nl> <nl> / / rename files <nl> static uint64_t GetNumericFilenamePart ( const char * filename ) { <nl> <nl> static TRI_datafile_t * OpenDatafile ( char const * filename , <nl> bool ignoreErrors ) { <nl> - TRI_datafile_t * datafile ; <nl> TRI_voc_size_t size ; <nl> TRI_voc_fid_t fid ; <nl> bool ok ; <nl> static TRI_datafile_t * OpenDatafile ( char const * filename , <nl> } <nl> <nl> / / create datafile structure <nl> - datafile = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_datafile_t ) , false ) ; <nl> + TRI_datafile_t * datafile = static_cast < TRI_datafile_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_datafile_t ) , false ) ) ; <nl> <nl> if ( datafile = = NULL ) { <nl> TRI_UNMMFile ( data , size , fd , & mmHandle ) ; <nl> static TRI_datafile_t * OpenDatafile ( char const * filename , <nl> size , <nl> size , <nl> fid , <nl> - data ) ; <nl> + static_cast < char * > ( data ) ) ; <nl> <nl> return datafile ; <nl> } <nl> TRI_datafile_t * TRI_CreateAnonymousDatafile ( TRI_voc_fid_t fid , <nl> maximalSize , <nl> 0 , <nl> fid , <nl> - data ) ; <nl> + static_cast < char * > ( data ) ) ; <nl> <nl> return datafile ; <nl> } <nl> TRI_datafile_t * TRI_CreatePhysicalDatafile ( char const * filename , <nl> maximalSize , <nl> 0 , <nl> fid , <nl> - data ) ; <nl> + static_cast < char * > ( data ) ) ; <nl> <nl> return datafile ; <nl> } <nl> void TRI_FillCrcKeyMarkerDatafile ( TRI_datafile_t * datafile , <nl> crc = TRI_BlockCrc32 ( crc , ( char const * ) marker , markerSize ) ; <nl> <nl> if ( keyBody ! = NULL & & 0 < keyBodySize ) { <nl> - crc = TRI_BlockCrc32 ( crc , keyBody , keyBodySize ) ; <nl> + crc = TRI_BlockCrc32 ( crc , static_cast < char const * > ( keyBody ) , keyBodySize ) ; <nl> } <nl> <nl> if ( body ! = NULL & & 0 < bodySize ) { <nl> - crc = TRI_BlockCrc32 ( crc , body , bodySize ) ; <nl> + crc = TRI_BlockCrc32 ( crc , static_cast < char const * > ( body ) , bodySize ) ; <nl> } <nl> <nl> marker - > _crc = TRI_FinalCrc32 ( crc ) ; <nl> int TRI_WriteElementDatafile ( TRI_datafile_t * datafile , <nl> bool forceSync ) { <nl> <nl> TRI_voc_tick_t tick = marker - > _tick ; <nl> - TRI_df_marker_type_e type = marker - > _type ; <nl> + TRI_df_marker_type_e type = ( TRI_df_marker_type_e ) ( int ) marker - > _type ; <nl> <nl> assert ( tick > 0 ) ; <nl> <nl> int TRI_WriteElementDatafile ( TRI_datafile_t * datafile , <nl> if ( forceSync ) { <nl> bool ok ; <nl> <nl> - ok = datafile - > sync ( datafile , position , ( ( char * ) position ) + markerSize ) ; <nl> + ok = datafile - > sync ( datafile , static_cast < char const * > ( position ) , ( ( char * ) position ) + markerSize ) ; <nl> <nl> if ( ! ok ) { <nl> datafile - > _state = TRI_DF_STATE_WRITE_ERROR ; <nl> similarity index 95 % <nl> rename from arangod / VocBase / index . c <nl> rename to arangod / VocBase / index . cpp <nl> mmm a / arangod / VocBase / index . c <nl> ppp b / arangod / VocBase / index . cpp <nl> int TRI_SaveIndex ( TRI_primary_collection_t * primary , <nl> <nl> TRI_index_t * TRI_LookupIndex ( TRI_primary_collection_t * primary , <nl> TRI_idx_iid_t iid ) { <nl> - TRI_document_collection_t * doc ; <nl> - TRI_index_t * idx ; <nl> - size_t i ; <nl> - <nl> - doc = ( TRI_document_collection_t * ) primary ; <nl> + TRI_document_collection_t * doc = ( TRI_document_collection_t * ) primary ; <nl> <nl> - for ( i = 0 ; i < doc - > _allIndexes . _length ; + + i ) { <nl> - idx = doc - > _allIndexes . _buffer [ i ] ; <nl> + for ( size_t i = 0 ; i < doc - > _allIndexes . _length ; + + i ) { <nl> + TRI_index_t * idx = static_cast < TRI_index_t * > ( doc - > _allIndexes . _buffer [ i ] ) ; <nl> <nl> if ( idx - > _iid = = iid ) { <nl> return idx ; <nl> void TRI_CopyPathVector ( TRI_vector_t * dst , TRI_vector_t * src ) { <nl> <nl> char const * * TRI_FieldListByPathList ( TRI_shaper_t * shaper , <nl> TRI_vector_t * paths ) { <nl> - char const * * fieldList ; <nl> - size_t j ; <nl> - <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / Allocate sufficent memory for the field list <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - fieldList = TRI_Allocate ( TRI_CORE_MEM_ZONE , ( sizeof ( char const * ) * paths - > _length ) , false ) ; <nl> + char const * * fieldList = static_cast < char const * * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , ( sizeof ( char const * ) * paths - > _length ) , false ) ) ; <nl> <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / Convert the attributes ( field list of the hash index ) into strings <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - for ( j = 0 ; j < paths - > _length ; + + j ) { <nl> + for ( size_t j = 0 ; j < paths - > _length ; + + j ) { <nl> TRI_shape_pid_t shape = * ( ( TRI_shape_pid_t * ) ( TRI_AtVector ( paths , j ) ) ) ; <nl> TRI_shape_path_t const * path = shaper - > lookupAttributePathByPid ( shaper , shape ) ; <nl> <nl> static TRI_json_t * JsonPrimary ( TRI_index_t * idx ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> TRI_index_t * TRI_CreatePrimaryIndex ( struct TRI_primary_collection_s * primary ) { <nl> - TRI_index_t * idx ; <nl> - char * id ; <nl> - <nl> / / note : primary can be NULL <nl> <nl> / / create primary index <nl> - idx = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_index_t ) , false ) ; <nl> + TRI_index_t * idx = static_cast < TRI_index_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_index_t ) , false ) ) ; <nl> <nl> if ( idx = = NULL ) { <nl> return NULL ; <nl> } <nl> <nl> - id = TRI_DuplicateStringZ ( TRI_CORE_MEM_ZONE , " _id " ) ; <nl> + char * id = TRI_DuplicateStringZ ( TRI_CORE_MEM_ZONE , " _id " ) ; <nl> TRI_InitVectorString ( & idx - > _fields , TRI_CORE_MEM_ZONE ) ; <nl> TRI_PushBackVectorString ( & idx - > _fields , id ) ; <nl> <nl> void TRI_FreePrimaryIndex ( TRI_index_t * idx ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashElementKey ( TRI_multi_pointer_t * array , void const * data ) { <nl> - TRI_edge_header_t const * h ; <nl> - uint64_t hash ; <nl> - char * key ; <nl> + TRI_edge_header_t const * h = static_cast < TRI_edge_header_t const * > ( data ) ; <nl> + char const * key = h - > _key ; <nl> <nl> - h = data ; <nl> - key = h - > _key ; <nl> - <nl> - / / only include directional bits for hashing , exclude special bits <nl> - hash = h - > _cid ; <nl> + uint64_t hash = h - > _cid ; <nl> hash ^ = ( uint64_t ) fasthash64 ( key , strlen ( key ) , 0x87654321 ) ; <nl> <nl> return fasthash64 ( & hash , sizeof ( hash ) , 0x56781234 ) ; <nl> static uint64_t HashElementKey ( TRI_multi_pointer_t * array , void const * data ) { <nl> static uint64_t HashElementEdgeFrom ( TRI_multi_pointer_t * array , <nl> void const * data , <nl> bool byKey ) { <nl> - TRI_doc_mptr_t const * mptr ; <nl> - TRI_doc_edge_key_marker_t const * edge ; <nl> - char const * key ; <nl> - <nl> uint64_t hash ; <nl> <nl> - if ( ! byKey ) { <nl> + if ( ! byKey ) { <nl> hash = ( uint64_t ) data ; <nl> } <nl> else { <nl> - mptr = data ; <nl> - edge = mptr - > _data ; <nl> - key = ( char * ) edge + edge - > _offsetFromKey ; <nl> + TRI_doc_mptr_t const * mptr = static_cast < TRI_doc_mptr_t const * > ( data ) ; <nl> + TRI_doc_edge_key_marker_t const * edge = static_cast < TRI_doc_edge_key_marker_t const * > ( mptr - > _data ) ; <nl> + char const * key = ( char const * ) edge + edge - > _offsetFromKey ; <nl> <nl> hash = edge - > _fromCid ; <nl> hash ^ = ( uint64_t ) fasthash64 ( key , strlen ( key ) , 0x87654321 ) ; <nl> static uint64_t HashElementEdgeFrom ( TRI_multi_pointer_t * array , <nl> static uint64_t HashElementEdgeTo ( TRI_multi_pointer_t * array , <nl> void const * data , <nl> bool byKey ) { <nl> - TRI_doc_mptr_t const * mptr ; <nl> - TRI_doc_edge_key_marker_t const * edge ; <nl> - char const * key ; <nl> - <nl> uint64_t hash ; <nl> <nl> - if ( ! byKey ) { <nl> + if ( ! byKey ) { <nl> hash = ( uint64_t ) data ; <nl> } <nl> else { <nl> - mptr = data ; <nl> - edge = mptr - > _data ; <nl> - key = ( char * ) edge + edge - > _offsetToKey ; <nl> + TRI_doc_mptr_t const * mptr = static_cast < TRI_doc_mptr_t const * > ( data ) ; <nl> + TRI_doc_edge_key_marker_t const * edge = static_cast < TRI_doc_edge_key_marker_t const * > ( mptr - > _data ) ; <nl> + char const * key = ( char const * ) edge + edge - > _offsetToKey ; <nl> <nl> hash = edge - > _toCid ; <nl> hash ^ = ( uint64_t ) fasthash64 ( key , strlen ( key ) , 0x87654321 ) ; <nl> static bool IsEqualKeyEdgeFrom ( TRI_multi_pointer_t * array , <nl> void const * right ) { <nl> / / left is a key <nl> / / right is an element , that is a master pointer <nl> - TRI_edge_header_t const * l ; <nl> - TRI_doc_mptr_t const * rMptr ; <nl> - TRI_doc_edge_key_marker_t const * rEdge ; <nl> - const char * lKey ; <nl> - const char * rKey ; <nl> + TRI_edge_header_t const * l = static_cast < TRI_edge_header_t const * > ( left ) ; <nl> + char const * lKey = l - > _key ; <nl> <nl> - l = left ; <nl> - lKey = l - > _key ; <nl> - <nl> - rMptr = right ; <nl> - rEdge = rMptr - > _data ; <nl> - rKey = ( char * ) rEdge + rEdge - > _offsetFromKey ; <nl> + TRI_doc_mptr_t const * rMptr = static_cast < TRI_doc_mptr_t const * > ( right ) ; <nl> + TRI_doc_edge_key_marker_t const * rEdge = static_cast < TRI_doc_edge_key_marker_t const * > ( rMptr - > _data ) ; <nl> + char const * rKey = ( char const * ) rEdge + rEdge - > _offsetFromKey ; <nl> <nl> return ( strcmp ( lKey , rKey ) = = 0 ) & & l - > _cid = = rEdge - > _fromCid ; <nl> } <nl> static bool IsEqualKeyEdgeTo ( TRI_multi_pointer_t * array , <nl> void const * right ) { <nl> / / left is a key <nl> / / right is an element , that is a master pointer <nl> - TRI_edge_header_t const * l ; <nl> - TRI_doc_mptr_t const * rMptr ; <nl> - TRI_doc_edge_key_marker_t const * rEdge ; <nl> - const char * lKey ; <nl> - const char * rKey ; <nl> - <nl> - l = left ; <nl> - lKey = l - > _key ; <nl> + TRI_edge_header_t const * l = static_cast < TRI_edge_header_t const * > ( left ) ; <nl> + char const * lKey = l - > _key ; <nl> <nl> - rMptr = right ; <nl> - rEdge = rMptr - > _data ; <nl> - rKey = ( char * ) rEdge + rEdge - > _offsetToKey ; <nl> + TRI_doc_mptr_t const * rMptr = static_cast < TRI_doc_mptr_t const * > ( right ) ; <nl> + TRI_doc_edge_key_marker_t const * rEdge = static_cast < TRI_doc_edge_key_marker_t const * > ( rMptr - > _data ) ; <nl> + char const * rKey = ( char const * ) rEdge + rEdge - > _offsetToKey ; <nl> <nl> return ( strcmp ( lKey , rKey ) = = 0 ) & & l - > _cid = = rEdge - > _toCid ; <nl> } <nl> static bool IsEqualElementEdgeFrom ( TRI_multi_pointer_t * array , <nl> void const * left , <nl> void const * right , <nl> bool byKey ) { <nl> - TRI_doc_mptr_t const * lMptr ; <nl> - TRI_doc_mptr_t const * rMptr ; <nl> - TRI_doc_edge_key_marker_t const * lEdge ; <nl> - TRI_doc_edge_key_marker_t const * rEdge ; <nl> - char const * lKey ; <nl> - char const * rKey ; <nl> - <nl> - if ( ! byKey ) { <nl> + if ( ! byKey ) { <nl> return left = = right ; <nl> } <nl> else { <nl> - lMptr = left ; <nl> - rMptr = right ; <nl> - lEdge = lMptr - > _data ; <nl> - rEdge = rMptr - > _data ; <nl> - lKey = ( char * ) lEdge + lEdge - > _offsetFromKey ; <nl> - rKey = ( char * ) rEdge + rEdge - > _offsetFromKey ; <nl> + TRI_doc_mptr_t const * lMptr = static_cast < TRI_doc_mptr_t const * > ( left ) ; <nl> + TRI_doc_mptr_t const * rMptr = static_cast < TRI_doc_mptr_t const * > ( right ) ; <nl> + TRI_doc_edge_key_marker_t const * lEdge = static_cast < TRI_doc_edge_key_marker_t const * > ( lMptr - > _data ) ; <nl> + TRI_doc_edge_key_marker_t const * rEdge = static_cast < TRI_doc_edge_key_marker_t const * > ( rMptr - > _data ) ; <nl> + char const * lKey = ( char const * ) lEdge + lEdge - > _offsetFromKey ; <nl> + char const * rKey = ( char const * ) rEdge + rEdge - > _offsetFromKey ; <nl> <nl> return strcmp ( lKey , rKey ) = = 0 & & lEdge - > _fromCid = = rEdge - > _fromCid ; <nl> } <nl> static bool IsEqualElementEdgeTo ( TRI_multi_pointer_t * array , <nl> void const * left , <nl> void const * right , <nl> bool byKey ) { <nl> - TRI_doc_mptr_t const * lMptr ; <nl> - TRI_doc_mptr_t const * rMptr ; <nl> - TRI_doc_edge_key_marker_t const * lEdge ; <nl> - TRI_doc_edge_key_marker_t const * rEdge ; <nl> - char const * lKey ; <nl> - char const * rKey ; <nl> - <nl> - if ( ! byKey ) { <nl> + if ( ! byKey ) { <nl> return left = = right ; <nl> } <nl> else { <nl> - lMptr = left ; <nl> - rMptr = right ; <nl> - lEdge = lMptr - > _data ; <nl> - rEdge = rMptr - > _data ; <nl> - lKey = ( char * ) lEdge + lEdge - > _offsetToKey ; <nl> - rKey = ( char * ) rEdge + rEdge - > _offsetToKey ; <nl> + TRI_doc_mptr_t const * lMptr = static_cast < TRI_doc_mptr_t const * > ( left ) ; <nl> + TRI_doc_mptr_t const * rMptr = static_cast < TRI_doc_mptr_t const * > ( right ) ; <nl> + TRI_doc_edge_key_marker_t const * lEdge = static_cast < TRI_doc_edge_key_marker_t const * > ( lMptr - > _data ) ; <nl> + TRI_doc_edge_key_marker_t const * rEdge = static_cast < TRI_doc_edge_key_marker_t const * > ( rMptr - > _data ) ; <nl> + char const * lKey = ( char const * ) lEdge + lEdge - > _offsetToKey ; <nl> + char const * rKey = ( char const * ) rEdge + rEdge - > _offsetToKey ; <nl> <nl> return strcmp ( lKey , rKey ) = = 0 & & lEdge - > _toCid = = rEdge - > _toCid ; <nl> } <nl> static int SizeHintEdge ( TRI_index_t * idx , <nl> <nl> TRI_index_t * TRI_CreateEdgeIndex ( struct TRI_primary_collection_s * primary , <nl> TRI_idx_iid_t iid ) { <nl> - TRI_edge_index_t * edgeIndex ; <nl> TRI_index_t * idx ; <nl> char * id ; <nl> int res ; <nl> <nl> / / create index <nl> - edgeIndex = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_edge_index_t ) , false ) ; <nl> + TRI_edge_index_t * edgeIndex = static_cast < TRI_edge_index_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_edge_index_t ) , false ) ) ; <nl> <nl> if ( edgeIndex = = NULL ) { <nl> return NULL ; <nl> static int FillLookupSLOperator ( TRI_index_operator_t * slOperator , <nl> case TRI_LT_INDEX_OPERATOR : { <nl> relationOperator = ( TRI_relation_index_operator_t * ) slOperator ; <nl> relationOperator - > _numFields = relationOperator - > _parameters - > _value . _objects . _length ; <nl> - relationOperator - > _fields = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_json_t ) * relationOperator - > _numFields , false ) ; <nl> + relationOperator - > _fields = static_cast < TRI_shaped_json_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_json_t ) * relationOperator - > _numFields , false ) ) ; <nl> <nl> if ( relationOperator - > _fields ! = NULL ) { <nl> for ( j = 0 ; j < relationOperator - > _numFields ; + + j ) { <nl> static int SkiplistIndexHelper ( const TRI_skiplist_index_t * skiplistIndex , <nl> return TRI_ERROR_INTERNAL ; <nl> } <nl> <nl> - skiplistElement - > _document = CONST_CAST ( document ) ; <nl> + skiplistElement - > _document = const_cast < TRI_doc_mptr_t * > ( document ) ; <nl> ptr = ( char const * ) skiplistElement - > _document - > _data ; <nl> <nl> for ( j = 0 ; j < skiplistIndex - > _paths . _length ; + + j ) { <nl> static int InsertSkiplistIndex ( TRI_index_t * idx , <nl> / / These will be used for comparisions <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - skiplistElement . _subObjects = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_sub_t ) * skiplistIndex - > _paths . _length , false ) ; <nl> + skiplistElement . _subObjects = static_cast < TRI_shaped_sub_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_sub_t ) * skiplistIndex - > _paths . _length , false ) ) ; <nl> <nl> if ( skiplistElement . _subObjects = = NULL ) { <nl> LOG_WARNING ( " out - of - memory in InsertSkiplistIndex " ) ; <nl> static TRI_json_t * JsonSkiplistIndex ( TRI_index_t * idx ) { <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / Allocate sufficent memory for the field list <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> - fieldList = TRI_Allocate ( TRI_CORE_MEM_ZONE , ( sizeof ( char * ) * skiplistIndex - > _paths . _length ) , false ) ; <nl> + fieldList = static_cast < char const * * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , ( sizeof ( char * ) * skiplistIndex - > _paths . _length ) , false ) ) ; <nl> <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / Convert the attributes ( field list of the skiplist index ) into strings <nl> static int RemoveSkiplistIndex ( TRI_index_t * idx , <nl> / / Allocate some memory for the SkiplistIndexElement structure <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - skiplistElement . _subObjects = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_sub_t ) * skiplistIndex - > _paths . _length , false ) ; <nl> + skiplistElement . _subObjects = static_cast < TRI_shaped_sub_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_sub_t ) * skiplistIndex - > _paths . _length , false ) ) ; <nl> <nl> if ( skiplistElement . _subObjects = = NULL ) { <nl> LOG_WARNING ( " out - of - memory in InsertSkiplistIndex " ) ; <nl> TRI_index_t * TRI_CreateSkiplistIndex ( TRI_primary_collection_t * primary , <nl> TRI_vector_pointer_t * fields , <nl> TRI_vector_t * paths , <nl> bool unique ) { <nl> - TRI_skiplist_index_t * skiplistIndex ; <nl> - TRI_index_t * idx ; <nl> int result ; <nl> size_t j ; <nl> <nl> assert ( primary ! = NULL ) ; <nl> - skiplistIndex = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_skiplist_index_t ) , false ) ; <nl> + TRI_skiplist_index_t * skiplistIndex = static_cast < TRI_skiplist_index_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_skiplist_index_t ) , false ) ) ; <nl> <nl> if ( skiplistIndex = = NULL ) { <nl> return NULL ; <nl> } <nl> <nl> - idx = & skiplistIndex - > base ; <nl> + TRI_index_t * idx = & skiplistIndex - > base ; <nl> <nl> TRI_InitIndex ( idx , iid , TRI_IDX_TYPE_SKIPLIST_INDEX , primary , unique ) ; <nl> <nl> TRI_index_t * TRI_CreateSkiplistIndex ( TRI_primary_collection_t * primary , <nl> TRI_InitVectorString ( & idx - > _fields , TRI_CORE_MEM_ZONE ) ; <nl> <nl> for ( j = 0 ; j < fields - > _length ; + + j ) { <nl> - char const * name = fields - > _buffer [ j ] ; <nl> + char const * name = static_cast < char const * > ( fields - > _buffer [ j ] ) ; <nl> char * copy = TRI_DuplicateStringZ ( TRI_CORE_MEM_ZONE , name ) ; <nl> TRI_PushBackVectorString ( & idx - > _fields , copy ) ; <nl> } <nl> TRI_index_t * TRI_CreateFulltextIndex ( struct TRI_primary_collection_s * primary , <nl> const char * attributeName , <nl> const bool indexSubstrings , <nl> int minWordLength ) { <nl> - TRI_fulltext_index_t * fulltextIndex ; <nl> TRI_index_t * idx ; <nl> TRI_fts_index_t * fts ; <nl> TRI_shaper_t * shaper ; <nl> TRI_index_t * TRI_CreateFulltextIndex ( struct TRI_primary_collection_s * primary , <nl> } <nl> <nl> copy = TRI_DuplicateStringZ ( TRI_CORE_MEM_ZONE , attributeName ) ; <nl> - fulltextIndex = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_fulltext_index_t ) , false ) ; <nl> + TRI_fulltext_index_t * fulltextIndex = static_cast < TRI_fulltext_index_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_fulltext_index_t ) , false ) ) ; <nl> <nl> fts = TRI_CreateFtsIndex ( 2048 , 1 , 1 ) ; <nl> if ( fts = = NULL ) { <nl> static int BitarrayIndexHelper ( const TRI_bitarray_index_t * baIndex , <nl> / / be retreived later . <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - element - > data = CONST_CAST ( document ) ; <nl> + element - > data = const_cast < TRI_doc_mptr_t * > ( document ) ; <nl> <nl> for ( j = 0 ; j < baIndex - > _paths . _length ; + + j ) { <nl> TRI_shaped_json_t shapedJson ; <nl> static int InsertBitarrayIndex ( TRI_index_t * idx , <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> element . numFields = baIndex - > _paths . _length ; <nl> - element . fields = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_json_t ) * element . numFields , false ) ; <nl> + element . fields = static_cast < TRI_shaped_json_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_shaped_json_t ) * element . numFields , false ) ) ; <nl> element . collection = baIndex - > base . _collection ; <nl> <nl> if ( element . fields = = NULL ) { <nl> static TRI_json_t * JsonBitarrayIndex ( TRI_index_t * idx ) { <nl> TRI_primary_collection_t * primary ; <nl> const TRI_shape_path_t * path ; <nl> TRI_bitarray_index_t * baIndex ; <nl> - char const * * fieldList ; <nl> size_t j ; <nl> <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> static TRI_json_t * JsonBitarrayIndex ( TRI_index_t * idx ) { <nl> / / Allocate sufficent memory for the field list <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - fieldList = TRI_Allocate ( TRI_CORE_MEM_ZONE , ( sizeof ( char * ) * baIndex - > _paths . _length ) , false ) ; <nl> + char const * * fieldList = static_cast < char const * * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , ( sizeof ( char * ) * baIndex - > _paths . _length ) , false ) ) ; <nl> <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / Convert the attributes ( field list of the bitarray index ) into strings <nl> static int RemoveBitarrayIndex ( TRI_index_t * idx , <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> element . numFields = baIndex - > _paths . _length ; <nl> - element . fields = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_shaped_json_t ) * element . numFields , false ) ; <nl> + element . fields = static_cast < TRI_shaped_json_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_shaped_json_t ) * element . numFields , false ) ) ; <nl> element . collection = baIndex - > base . _collection ; <nl> <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> TRI_index_t * TRI_CreateBitarrayIndex ( struct TRI_primary_collection_s * primary , <nl> bool supportUndef , <nl> int * errorNum , <nl> char * * errorStr ) { <nl> - TRI_bitarray_index_t * baIndex ; <nl> TRI_index_t * idx ; <nl> size_t i , j , k ; <nl> int result ; <nl> TRI_index_t * TRI_CreateBitarrayIndex ( struct TRI_primary_collection_s * primary , <nl> / / attempt to allocate memory for the bit array index structure <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - baIndex = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_bitarray_index_t ) , false ) ; <nl> + TRI_bitarray_index_t * baIndex = static_cast < TRI_bitarray_index_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_bitarray_index_t ) , false ) ) ; <nl> idx = & baIndex - > base ; <nl> <nl> TRI_InitIndex ( idx , iid , TRI_IDX_TYPE_BITARRAY_INDEX , primary , false ) ; <nl> TRI_index_t * TRI_CreateBitarrayIndex ( struct TRI_primary_collection_s * primary , <nl> TRI_InitVectorString ( & idx - > _fields , TRI_CORE_MEM_ZONE ) ; <nl> <nl> for ( j = 0 ; j < fields - > _length ; + + j ) { <nl> - char const * name = fields - > _buffer [ j ] ; <nl> + char const * name = static_cast < char const * > ( fields - > _buffer [ j ] ) ; <nl> char * copy = TRI_DuplicateStringZ ( TRI_CORE_MEM_ZONE , name ) ; <nl> <nl> TRI_PushBackVectorString ( & idx - > _fields , copy ) ; <nl> similarity index 99 % <nl> rename from arangod / VocBase / replication - applier . c <nl> rename to arangod / VocBase / replication - applier . cpp <nl> mmm a / arangod / VocBase / replication - applier . c <nl> ppp b / arangod / VocBase / replication - applier . cpp <nl> static TRI_json_t * JsonState ( TRI_replication_applier_state_t const * state ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> TRI_replication_applier_t * TRI_CreateReplicationApplier ( TRI_vocbase_t * vocbase ) { <nl> - TRI_replication_applier_t * applier ; <nl> - <nl> - applier = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_replication_applier_t ) , false ) ; <nl> + TRI_replication_applier_t * applier = static_cast < TRI_replication_applier_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_replication_applier_t ) , false ) ) ; <nl> <nl> if ( applier = = NULL ) { <nl> return NULL ; <nl> similarity index 100 % <nl> rename from arangod / VocBase / replication - common . c <nl> rename to arangod / VocBase / replication - common . cpp <nl> similarity index 97 % <nl> rename from arangod / VocBase / replication - dump . c <nl> rename to arangod / VocBase / replication - dump . cpp <nl> mmm a / arangod / VocBase / replication - dump . c <nl> ppp b / arangod / VocBase / replication - dump . cpp <nl> resolved_name_t ; <nl> <nl> static uint64_t HashKeyCid ( TRI_associative_pointer_t * array , <nl> void const * key ) { <nl> - TRI_voc_cid_t const * k = key ; <nl> + TRI_voc_cid_t const * k = static_cast < TRI_voc_cid_t const * > ( key ) ; <nl> <nl> return * k ; <nl> } <nl> static uint64_t HashKeyCid ( TRI_associative_pointer_t * array , <nl> <nl> static uint64_t HashElementCid ( TRI_associative_pointer_t * array , <nl> void const * element ) { <nl> - resolved_name_t const * e = element ; <nl> + resolved_name_t const * e = static_cast < resolved_name_t const * > ( element ) ; <nl> <nl> return e - > _cid ; <nl> } <nl> static uint64_t HashElementCid ( TRI_associative_pointer_t * array , <nl> static bool IsEqualKeyElementCid ( TRI_associative_pointer_t * array , <nl> void const * key , <nl> void const * element ) { <nl> - TRI_voc_cid_t const * k = key ; <nl> - resolved_name_t const * e = element ; <nl> + TRI_voc_cid_t const * k = static_cast < TRI_voc_cid_t const * > ( key ) ; <nl> + resolved_name_t const * e = static_cast < resolved_name_t const * > ( element ) ; <nl> <nl> return * k = = e - > _cid ; <nl> } <nl> static bool LookupCollectionName ( TRI_replication_dump_t * dump , <nl> TRI_voc_cid_t cid , <nl> char * * result ) { <nl> <nl> - resolved_name_t * found ; <nl> - <nl> assert ( cid > 0 ) ; <nl> <nl> - found = ( resolved_name_t * ) TRI_LookupByKeyAssociativePointer ( & dump - > _collectionNames , & cid ) ; <nl> + resolved_name_t * found = static_cast < resolved_name_t * > ( TRI_LookupByKeyAssociativePointer ( & dump - > _collectionNames , & cid ) ) ; <nl> <nl> if ( found = = NULL ) { <nl> - found = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( resolved_name_t ) , false ) ; <nl> + found = static_cast < resolved_name_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( resolved_name_t ) , false ) ) ; <nl> <nl> if ( found = = NULL ) { <nl> / / out of memory ; <nl> static int IterateDatafiles ( TRI_vector_pointer_t const * datafiles , <nl> TRI_voc_tick_t dataMax , <nl> bool isJournal ) { <nl> <nl> - size_t i , n ; <nl> - int res ; <nl> - <nl> - res = TRI_ERROR_NO_ERROR ; <nl> + int res = TRI_ERROR_NO_ERROR ; <nl> <nl> - n = datafiles - > _length ; <nl> + size_t const n = datafiles - > _length ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_datafile_t * df = TRI_AtVectorPointer ( datafiles , i ) ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_datafile_t * df = static_cast < TRI_datafile_t * > ( TRI_AtVectorPointer ( datafiles , i ) ) ; <nl> <nl> df_entry_t entry = { <nl> df , <nl> static bool InFailedList ( TRI_vector_t const * list , TRI_voc_tid_t search ) { <nl> <nl> else if ( n < 16 ) { <nl> / / list is small : use a linear search <nl> - size_t i ; <nl> - <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_voc_tid_t * tid = TRI_AtVector ( list , i ) ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_voc_tid_t * tid = static_cast < TRI_voc_tid_t * > ( TRI_AtVector ( list , i ) ) ; <nl> <nl> if ( * tid = = search ) { <nl> return true ; <nl> static bool InFailedList ( TRI_vector_t const * list , TRI_voc_tid_t search ) { <nl> <nl> while ( true ) { <nl> / / determine midpoint <nl> - TRI_voc_tid_t * tid ; <nl> size_t m ; <nl> <nl> m = l + ( ( r - l ) / 2 ) ; <nl> - tid = TRI_AtVector ( list , m ) ; <nl> + TRI_voc_tid_t * tid = static_cast < TRI_voc_tid_t * > ( TRI_AtVector ( list , m ) ) ; <nl> <nl> if ( * tid = = search ) { <nl> return true ; <nl> int TRI_InitDumpReplication ( TRI_replication_dump_t * dump , <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> void TRI_DestroyDumpReplication ( TRI_replication_dump_t * dump ) { <nl> - size_t i ; <nl> - <nl> - for ( i = 0 ; i < dump - > _collectionNames . _nrAlloc ; + + i ) { <nl> - resolved_name_t * found = dump - > _collectionNames . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < dump - > _collectionNames . _nrAlloc ; + + i ) { <nl> + resolved_name_t * found = static_cast < resolved_name_t * > ( dump - > _collectionNames . _table [ i ] ) ; <nl> <nl> if ( found ! = NULL ) { <nl> if ( found - > _name ! = NULL ) { <nl> similarity index 97 % <nl> rename from arangod / VocBase / replication - logger . c <nl> rename to arangod / VocBase / replication - logger . cpp <nl> mmm a / arangod / VocBase / replication - logger . c <nl> ppp b / arangod / VocBase / replication - logger . cpp <nl> logger_client_t ; <nl> <nl> static uint64_t HashKeyClient ( TRI_associative_pointer_t * array , <nl> void const * key ) { <nl> - TRI_server_id_t const * k = key ; <nl> + TRI_server_id_t const * k = static_cast < TRI_server_id_t const * > ( key ) ; <nl> <nl> return ( uint64_t ) * k ; <nl> } <nl> static uint64_t HashKeyClient ( TRI_associative_pointer_t * array , <nl> <nl> static uint64_t HashElementClient ( TRI_associative_pointer_t * array , <nl> void const * element ) { <nl> - logger_client_t const * e = element ; <nl> + logger_client_t const * e = static_cast < logger_client_t const * > ( element ) ; <nl> <nl> return ( uint64_t ) e - > _serverId ; <nl> } <nl> static uint64_t HashElementClient ( TRI_associative_pointer_t * array , <nl> static bool IsEqualKeyClient ( TRI_associative_pointer_t * array , <nl> void const * key , <nl> void const * element ) { <nl> - TRI_server_id_t const * k = key ; <nl> - logger_client_t const * e = element ; <nl> + TRI_server_id_t const * k = static_cast < TRI_server_id_t const * > ( key ) ; <nl> + logger_client_t const * e = static_cast < logger_client_t const * > ( element ) ; <nl> <nl> return * k = = e - > _serverId ; <nl> } <nl> static void FreeClients ( TRI_replication_logger_t * logger ) { <nl> n = logger - > _clients . _nrAlloc ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - logger_client_t * client = logger - > _clients . _table [ i ] ; <nl> + logger_client_t * client = static_cast < logger_client_t * > ( logger - > _clients . _table [ i ] ) ; <nl> <nl> if ( client ! = NULL ) { <nl> FreeClient ( client ) ; <nl> static bool CreateCap ( TRI_replication_logger_t * logger ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static TRI_string_buffer_t * GetBuffer ( TRI_replication_logger_t * logger ) { <nl> - TRI_string_buffer_t * buffer ; <nl> size_t n ; <nl> <nl> assert ( logger ! = NULL ) ; <nl> - buffer = NULL ; <nl> + TRI_string_buffer_t * buffer = NULL ; <nl> <nl> / / locked section <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> static TRI_string_buffer_t * GetBuffer ( TRI_replication_logger_t * logger ) { <nl> n = logger - > _buffers . _length ; <nl> <nl> if ( n > 0 ) { <nl> - buffer = TRI_RemoveVectorPointer ( & logger - > _buffers , ( size_t ) ( n - 1 ) ) ; <nl> + buffer = static_cast < TRI_string_buffer_t * > ( TRI_RemoveVectorPointer ( & logger - > _buffers , ( size_t ) ( n - 1 ) ) ) ; <nl> } <nl> <nl> TRI_UnlockSpin ( & logger - > _bufferLock ) ; <nl> static int LogEvent ( TRI_replication_logger_t * logger , <nl> <nl> TRI_Insert4ArrayJson ( TRI_CORE_MEM_ZONE , <nl> & json , <nl> - " type " , <nl> + ( char * ) " type " , <nl> 4 , / / strlen ( " type " ) <nl> & typeAttribute , <nl> true ) ; <nl> static int LogEvent ( TRI_replication_logger_t * logger , <nl> <nl> TRI_Insert4ArrayJson ( TRI_CORE_MEM_ZONE , <nl> & json , <nl> - " tid " , <nl> + ( char * ) " tid " , <nl> 3 , / / strlen ( " tid " ) <nl> & tidAttribute , <nl> true ) ; <nl> static int LogEvent ( TRI_replication_logger_t * logger , <nl> <nl> TRI_Insert4ArrayJson ( TRI_CORE_MEM_ZONE , <nl> & json , <nl> - " data " , <nl> + ( char * ) " data " , <nl> 4 , / / strlen ( " data " ) <nl> & dataAttribute , <nl> true ) ; <nl> static bool StringifyMetaTransaction ( TRI_string_buffer_t * buffer , <nl> n = trx - > _collections . _length ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_transaction_collection_t * trxCollection ; <nl> TRI_document_collection_t * document ; <nl> <nl> - trxCollection = TRI_AtVectorPointer ( & trx - > _collections , i ) ; <nl> + TRI_transaction_collection_t * trxCollection = static_cast < TRI_transaction_collection_t * > ( TRI_AtVectorPointer ( & trx - > _collections , i ) ) ; <nl> <nl> if ( trxCollection - > _operations = = NULL ) { <nl> / / no markers available for collection <nl> static bool HasRelevantOperations ( TRI_transaction_t const * trx ) { <nl> n = trx - > _collections . _length ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_transaction_collection_t * trxCollection ; <nl> - <nl> - trxCollection = TRI_AtVectorPointer ( & trx - > _collections , i ) ; <nl> + TRI_transaction_collection_t * trxCollection = static_cast < TRI_transaction_collection_t * > ( TRI_AtVectorPointer ( & trx - > _collections , i ) ) ; <nl> assert ( trxCollection ! = NULL ) ; <nl> <nl> if ( trxCollection - > _operations = = NULL | | <nl> static int HandleTransaction ( TRI_replication_logger_t * logger , <nl> assert ( n > 0 ) ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_transaction_collection_t * trxCollection ; <nl> TRI_document_collection_t * document ; <nl> size_t j , k ; <nl> <nl> - trxCollection = TRI_AtVectorPointer ( & trx - > _collections , i ) ; <nl> + TRI_transaction_collection_t * trxCollection = static_cast < TRI_transaction_collection_t * > ( TRI_AtVectorPointer ( & trx - > _collections , i ) ) ; <nl> <nl> if ( trxCollection - > _operations = = NULL ) { <nl> / / no markers available for collection <nl> static int HandleTransaction ( TRI_replication_logger_t * logger , <nl> assert ( k > 0 ) ; <nl> <nl> for ( j = 0 ; j < k ; + + j ) { <nl> - TRI_transaction_operation_t * trxOperation ; <nl> TRI_replication_operation_e type ; <nl> <nl> - trxOperation = TRI_AtVector ( trxCollection - > _operations , j ) ; <nl> + TRI_transaction_operation_t * trxOperation = static_cast < TRI_transaction_operation_t * > ( TRI_AtVector ( trxCollection - > _operations , j ) ) ; <nl> <nl> buffer = GetBuffer ( logger ) ; <nl> <nl> static char * GetConfigurationFilename ( TRI_vocbase_t * vocbase ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> TRI_replication_logger_t * TRI_CreateReplicationLogger ( TRI_vocbase_t * vocbase ) { <nl> - TRI_replication_logger_t * logger ; <nl> - char * filename ; <nl> - int res ; <nl> - <nl> - logger = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_replication_logger_t ) , false ) ; <nl> + TRI_replication_logger_t * logger = static_cast < TRI_replication_logger_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_replication_logger_t ) , false ) ) ; <nl> <nl> if ( logger = = NULL ) { <nl> return NULL ; <nl> } <nl> <nl> / / init string buffers <nl> - res = InitBuffers ( logger ) ; <nl> + int res = InitBuffers ( logger ) ; <nl> <nl> if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> / / out of memory <nl> TRI_replication_logger_t * TRI_CreateReplicationLogger ( TRI_vocbase_t * vocbase ) { <nl> assert ( logger - > _databaseName ! = NULL ) ; <nl> <nl> / / check if there is a configuration file to load <nl> - filename = GetConfigurationFilename ( vocbase ) ; <nl> + char * filename = GetConfigurationFilename ( vocbase ) ; <nl> <nl> if ( filename ! = NULL ) { <nl> LOG_TRACE ( " looking for replication logger configuration in ' % s ' " , filename ) ; <nl> TRI_json_t * TRI_JsonClientsReplicationLogger ( TRI_replication_logger_t * logger ) <nl> n = logger - > _clients . _nrAlloc ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - logger_client_t * client = logger - > _clients . _table [ i ] ; <nl> + logger_client_t * client = static_cast < logger_client_t * > ( logger - > _clients . _table [ i ] ) ; <nl> <nl> if ( client ! = NULL ) { <nl> TRI_json_t * element = TRI_CreateArrayJson ( TRI_CORE_MEM_ZONE ) ; <nl> void TRI_UpdateClientReplicationLogger ( TRI_replication_logger_t * logger , <nl> TRI_server_id_t serverId , <nl> TRI_voc_tick_t lastServedTick ) { <nl> <nl> - logger_client_t * client ; <nl> - void * found ; <nl> - <nl> - client = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( logger_client_t ) , false ) ; <nl> + logger_client_t * client = static_cast < logger_client_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( logger_client_t ) , false ) ) ; <nl> <nl> if ( client = = NULL ) { <nl> return ; <nl> void TRI_UpdateClientReplicationLogger ( TRI_replication_logger_t * logger , <nl> <nl> TRI_WriteLockReadWriteLock ( & logger - > _clientsLock ) ; <nl> <nl> - found = TRI_RemoveKeyAssociativePointer ( & logger - > _clients , & client - > _serverId ) ; <nl> + void * found = TRI_RemoveKeyAssociativePointer ( & logger - > _clients , & client - > _serverId ) ; <nl> <nl> if ( found ! = NULL ) { <nl> FreeClient ( ( logger_client_t * ) found ) ; <nl> similarity index 100 % <nl> rename from arangod / VocBase / replication - master . c <nl> rename to arangod / VocBase / replication - master . cpp <nl> similarity index 96 % <nl> rename from arangod / VocBase / server . c <nl> rename to arangod / VocBase / server . cpp <nl> mmm a / arangod / VocBase / server . c <nl> ppp b / arangod / VocBase / server . cpp <nl> <nl> # include " VocBase / replication - logger . h " <nl> # include " VocBase / vocbase . h " <nl> <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + / / - - SECTION - - public variables <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> + <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + / / / @ brief page size <nl> + / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> + <nl> + size_t PageSize ; <nl> + <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / - - SECTION - - private defines <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> / / - - SECTION - - private variables <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief page size <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - size_t PageSize ; <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief random server identifier ( 16 bit ) <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> static TRI_server_id_t ServerId ; <nl> <nl> static uint64_t HashElementDatabaseName ( TRI_associative_pointer_t * array , <nl> void const * element ) { <nl> - TRI_vocbase_t const * e = element ; <nl> + TRI_vocbase_t const * e = static_cast < TRI_vocbase_t const * > ( element ) ; <nl> <nl> return TRI_FnvHashString ( ( char const * ) e - > _name ) ; <nl> } <nl> static uint64_t HashElementDatabaseName ( TRI_associative_pointer_t * array , <nl> static bool EqualKeyDatabaseName ( TRI_associative_pointer_t * array , <nl> void const * key , <nl> void const * element ) { <nl> - char const * k = ( char const * ) key ; <nl> - TRI_vocbase_t const * e = element ; <nl> + char const * k = static_cast < char const * > ( key ) ; <nl> + TRI_vocbase_t const * e = static_cast < TRI_vocbase_t const * > ( element ) ; <nl> <nl> return TRI_EqualString ( k , e - > _name ) ; <nl> } <nl> static int OpenDatabases ( TRI_server_t * server , <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static int CloseDatabases ( TRI_server_t * server ) { <nl> - size_t i , n ; <nl> + size_t n ; <nl> <nl> WRITE_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> n = server - > _databases . _nrAlloc ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = server - > _databases . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _databases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> assert ( vocbase - > _type = = TRI_VOCBASE_TYPE_NORMAL ) ; <nl> static int CloseDatabases ( TRI_server_t * server ) { <nl> # ifdef TRI_ENABLE_CLUSTER <nl> n = server - > _coordinatorDatabases . _nrAlloc ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = server - > _coordinatorDatabases . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _coordinatorDatabases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> assert ( vocbase - > _type = = TRI_VOCBASE_TYPE_COORDINATOR ) ; <nl> static int InitDatabases ( TRI_server_t * server , <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static void DatabaseManager ( void * data ) { <nl> - TRI_server_t * server ; <nl> bool shutdown ; <nl> <nl> - server = data ; <nl> + TRI_server_t * server = static_cast < TRI_server_t * > ( data ) ; <nl> <nl> while ( true ) { <nl> TRI_vocbase_t * database ; <nl> - size_t i , n ; <nl> <nl> TRI_LockMutex ( & server - > _createLock ) ; <nl> shutdown = server - > _shutdown ; <nl> static void DatabaseManager ( void * data ) { <nl> <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> - n = server - > _droppedDatabases . _length ; <nl> + size_t const n = server - > _droppedDatabases . _length ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = TRI_AtVectorPointer ( & server - > _droppedDatabases , i ) ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_AtVectorPointer ( & server - > _droppedDatabases , i ) ) ; <nl> <nl> if ( ! TRI_CanRemoveVocBase ( vocbase ) ) { <nl> continue ; <nl> static void DatabaseManager ( void * data ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> TRI_server_t * TRI_CreateServer ( ) { <nl> - TRI_server_t * server ; <nl> - <nl> - server = TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_server_t ) , true ) ; <nl> - <nl> - return server ; <nl> + return static_cast < TRI_server_t * > ( TRI_Allocate ( TRI_CORE_MEM_ZONE , sizeof ( TRI_server_t ) , true ) ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> int TRI_CreateCoordinatorDatabaseServer ( TRI_server_t * server , <nl> char const * name , <nl> TRI_vocbase_defaults_t const * defaults , <nl> TRI_vocbase_t * * database ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - int res ; <nl> - <nl> if ( ! TRI_IsAllowedNameVocBase ( true , name ) ) { <nl> return TRI_ERROR_ARANGO_DATABASE_NAME_INVALID ; <nl> } <nl> int TRI_CreateCoordinatorDatabaseServer ( TRI_server_t * server , <nl> <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> - vocbase = TRI_LookupByKeyAssociativePointer ( & server - > _coordinatorDatabases , name ) ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_LookupByKeyAssociativePointer ( & server - > _coordinatorDatabases , name ) ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> / / name already in use <nl> int TRI_CreateCoordinatorDatabaseServer ( TRI_server_t * server , <nl> TRI_UnlockMutex ( & server - > _createLock ) ; <nl> <nl> / / grab last error <nl> - res = TRI_errno ( ) ; <nl> + int res = TRI_errno ( ) ; <nl> <nl> if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> / / but we must have an error . . . <nl> int TRI_CreateDatabaseServer ( TRI_server_t * server , <nl> char const * name , <nl> TRI_vocbase_defaults_t const * defaults , <nl> TRI_vocbase_t * * database ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - TRI_voc_tick_t tick ; <nl> char * file ; <nl> char * path ; <nl> - int res ; <nl> <nl> if ( ! TRI_IsAllowedNameVocBase ( false , name ) ) { <nl> return TRI_ERROR_ARANGO_DATABASE_NAME_INVALID ; <nl> int TRI_CreateDatabaseServer ( TRI_server_t * server , <nl> <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> - vocbase = TRI_LookupByKeyAssociativePointer ( & server - > _databases , name ) ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_LookupByKeyAssociativePointer ( & server - > _databases , name ) ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> / / name already in use <nl> int TRI_CreateDatabaseServer ( TRI_server_t * server , <nl> READ_UNLOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> / / create the database directory <nl> - tick = TRI_NewTickServer ( ) ; <nl> - res = CreateDatabaseDirectory ( server , tick , name , defaults , & file ) ; <nl> + TRI_voc_tick_t tick = TRI_NewTickServer ( ) ; <nl> + int res = CreateDatabaseDirectory ( server , tick , name , defaults , & file ) ; <nl> <nl> if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> TRI_UnlockMutex ( & server - > _createLock ) ; <nl> TRI_voc_tick_t * TRI_GetIdsCoordinatorDatabaseServer ( TRI_server_t * server ) { <nl> TRI_vector_t v ; <nl> TRI_voc_tick_t * data ; <nl> TRI_voc_tick_t zero ; <nl> - size_t i , n ; <nl> <nl> TRI_InitVector ( & v , TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_voc_tick_t ) ) ; <nl> <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> - n = server - > _coordinatorDatabases . _nrAlloc ; <nl> + size_t const n = server - > _coordinatorDatabases . _nrAlloc ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = server - > _coordinatorDatabases . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _coordinatorDatabases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL & & <nl> ! TRI_EqualString ( vocbase - > _name , TRI_VOC_SYSTEM_DATABASE ) ) { <nl> TRI_voc_tick_t * TRI_GetIdsCoordinatorDatabaseServer ( TRI_server_t * server ) { <nl> <nl> READ_UNLOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> - / / append a 0 <nl> + / / append a 0 as the end marker <nl> zero = 0 ; <nl> TRI_PushBackVector ( & v , & zero ) ; <nl> <nl> TRI_voc_tick_t * TRI_GetIdsCoordinatorDatabaseServer ( TRI_server_t * server ) { <nl> int TRI_DropByIdCoordinatorDatabaseServer ( TRI_server_t * server , <nl> TRI_voc_tick_t id , <nl> bool force ) { <nl> - size_t i , n ; <nl> - int res ; <nl> - <nl> - res = TRI_ERROR_ARANGO_DATABASE_NOT_FOUND ; <nl> + int res = TRI_ERROR_ARANGO_DATABASE_NOT_FOUND ; <nl> <nl> WRITE_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> int TRI_DropByIdCoordinatorDatabaseServer ( TRI_server_t * server , <nl> return TRI_ERROR_OUT_OF_MEMORY ; <nl> } <nl> <nl> - n = server - > _coordinatorDatabases . _nrAlloc ; <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = server - > _coordinatorDatabases . _table [ i ] ; <nl> + size_t const n = server - > _coordinatorDatabases . _nrAlloc ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _coordinatorDatabases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL & & <nl> vocbase - > _id = = id & & <nl> int TRI_DropByIdCoordinatorDatabaseServer ( TRI_server_t * server , <nl> # ifdef TRI_ENABLE_CLUSTER <nl> int TRI_DropCoordinatorDatabaseServer ( TRI_server_t * server , <nl> char const * name ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - int res ; <nl> - <nl> if ( TRI_EqualString ( name , TRI_VOC_SYSTEM_DATABASE ) ) { <nl> / / prevent deletion of system database <nl> return TRI_ERROR_FORBIDDEN ; <nl> int TRI_DropCoordinatorDatabaseServer ( TRI_server_t * server , <nl> return TRI_ERROR_OUT_OF_MEMORY ; <nl> } <nl> <nl> - vocbase = TRI_RemoveKeyAssociativePointer ( & server - > _coordinatorDatabases , name ) ; <nl> + int res = TRI_ERROR_INTERNAL ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_RemoveKeyAssociativePointer ( & server - > _coordinatorDatabases , name ) ) ; <nl> <nl> if ( vocbase = = NULL ) { <nl> / / not found <nl> int TRI_DropCoordinatorDatabaseServer ( TRI_server_t * server , <nl> <nl> int TRI_DropDatabaseServer ( TRI_server_t * server , <nl> char const * name ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - int res ; <nl> - <nl> if ( TRI_EqualString ( name , TRI_VOC_SYSTEM_DATABASE ) ) { <nl> / / prevent deletion of system database <nl> return TRI_ERROR_FORBIDDEN ; <nl> int TRI_DropDatabaseServer ( TRI_server_t * server , <nl> return TRI_ERROR_OUT_OF_MEMORY ; <nl> } <nl> <nl> - vocbase = TRI_RemoveKeyAssociativePointer ( & server - > _databases , name ) ; <nl> + int res = TRI_ERROR_INTERNAL ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_RemoveKeyAssociativePointer ( & server - > _databases , name ) ) ; <nl> <nl> if ( vocbase = = NULL ) { <nl> / / not found <nl> int TRI_DropDatabaseServer ( TRI_server_t * server , <nl> # ifdef TRI_ENABLE_CLUSTER <nl> TRI_vocbase_t * TRI_UseByIdCoordinatorDatabaseServer ( TRI_server_t * server , <nl> TRI_voc_tick_t id ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - size_t i , n ; <nl> - <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> - n = server - > _coordinatorDatabases . _nrAlloc ; <nl> + size_t const n = server - > _coordinatorDatabases . _nrAlloc ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - vocbase = server - > _coordinatorDatabases . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _coordinatorDatabases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL & & vocbase - > _id = = id ) { <nl> bool result = TRI_UseVocBase ( vocbase ) ; <nl> TRI_vocbase_t * TRI_UseByIdCoordinatorDatabaseServer ( TRI_server_t * server , <nl> # ifdef TRI_ENABLE_CLUSTER <nl> TRI_vocbase_t * TRI_UseCoordinatorDatabaseServer ( TRI_server_t * server , <nl> char const * name ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> - vocbase = TRI_LookupByKeyAssociativePointer ( & server - > _coordinatorDatabases , name ) ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_LookupByKeyAssociativePointer ( & server - > _coordinatorDatabases , name ) ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> bool result = TRI_UseVocBase ( vocbase ) ; <nl> TRI_vocbase_t * TRI_UseCoordinatorDatabaseServer ( TRI_server_t * server , <nl> <nl> TRI_vocbase_t * TRI_UseDatabaseServer ( TRI_server_t * server , <nl> char const * name ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> <nl> - vocbase = TRI_LookupByKeyAssociativePointer ( & server - > _databases , name ) ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_LookupByKeyAssociativePointer ( & server - > _databases , name ) ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> bool result = TRI_UseVocBase ( vocbase ) ; <nl> int TRI_GetUserDatabasesServer ( TRI_server_t * server , <nl> char const * password , <nl> TRI_vector_string_t * names ) { <nl> <nl> - size_t i , n ; <nl> - int res ; <nl> - <nl> - res = TRI_ERROR_NO_ERROR ; <nl> + int res = TRI_ERROR_NO_ERROR ; <nl> <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> - n = server - > _databases . _nrAlloc ; <nl> + size_t const n = server - > _databases . _nrAlloc ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = server - > _databases . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _databases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> char * copy ; <nl> int TRI_GetUserDatabasesServer ( TRI_server_t * server , <nl> int TRI_GetDatabaseNamesServer ( TRI_server_t * server , <nl> TRI_vector_string_t * names ) { <nl> <nl> - size_t i , n ; <nl> - int res ; <nl> - <nl> - res = TRI_ERROR_NO_ERROR ; <nl> + int res = TRI_ERROR_NO_ERROR ; <nl> <nl> READ_LOCK_DATABASES ( server - > _databasesLock ) ; <nl> - n = server - > _databases . _nrAlloc ; <nl> + size_t const n = server - > _databases . _nrAlloc ; <nl> <nl> - for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_t * vocbase = server - > _databases . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < n ; + + i ) { <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( server - > _databases . _table [ i ] ) ; <nl> <nl> if ( vocbase ! = NULL ) { <nl> char * copy ; <nl> similarity index 95 % <nl> rename from arangod / VocBase / synchroniser . c <nl> rename to arangod / VocBase / synchroniser . cpp <nl> mmm a / arangod / VocBase / synchroniser . c <nl> ppp b / arangod / VocBase / synchroniser . cpp <nl> static bool CheckSyncDocumentCollection ( TRI_document_collection_t * document ) { <nl> n = base - > _journals . _length ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - journal = base - > _journals . _buffer [ i ] ; <nl> + journal = static_cast < TRI_datafile_t * > ( base - > _journals . _buffer [ i ] ) ; <nl> <nl> / / we only need to care about physical datafiles <nl> if ( ! journal - > isPhysical ( journal ) ) { <nl> static bool CheckJournalDocumentCollection ( TRI_document_collection_t * document ) <nl> n = base - > _journals . _length ; <nl> <nl> for ( i = 0 ; i < n ; ) { <nl> - journal = base - > _journals . _buffer [ i ] ; <nl> + journal = static_cast < TRI_datafile_t * > ( base - > _journals . _buffer [ i ] ) ; <nl> <nl> if ( journal - > _full ) { <nl> worked = true ; <nl> static bool CheckJournalDocumentCollection ( TRI_document_collection_t * document ) <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> void TRI_SynchroniserVocBase ( void * data ) { <nl> - TRI_vocbase_t * vocbase = data ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( data ) ; <nl> TRI_vector_pointer_t collections ; <nl> <nl> assert ( vocbase - > _state = = 1 ) ; <nl> void TRI_SynchroniserVocBase ( void * data ) { <nl> n = collections . _length ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_col_t * collection ; <nl> - TRI_primary_collection_t * primary ; <nl> - bool result ; <nl> - <nl> - collection = collections . _buffer [ i ] ; <nl> + TRI_vocbase_col_t * collection = static_cast < TRI_vocbase_col_t * > ( collections . _buffer [ i ] ) ; <nl> <nl> / / if we cannot acquire the read lock instantly , we will continue . <nl> / / otherwise we ' ll risk a multi - thread deadlock between synchroniser , <nl> void TRI_SynchroniserVocBase ( void * data ) { <nl> continue ; <nl> } <nl> <nl> - primary = collection - > _collection ; <nl> + TRI_primary_collection_t * primary = collection - > _collection ; <nl> <nl> / / for document collection , first sync and then seal <nl> - result = CheckSyncDocumentCollection ( ( TRI_document_collection_t * ) primary ) ; <nl> + bool result = CheckSyncDocumentCollection ( ( TRI_document_collection_t * ) primary ) ; <nl> worked | = result ; <nl> <nl> result = CheckJournalDocumentCollection ( ( TRI_document_collection_t * ) primary ) ; <nl> similarity index 95 % <nl> rename from arangod / VocBase / voc - shaper . c <nl> rename to arangod / VocBase / voc - shaper . cpp <nl> mmm a / arangod / VocBase / voc - shaper . c <nl> ppp b / arangod / VocBase / voc - shaper . cpp <nl> static void SetAttributeWeight ( voc_shaper_t * shaper , <nl> / / in the associative array . We need to pass this pointer to the Vector Pointer <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - item = TRI_LookupByKeyAssociativePointer ( & ( shaper - > _weightedAttributes ) , & ( item - > _aid ) ) ; <nl> + item = static_cast < attribute_weight_t * > ( TRI_LookupByKeyAssociativePointer ( & ( shaper - > _weightedAttributes ) , & ( item - > _aid ) ) ) ; <nl> <nl> if ( item = = NULL ) { <nl> LOG_ERROR ( " attribute weight could not be located immediately after insert into associative array " ) ; <nl> static TRI_shape_aid_t FindOrCreateAttributeByName ( TRI_shaper_t * shaper , <nl> void * f ; <nl> int64_t searchResult ; <nl> bool weighted ; <nl> - attribute_weight_t * weightedAttribute ; <nl> <nl> assert ( name ! = NULL ) ; <nl> <nl> static TRI_shape_aid_t FindOrCreateAttributeByName ( TRI_shaper_t * shaper , <nl> <nl> markerResult = ( TRI_df_attribute_marker_t * ) result ; <nl> <nl> - weightedAttribute = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( attribute_weight_t ) , false ) ; <nl> + attribute_weight_t * weightedAttribute = static_cast < attribute_weight_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( attribute_weight_t ) , false ) ) ; <nl> <nl> if ( weightedAttribute ! = NULL ) { <nl> weightedAttribute - > _aid = markerResult - > _aid ; <nl> static TRI_shape_aid_t FindOrCreateAttributeByName ( TRI_shaper_t * shaper , <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashKeyAttributeId ( TRI_associative_synced_t * array , void const * key ) { <nl> - TRI_shape_aid_t const * k = key ; <nl> + TRI_shape_aid_t const * k = static_cast < TRI_shape_aid_t const * > ( key ) ; <nl> <nl> return TRI_FnvHashPointer ( k , sizeof ( TRI_shape_aid_t ) ) ; <nl> } <nl> static uint64_t HashKeyAttributeId ( TRI_associative_synced_t * array , void const * <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashElementAttributeId ( TRI_associative_synced_t * array , void const * element ) { <nl> - TRI_df_attribute_marker_t const * e = element ; <nl> + TRI_df_attribute_marker_t const * e = static_cast < TRI_df_attribute_marker_t const * > ( element ) ; <nl> <nl> return TRI_FnvHashPointer ( & e - > _aid , sizeof ( TRI_shape_aid_t ) ) ; <nl> } <nl> static uint64_t HashElementAttributeId ( TRI_associative_synced_t * array , void co <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static bool EqualKeyAttributeId ( TRI_associative_synced_t * array , void const * key , void const * element ) { <nl> - TRI_shape_aid_t const * k = key ; <nl> - TRI_df_attribute_marker_t const * e = element ; <nl> + TRI_shape_aid_t const * k = static_cast < TRI_shape_aid_t const * > ( key ) ; <nl> + TRI_df_attribute_marker_t const * e = static_cast < TRI_df_attribute_marker_t const * > ( element ) ; <nl> <nl> return * k = = e - > _aid ; <nl> } <nl> static bool EqualKeyAttributeId ( TRI_associative_synced_t * array , void const * ke <nl> / / / @ brief looks up an attribute name by identifier <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - static char const * LookupAttributeId ( TRI_shaper_t * shaper , TRI_shape_aid_t aid ) { <nl> + static char const * LookupAttributeId ( TRI_shaper_t * shaper , <nl> + TRI_shape_aid_t aid ) { <nl> voc_shaper_t * s = ( voc_shaper_t * ) shaper ; <nl> - void const * p ; <nl> <nl> - p = TRI_LookupByKeyAssociativeSynced ( & s - > _attributeIds , & aid ) ; <nl> + void const * p = TRI_LookupByKeyAssociativeSynced ( & s - > _attributeIds , & aid ) ; <nl> <nl> if ( p = = NULL ) { <nl> return NULL ; <nl> } <nl> - else { <nl> - char const * a ; <nl> <nl> - a = p ; <nl> - return a + sizeof ( TRI_df_attribute_marker_t ) ; <nl> - } <nl> + return static_cast < char const * > ( p ) + sizeof ( TRI_df_attribute_marker_t ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief looks up an attribute weight by identifier <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - static int64_t LookupAttributeWeight ( TRI_shaper_t * shaper , TRI_shape_aid_t aid ) { <nl> + static int64_t LookupAttributeWeight ( TRI_shaper_t * shaper , <nl> + TRI_shape_aid_t aid ) { <nl> voc_shaper_t * s = ( voc_shaper_t * ) shaper ; <nl> const attribute_weight_t * item ; <nl> <nl> static int64_t LookupAttributeWeight ( TRI_shaper_t * shaper , TRI_shape_aid_t aid ) <nl> / / / @ brief hashes the shapes <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - static uint64_t HashElementShape ( TRI_associative_synced_t * array , void const * element ) { <nl> - char const * e = element ; <nl> - TRI_shape_t const * ee = element ; <nl> + static uint64_t HashElementShape ( TRI_associative_synced_t * array , <nl> + void const * element ) { <nl> + char const * e = static_cast < char const * > ( element ) ; <nl> + TRI_shape_t const * ee = static_cast < TRI_shape_t const * > ( element ) ; <nl> <nl> return TRI_FnvHashPointer ( e + + sizeof ( TRI_shape_sid_t ) , ee - > _size - sizeof ( TRI_shape_sid_t ) ) ; <nl> } <nl> static uint64_t HashElementShape ( TRI_associative_synced_t * array , void const * e <nl> / / / @ brief compares shapes <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - static bool EqualElementShape ( TRI_associative_synced_t * array , void const * left , void const * right ) { <nl> - char const * l = left ; <nl> - char const * r = right ; <nl> + static bool EqualElementShape ( TRI_associative_synced_t * array , <nl> + void const * left , <nl> + void const * right ) { <nl> + char const * l = static_cast < char const * > ( left ) ; <nl> + char const * r = static_cast < char const * > ( right ) ; <nl> <nl> - TRI_shape_t const * ll = left ; <nl> - TRI_shape_t const * rr = right ; <nl> + TRI_shape_t const * ll = static_cast < TRI_shape_t const * > ( left ) ; <nl> + TRI_shape_t const * rr = static_cast < TRI_shape_t const * > ( right ) ; <nl> <nl> return ( ll - > _size = = rr - > _size ) <nl> & & memcmp ( l + sizeof ( TRI_shape_sid_t ) , <nl> static TRI_shape_t const * FindShape ( TRI_shaper_t * shaper , <nl> found = TRI_LookupBasicShapeShaper ( shape ) ; <nl> <nl> if ( found = = NULL ) { <nl> - found = TRI_LookupByElementAssociativeSynced ( & s - > _shapeDictionary , shape ) ; <nl> + found = static_cast < TRI_shape_t const * > ( TRI_LookupByElementAssociativeSynced ( & s - > _shapeDictionary , shape ) ) ; <nl> } <nl> <nl> / / shape found , free argument and return <nl> static TRI_shape_t const * FindShape ( TRI_shaper_t * shaper , <nl> / / lock the index and check the element is still missing <nl> TRI_LockMutex ( & s - > _shapeLock ) ; <nl> <nl> - found = TRI_LookupByElementAssociativeSynced ( & s - > _shapeDictionary , shape ) ; <nl> + found = static_cast < TRI_shape_t const * > ( TRI_LookupByElementAssociativeSynced ( & s - > _shapeDictionary , shape ) ) ; <nl> <nl> if ( found ! = 0 ) { <nl> TRI_UnlockMutex ( & s - > _shapeLock ) ; <nl> static int CompareShapeTypeJsonArrayHelper ( const TRI_shape_t * shape , <nl> / / Allocate memory to hold the attribute information required for comparison <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - * attributeArray = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , ( sizeof ( weighted_attribute_t ) * ( fixedEntries + variableEntries ) ) , false ) ; <nl> + * attributeArray = static_cast < weighted_attribute_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , ( sizeof ( weighted_attribute_t ) * ( fixedEntries + variableEntries ) ) , false ) ) ; <nl> <nl> if ( * attributeArray = = NULL ) { <nl> return - 1 ; <nl> static int CompareShapeTypeJsonArrayHelper ( const TRI_shape_t * shape , <nl> <nl> static uint64_t HashKeyShapeId ( TRI_associative_synced_t * array , <nl> void const * key ) { <nl> - TRI_shape_sid_t const * k = key ; <nl> + TRI_shape_sid_t const * k = static_cast < TRI_shape_sid_t const * > ( key ) ; <nl> <nl> return TRI_FnvHashPointer ( k , sizeof ( TRI_shape_sid_t ) ) ; <nl> } <nl> static uint64_t HashKeyShapeId ( TRI_associative_synced_t * array , <nl> <nl> static uint64_t HashElementShapeId ( TRI_associative_synced_t * array , <nl> void const * element ) { <nl> - TRI_shape_t const * e = element ; <nl> + TRI_shape_t const * e = static_cast < TRI_shape_t const * > ( element ) ; <nl> <nl> return TRI_FnvHashPointer ( & e - > _sid , sizeof ( TRI_shape_sid_t ) ) ; <nl> } <nl> static uint64_t HashElementShapeId ( TRI_associative_synced_t * array , <nl> static bool EqualKeyShapeId ( TRI_associative_synced_t * array , <nl> void const * key , <nl> void const * element ) { <nl> - TRI_shape_sid_t const * k = key ; <nl> - TRI_shape_t const * e = element ; <nl> + TRI_shape_sid_t const * k = static_cast < TRI_shape_sid_t const * > ( key ) ; <nl> + TRI_shape_t const * e = static_cast < TRI_shape_t const * > ( element ) ; <nl> <nl> return * k = = e - > _sid ; <nl> } <nl> static TRI_shape_t const * LookupShapeId ( TRI_shaper_t * shaper , <nl> <nl> if ( shape = = NULL ) { <nl> voc_shaper_t * s = ( voc_shaper_t * ) shaper ; <nl> - shape = TRI_LookupByKeyAssociativeSynced ( & s - > _shapeIds , & sid ) ; <nl> + shape = static_cast < TRI_shape_t const * > ( TRI_LookupByKeyAssociativeSynced ( & s - > _shapeIds , & sid ) ) ; <nl> } <nl> <nl> return shape ; <nl> static TRI_shape_t const * LookupShapeId ( TRI_shaper_t * shaper , <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashElementAccessor ( TRI_associative_pointer_t * array , void const * element ) { <nl> - TRI_shape_access_t const * ee = element ; <nl> + TRI_shape_access_t const * ee = static_cast < TRI_shape_access_t const * > ( element ) ; <nl> uint64_t v [ 2 ] ; <nl> <nl> v [ 0 ] = ee - > _sid ; <nl> static uint64_t HashElementAccessor ( TRI_associative_pointer_t * array , void cons <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static bool EqualElementAccessor ( TRI_associative_pointer_t * array , void const * left , void const * right ) { <nl> - TRI_shape_access_t const * ll = left ; <nl> - TRI_shape_access_t const * rr = right ; <nl> + TRI_shape_access_t const * ll = static_cast < TRI_shape_access_t const * > ( left ) ; <nl> + TRI_shape_access_t const * rr = static_cast < TRI_shape_access_t const * > ( right ) ; <nl> <nl> return ll - > _sid = = rr - > _sid & & ll - > _pid = = rr - > _pid ; <nl> } <nl> <nl> - <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> / / / @ brief Hashes a weighted attribute <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> static int InitStep3VocShaper ( voc_shaper_t * shaper ) { <nl> <nl> TRI_shaper_t * TRI_CreateVocShaper ( TRI_vocbase_t * vocbase , <nl> TRI_document_collection_t * document ) { <nl> - voc_shaper_t * shaper ; <nl> - int res ; <nl> - <nl> - shaper = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( voc_shaper_t ) , false ) ; <nl> + voc_shaper_t * shaper = static_cast < voc_shaper_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( voc_shaper_t ) , false ) ) ; <nl> <nl> if ( shaper = = NULL ) { <nl> / / out of memory <nl> TRI_shaper_t * TRI_CreateVocShaper ( TRI_vocbase_t * vocbase , <nl> <nl> shaper - > _collection = document ; <nl> <nl> - res = TRI_InitShaper ( & shaper - > base , TRI_UNKNOWN_MEM_ZONE ) ; <nl> + int res = TRI_InitShaper ( & shaper - > base , TRI_UNKNOWN_MEM_ZONE ) ; <nl> <nl> if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> TRI_Free ( TRI_UNKNOWN_MEM_ZONE , shaper ) ; <nl> int TRI_InsertAttributeVocShaper ( TRI_shaper_t * s , <nl> TRI_df_attribute_marker_t * m = ( TRI_df_attribute_marker_t * ) marker ; <nl> char * p = ( ( char * ) m ) + sizeof ( TRI_df_attribute_marker_t ) ; <nl> void * f ; <nl> - attribute_weight_t * weightedAttribute ; <nl> <nl> LOG_TRACE ( " found attribute ' % s ' , aid : % lu " , p , ( unsigned long ) m - > _aid ) ; <nl> <nl> int TRI_InsertAttributeVocShaper ( TRI_shaper_t * s , <nl> / / have been loaded into memory . <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - weightedAttribute = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( attribute_weight_t ) , false ) ; <nl> + attribute_weight_t * weightedAttribute = static_cast < attribute_weight_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( attribute_weight_t ) , false ) ) ; <nl> <nl> if ( weightedAttribute ! = NULL ) { <nl> attribute_weight_t * result ; <nl> int TRI_InsertAttributeVocShaper ( TRI_shaper_t * s , <nl> result = ( attribute_weight_t * ) TRI_InsertKeyAssociativePointer ( & ( shaper - > _weightedAttributes ) , & ( weightedAttribute - > _aid ) , weightedAttribute , false ) ; <nl> <nl> if ( result = = NULL ) { <nl> - attribute_weight_t * weightedItem ; <nl> - <nl> - weightedItem = TRI_LookupByKeyAssociativePointer ( & ( shaper - > _weightedAttributes ) , & ( weightedAttribute - > _aid ) ) ; <nl> + attribute_weight_t * weightedItem = static_cast < attribute_weight_t * > ( TRI_LookupByKeyAssociativePointer ( & ( shaper - > _weightedAttributes ) , & ( weightedAttribute - > _aid ) ) ) ; <nl> <nl> if ( weightedItem = = NULL | | <nl> weightedItem - > _aid ! = weightedAttribute - > _aid ) { <nl> TRI_shape_access_t const * TRI_FindAccessorVocShaper ( TRI_shaper_t * s , <nl> voc_shaper_t * shaper = ( voc_shaper_t * ) s ; <nl> TRI_shape_access_t search ; <nl> TRI_shape_access_t * accessor ; <nl> - TRI_shape_access_t const * found ; <nl> <nl> search . _sid = sid ; <nl> search . _pid = pid ; <nl> <nl> - <nl> TRI_LockMutex ( & shaper - > _accessorLock ) ; <nl> - found = TRI_LookupByElementAssociativePointer ( & shaper - > _accessors , & search ) ; <nl> + TRI_shape_access_t const * found = static_cast < TRI_shape_access_t const * > ( TRI_LookupByElementAssociativePointer ( & shaper - > _accessors , & search ) ) ; <nl> <nl> if ( found = = NULL ) { <nl> found = accessor = TRI_ShapeAccessor ( & shaper - > base , sid , pid ) ; <nl> int TRI_CompareShapeTypes ( TRI_doc_mptr_t * leftDocument , <nl> <nl> left . _sid = leftObject - > _sid ; <nl> left . _data . length = leftObject - > _length ; <nl> - left . _data . data = CONST_CAST ( ptr + leftObject - > _offset ) ; <nl> + left . _data . data = const_cast < char * > ( ptr ) + leftObject - > _offset ; <nl> } <nl> else { <nl> left = * leftShaped ; <nl> int TRI_CompareShapeTypes ( TRI_doc_mptr_t * leftDocument , <nl> <nl> right . _sid = rightObject - > _sid ; <nl> right . _data . length = rightObject - > _length ; <nl> - right . _data . data = CONST_CAST ( ptr + rightObject - > _offset ) ; <nl> + right . _data . data = const_cast < char * > ( ptr ) + rightObject - > _offset ; <nl> } <nl> else { <nl> right = * rightShaped ; <nl> similarity index 96 % <nl> rename from arangod / VocBase / vocbase . c <nl> rename to arangod / VocBase / vocbase . cpp <nl> mmm a / arangod / VocBase / vocbase . c <nl> ppp b / arangod / VocBase / vocbase . cpp <nl> index_json_helper_t ; <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashKeyCid ( TRI_associative_pointer_t * array , void const * key ) { <nl> - TRI_voc_cid_t const * k = key ; <nl> + TRI_voc_cid_t const * k = static_cast < TRI_voc_cid_t const * > ( key ) ; <nl> <nl> return * k ; <nl> } <nl> static uint64_t HashKeyCid ( TRI_associative_pointer_t * array , void const * key ) { <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashElementCid ( TRI_associative_pointer_t * array , void const * element ) { <nl> - TRI_vocbase_col_t const * e = element ; <nl> + TRI_vocbase_col_t const * e = static_cast < TRI_vocbase_col_t const * > ( element ) ; <nl> <nl> return e - > _cid ; <nl> } <nl> static uint64_t HashElementCid ( TRI_associative_pointer_t * array , void const * el <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static bool EqualKeyCid ( TRI_associative_pointer_t * array , void const * key , void const * element ) { <nl> - TRI_voc_cid_t const * k = key ; <nl> - TRI_vocbase_col_t const * e = element ; <nl> + TRI_voc_cid_t const * k = static_cast < TRI_voc_cid_t const * > ( key ) ; <nl> + TRI_vocbase_col_t const * e = static_cast < TRI_vocbase_col_t const * > ( element ) ; <nl> <nl> return * k = = e - > _cid ; <nl> } <nl> static uint64_t HashKeyCollectionName ( TRI_associative_pointer_t * array , void co <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static uint64_t HashElementCollectionName ( TRI_associative_pointer_t * array , void const * element ) { <nl> - TRI_vocbase_col_t const * e = element ; <nl> + TRI_vocbase_col_t const * e = static_cast < TRI_vocbase_col_t const * > ( element ) ; <nl> char const * name = e - > _name ; <nl> <nl> return TRI_FnvHashString ( name ) ; <nl> static uint64_t HashElementCollectionName ( TRI_associative_pointer_t * array , voi <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> static bool EqualKeyCollectionName ( TRI_associative_pointer_t * array , void const * key , void const * element ) { <nl> - char const * k = ( char const * ) key ; <nl> - TRI_vocbase_col_t const * e = element ; <nl> + char const * k = static_cast < char const * > ( key ) ; <nl> + TRI_vocbase_col_t const * e = static_cast < TRI_vocbase_col_t const * > ( element ) ; <nl> <nl> return TRI_EqualString ( k , e - > _name ) ; <nl> } <nl> static bool UnloadCollectionCallback ( TRI_collection_t * col , void * data ) { <nl> static bool DropCollectionCallback ( TRI_collection_t * col , <nl> void * data ) { <nl> TRI_document_collection_t * document ; <nl> - TRI_vocbase_col_t * collection ; <nl> TRI_vocbase_t * vocbase ; <nl> regmatch_t matches [ 3 ] ; <nl> regex_t re ; <nl> int res ; <nl> - size_t i ; <nl> <nl> - collection = data ; <nl> + TRI_vocbase_col_t * collection = static_cast < TRI_vocbase_col_t * > ( data ) ; <nl> <nl> # ifdef _WIN32 <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> static bool DropCollectionCallback ( TRI_collection_t * col , <nl> <nl> TRI_WRITE_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> - for ( i = 0 ; i < vocbase - > _collections . _length ; + + i ) { <nl> + for ( size_t i = 0 ; i < vocbase - > _collections . _length ; + + i ) { <nl> if ( vocbase - > _collections . _buffer [ i ] = = collection ) { <nl> TRI_RemoveVectorPointer ( & vocbase - > _collections , i ) ; <nl> break ; <nl> static TRI_vocbase_col_t * AddCollection ( TRI_vocbase_t * vocbase , <nl> TRI_voc_cid_t cid , <nl> char const * path ) { <nl> void const * found ; <nl> - TRI_vocbase_col_t * collection ; <nl> int res ; <nl> <nl> / / create the init object <nl> static TRI_vocbase_col_t * AddCollection ( TRI_vocbase_t * vocbase , <nl> init . _path [ 0 ] = ' \ 0 ' ; <nl> } <nl> else { <nl> - TRI_CopyString ( init . _path , path , sizeof ( collection - > _path ) - 1 ) ; <nl> + TRI_CopyString ( init . _path , path , TRI_COL_PATH_LENGTH ) ; <nl> } <nl> <nl> / / create a new proxy <nl> - collection = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_vocbase_col_t ) , false ) ; <nl> + TRI_vocbase_col_t * collection = static_cast < TRI_vocbase_col_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_vocbase_col_t ) , false ) ) ; <nl> <nl> if ( collection = = NULL ) { <nl> TRI_set_errno ( TRI_ERROR_OUT_OF_MEMORY ) ; <nl> static int FilterCollectionIndex ( TRI_vocbase_col_t * collection , <nl> return TRI_ERROR_NO_ERROR ; <nl> } <nl> <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - / / - - SECTION - - public variables <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - / / / @ brief page size <nl> - / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> - <nl> - size_t PageSize ; <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / - - SECTION - - public functions <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> void TRI_FreeCollectionsVocBase ( TRI_vector_pointer_t * collections ) { <nl> n = TRI_LengthVectorPointer ( collections ) ; <nl> <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_col_t * c = TRI_AtVectorPointer ( collections , i ) ; <nl> + TRI_vocbase_col_t * c = static_cast < TRI_vocbase_col_t * > ( TRI_AtVectorPointer ( collections , i ) ) ; <nl> <nl> TRI_FreeCollectionVocBase ( c ) ; <nl> } <nl> TRI_vocbase_t * TRI_CreateInitialVocBase ( TRI_vocbase_type_e type , <nl> TRI_voc_tick_t id , <nl> char const * name , <nl> TRI_vocbase_defaults_t const * defaults ) { <nl> - TRI_vocbase_t * vocbase ; <nl> - <nl> - vocbase = TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_vocbase_t ) , false ) ; <nl> + TRI_vocbase_t * vocbase = static_cast < TRI_vocbase_t * > ( TRI_Allocate ( TRI_UNKNOWN_MEM_ZONE , sizeof ( TRI_vocbase_t ) , false ) ) ; <nl> <nl> if ( vocbase = = NULL ) { <nl> TRI_set_errno ( TRI_ERROR_OUT_OF_MEMORY ) ; <nl> void TRI_LoadAuthInfoVocBase ( TRI_vocbase_t * vocbase ) { <nl> <nl> TRI_vector_pointer_t TRI_CollectionsVocBase ( TRI_vocbase_t * vocbase ) { <nl> TRI_vector_pointer_t result ; <nl> - size_t i ; <nl> <nl> TRI_InitVectorPointer ( & result , TRI_UNKNOWN_MEM_ZONE ) ; <nl> <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> - for ( i = 0 ; i < vocbase - > _collectionsById . _nrAlloc ; + + i ) { <nl> - TRI_vocbase_col_t * found ; <nl> - <nl> - found = vocbase - > _collectionsById . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < vocbase - > _collectionsById . _nrAlloc ; + + i ) { <nl> + TRI_vocbase_col_t * found = static_cast < TRI_vocbase_col_t * > ( vocbase - > _collectionsById . _table [ i ] ) ; <nl> <nl> if ( found ! = NULL ) { <nl> TRI_PushBackVectorPointer ( & result , found ) ; <nl> TRI_vector_pointer_t TRI_CollectionsVocBase ( TRI_vocbase_t * vocbase ) { <nl> <nl> TRI_vector_string_t TRI_CollectionNamesVocBase ( TRI_vocbase_t * vocbase ) { <nl> TRI_vector_string_t result ; <nl> - size_t i ; <nl> <nl> TRI_InitVectorString ( & result , TRI_UNKNOWN_MEM_ZONE ) ; <nl> <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> - for ( i = 0 ; i < vocbase - > _collectionsById . _nrAlloc ; + + i ) { <nl> - TRI_vocbase_col_t * found ; <nl> - <nl> - found = vocbase - > _collectionsById . _table [ i ] ; <nl> + for ( size_t i = 0 ; i < vocbase - > _collectionsById . _nrAlloc ; + + i ) { <nl> + TRI_vocbase_col_t * found = static_cast < TRI_vocbase_col_t * > ( vocbase - > _collectionsById . _table [ i ] ) ; <nl> <nl> if ( found ! = NULL ) { <nl> char const * name = found - > _name ; <nl> TRI_json_t * TRI_InventoryCollectionsVocBase ( TRI_vocbase_t * vocbase , <nl> <nl> n = collections . _length ; <nl> for ( i = 0 ; i < n ; + + i ) { <nl> - TRI_vocbase_col_t * collection ; <nl> - TRI_json_t * result ; <nl> - <nl> - collection = TRI_AtVectorPointer ( & collections , i ) ; <nl> + TRI_vocbase_col_t * collection = static_cast < TRI_vocbase_col_t * > ( TRI_AtVectorPointer ( & collections , i ) ) ; <nl> <nl> TRI_READ_LOCK_STATUS_VOCBASE_COL ( collection ) ; <nl> <nl> TRI_json_t * TRI_InventoryCollectionsVocBase ( TRI_vocbase_t * vocbase , <nl> continue ; <nl> } <nl> <nl> - result = TRI_CreateArray2Json ( TRI_CORE_MEM_ZONE , 2 ) ; <nl> + TRI_json_t * result = TRI_CreateArray2Json ( TRI_CORE_MEM_ZONE , 2 ) ; <nl> <nl> if ( result ! = NULL ) { <nl> TRI_json_t * collectionInfo ; <nl> const char * TRI_GetStatusStringCollectionVocBase ( TRI_vocbase_col_status_e statu <nl> <nl> char * TRI_GetCollectionNameByIdVocBase ( TRI_vocbase_t * vocbase , <nl> const TRI_voc_cid_t id ) { <nl> - TRI_vocbase_col_t * found ; <nl> char * name ; <nl> <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> - found = CONST_CAST ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsById , & id ) ) ; <nl> + TRI_vocbase_col_t * found = static_cast < TRI_vocbase_col_t * > ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsById , & id ) ) ; <nl> <nl> if ( found = = NULL ) { <nl> name = NULL ; <nl> char * TRI_GetCollectionNameByIdVocBase ( TRI_vocbase_t * vocbase , <nl> <nl> TRI_vocbase_col_t * TRI_LookupCollectionByNameVocBase ( TRI_vocbase_t * vocbase , <nl> char const * name ) { <nl> - TRI_vocbase_col_t * found ; <nl> const char c = * name ; <nl> <nl> / / if collection name is passed as a stringified id , we ' ll use the lookupbyid function <nl> TRI_vocbase_col_t * TRI_LookupCollectionByNameVocBase ( TRI_vocbase_t * vocbase , <nl> <nl> / / otherwise we ' ll look up the collection by name <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> - found = CONST_CAST ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsByName , name ) ) ; <nl> + TRI_vocbase_col_t * found = static_cast < TRI_vocbase_col_t * > ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsByName , name ) ) ; <nl> TRI_READ_UNLOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> return found ; <nl> TRI_vocbase_col_t * TRI_LookupCollectionByNameVocBase ( TRI_vocbase_t * vocbase , <nl> / / / @ brief looks up a ( document ) collection by identifier <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> <nl> - TRI_vocbase_col_t * TRI_LookupCollectionByIdVocBase ( TRI_vocbase_t * vocbase , TRI_voc_cid_t id ) { <nl> - TRI_vocbase_col_t * found ; <nl> - <nl> + TRI_vocbase_col_t * TRI_LookupCollectionByIdVocBase ( TRI_vocbase_t * vocbase , <nl> + TRI_voc_cid_t id ) { <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> - found = CONST_CAST ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsById , & id ) ) ; <nl> + TRI_vocbase_col_t * found = static_cast < TRI_vocbase_col_t * > ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsById , & id ) ) ; <nl> TRI_READ_UNLOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> return found ; <nl> TRI_vocbase_col_t * TRI_FindCollectionByNameOrCreateVocBase ( TRI_vocbase_t * vocba <nl> char const * name , <nl> const TRI_col_type_t type , <nl> TRI_server_id_t generatingServer ) { <nl> - TRI_vocbase_col_t * found ; <nl> - <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> - found = CONST_CAST ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsByName , name ) ) ; <nl> + TRI_vocbase_col_t * found = static_cast < TRI_vocbase_col_t * > ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsByName , name ) ) ; <nl> TRI_READ_UNLOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> if ( found ! = NULL ) { <nl> int TRI_UseCollectionVocBase ( TRI_vocbase_t * vocbase , <nl> <nl> TRI_vocbase_col_t * TRI_UseCollectionByIdVocBase ( TRI_vocbase_t * vocbase , <nl> const TRI_voc_cid_t cid ) { <nl> - TRI_vocbase_col_t const * collection ; <nl> - int res ; <nl> - <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / check that we have an existing name <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> - collection = TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsById , & cid ) ; <nl> + TRI_vocbase_col_t const * collection = static_cast < TRI_vocbase_col_t const * > ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsById , & cid ) ) ; <nl> TRI_READ_UNLOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> if ( collection = = NULL ) { <nl> TRI_vocbase_col_t * TRI_UseCollectionByIdVocBase ( TRI_vocbase_t * vocbase , <nl> / / try to load the collection <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - res = LoadCollectionVocBase ( vocbase , CONST_CAST ( collection ) ) ; <nl> + int res = LoadCollectionVocBase ( vocbase , const_cast < TRI_vocbase_col_t * > ( collection ) ) ; <nl> <nl> if ( res = = TRI_ERROR_NO_ERROR ) { <nl> - return CONST_CAST ( collection ) ; <nl> + return const_cast < TRI_vocbase_col_t * > ( collection ) ; <nl> } <nl> <nl> TRI_set_errno ( res ) ; <nl> TRI_vocbase_col_t * TRI_UseCollectionByIdVocBase ( TRI_vocbase_t * vocbase , <nl> <nl> TRI_vocbase_col_t * TRI_UseCollectionByNameVocBase ( TRI_vocbase_t * vocbase , <nl> char const * name ) { <nl> - TRI_vocbase_col_t const * collection ; <nl> - int res ; <nl> - <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> / / check that we have an existing name <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> TRI_READ_LOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> - collection = TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsByName , name ) ; <nl> + TRI_vocbase_col_t const * collection = static_cast < TRI_vocbase_col_t const * > ( TRI_LookupByKeyAssociativePointer ( & vocbase - > _collectionsByName , name ) ) ; <nl> TRI_READ_UNLOCK_COLLECTIONS_VOCBASE ( vocbase ) ; <nl> <nl> if ( collection = = NULL ) { <nl> TRI_vocbase_col_t * TRI_UseCollectionByNameVocBase ( TRI_vocbase_t * vocbase , <nl> / / try to load the collection <nl> / / . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . <nl> <nl> - res = LoadCollectionVocBase ( vocbase , CONST_CAST ( collection ) ) ; <nl> + int res = LoadCollectionVocBase ( vocbase , const_cast < TRI_vocbase_col_t * > ( collection ) ) ; <nl> <nl> - return res = = TRI_ERROR_NO_ERROR ? CONST_CAST ( collection ) : NULL ; <nl> + return res = = TRI_ERROR_NO_ERROR ? const_cast < TRI_vocbase_col_t * > ( collection ) : NULL ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / arangod / VocBase / vocbase . h <nl> ppp b / arangod / VocBase / vocbase . h <nl> typedef struct TRI_vocbase_col_s { <nl> char _name [ TRI_COL_NAME_LENGTH + 1 ] ; / / name of the collection <nl> char _path [ TRI_COL_PATH_LENGTH + 1 ] ; / / path to the collection files <nl> char _dbName [ TRI_COL_NAME_LENGTH + 1 ] ; / / name of the database <nl> - / / TRI_voc_cid_t _planId ; / / id in plan <nl> <nl> bool _isLocal ; / / if true , the collection is local . if false , <nl> / / the collection is a remote ( cluster ) collection <nl>
|
cpp
|
arangodb/arangodb
|
149f7378cbbae9d05d720c6daa643aa3119371d5
|
2014-04-03T21:22:32Z
|
mmm a / jstests / core / txns / commands_not_allowed_in_txn . js <nl> ppp b / jstests / core / txns / commands_not_allowed_in_txn . js <nl> <nl> / / <nl> <nl> const nonSessionCommands = [ <nl> + { isMaster : 1 } , <nl> + { buildInfo : 1 } , <nl> + { ping : 1 } , <nl> + { listCommands : 1 } , <nl> { create : " create_collection " , writeConcern : { w : " majority " } } , <nl> { drop : " drop_collection " , writeConcern : { w : " majority " } } , <nl> { <nl> <nl> setup ( ) ; <nl> assert . commandFailedWithCode ( <nl> sessionDb . runCommand ( Object . assign ( { } , command , { txnNumber : NumberLong ( + + txnNumber ) } ) ) , <nl> - 50768 ) ; <nl> + [ 50768 , 50884 ] ) ; <nl> } ) ; <nl> <nl> / / <nl> mmm a / src / mongo / db / initialize_operation_session_info . cpp <nl> ppp b / src / mongo / db / initialize_operation_session_info . cpp <nl> boost : : optional < OperationSessionInfoFromClient > initializeOperationSessionInfo ( <nl> bool isReplSetMemberOrMongos , <nl> bool supportsDocLocking , <nl> bool supportsRecoverToStableTimestamp ) { <nl> + auto osi = OperationSessionInfoFromClient : : parse ( " OperationSessionInfo " _sd , requestBody ) ; <nl> <nl> if ( ! requiresAuth ) { <nl> + uassert ( ErrorCodes : : OperationNotSupportedInTransaction , <nl> + " This command is not supported in transactions " , <nl> + ! osi . getAutocommit ( ) ) ; <nl> + uassert ( <nl> + 50884 , " It is illegal to provide a txnNumber for this command " , ! osi . getTxnNumber ( ) ) ; <nl> return boost : : none ; <nl> } <nl> <nl> boost : : optional < OperationSessionInfoFromClient > initializeOperationSessionInfo ( <nl> } <nl> } <nl> <nl> - auto osi = OperationSessionInfoFromClient : : parse ( " OperationSessionInfo " _sd , requestBody ) ; <nl> - <nl> if ( osi . getSessionId ( ) ) { <nl> stdx : : lock_guard < Client > lk ( * opCtx - > getClient ( ) ) ; <nl> <nl>
|
SERVER - 34664 Commands that are unsupported in a transaction should error
|
mongodb/mongo
|
d56d941fe6d3d0af27ef8b8524e240e750a81364
|
2018-07-27T15:00:08Z
|
mmm a / arangod / Aql / ExecutionBlock . cpp <nl> ppp b / arangod / Aql / ExecutionBlock . cpp <nl> int GatherBlock : : initializeCursor ( AqlItemBlock * items , size_t pos ) { <nl> return TRI_ERROR_NO_ERROR ; <nl> } <nl> <nl> + int GatherBlock : : shutdown ( ) { <nl> + / / don ' t call default shutdown method since it does the wrong thing to _buffer <nl> + for ( auto it = _dependencies . begin ( ) ; it ! = _dependencies . end ( ) ; + + it ) { <nl> + int res = ( * it ) - > shutdown ( ) ; <nl> + <nl> + if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> + return res ; <nl> + } <nl> + } <nl> + <nl> + for ( std : : deque < AqlItemBlock * > x : _buffer ) { <nl> + for ( AqlItemBlock * y : x ) { <nl> + delete y ; <nl> + } <nl> + x . clear ( ) ; <nl> + } <nl> + _buffer . clear ( ) ; <nl> + return TRI_ERROR_NO_ERROR ; <nl> + } <nl> + <nl> int64_t GatherBlock : : count ( ) const { <nl> int64_t sum = 0 ; <nl> for ( auto x : _dependencies ) { <nl> size_t GatherBlock : : skipSome ( size_t atLeast , size_t atMost ) { <nl> / / renew the comparison function <nl> OurLessThan ourLessThan ( _trx , _buffer , _sortRegisters , colls ) ; <nl> } <nl> - _pos . at ( val . first ) = make_pair ( val . first , 0 ) ; <nl> + _pos . at ( val . first ) = make_pair ( val . first , 0 ) ; <nl> } <nl> } <nl> <nl> bool GatherBlock : : OurLessThan : : operator ( ) ( std : : pair < size_t , size_t > const & a , <nl> / / - - SECTION - - class ScatterBlock <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> + int ScatterBlock : : initializeCursor ( AqlItemBlock * items , size_t pos ) { <nl> + int res = ExecutionBlock : : initializeCursor ( items , pos ) ; <nl> + <nl> + if ( res ! = TRI_ERROR_NO_ERROR ) { <nl> + return res ; <nl> + } <nl> + <nl> + for ( size_t i = 0 ; i < _nrClients ; i + + ) { <nl> + _posForClient . push_back ( std : : make_pair ( 0 , 0 ) ) ; <nl> + _doneForClient . push_back ( false ) ; <nl> + } <nl> + <nl> + return TRI_ERROR_NO_ERROR ; <nl> + } <nl> + <nl> bool ScatterBlock : : hasMoreForClient ( size_t clientId ) { <nl> <nl> TRI_ASSERT ( 0 < = clientId & & clientId < _nrClients ) ; <nl> + <nl> if ( _doneForClient . at ( clientId ) ) { <nl> return false ; <nl> } <nl> bool ScatterBlock : : hasMore ( ) { <nl> return true ; <nl> } <nl> } <nl> + _done = true ; <nl> return false ; <nl> } <nl> <nl> mmm a / arangod / Aql / ExecutionBlock . h <nl> ppp b / arangod / Aql / ExecutionBlock . h <nl> namespace triagens { <nl> AqlItemBlock * getSome ( size_t , size_t ) ; <nl> <nl> size_t skipSome ( size_t , size_t ) ; <nl> + <nl> + / / need our own shutdown method since our _buffer is different <nl> + int shutdown ( ) ; <nl> <nl> private : <nl> <nl> namespace triagens { <nl> return ExecutionBlock : : initialize ( ) ; <nl> } <nl> <nl> - / / int initializeCursor ( AqlItemBlock * items , size_t pos ) ; <nl> + int initializeCursor ( AqlItemBlock * items , size_t pos ) ; <nl> <nl> int64_t remaining ( ) { <nl> return _dependencies [ 0 ] - > remaining ( ) ; <nl>
|
shutdown method for GatherBlock and initializeCursor for ScatterBlock
|
arangodb/arangodb
|
e8dc7694e374f06fd7879306b6672ee1d50c2643
|
2014-09-26T09:40:05Z
|
mmm a / plugins / mongo_db_plugin / CMakeLists . txt <nl> ppp b / plugins / mongo_db_plugin / CMakeLists . txt <nl> target_compile_definitions ( mongo_db_plugin <nl> ) <nl> <nl> target_link_libraries ( mongo_db_plugin <nl> - PUBLIC chain_plugin eos_chain appbase <nl> + PUBLIC chain_plugin eosio_chain appbase <nl> $ { EOS_LIBMONGOCXX } $ { EOS_LIBBSONCXX } <nl> ) <nl> <nl> mmm a / programs / eosiod / CMakeLists . txt <nl> ppp b / programs / eosiod / CMakeLists . txt <nl> endif ( ) <nl> <nl> target_link_libraries ( eosiod <nl> PRIVATE appbase <nl> - # PRIVATE account_history_api_plugin account_history_plugin db_plugin <nl> + # PRIVATE account_history_api_plugin account_history_plugin <nl> PRIVATE - Wl , $ { whole_archive_flag } chain_api_plugin - Wl , $ { no_whole_archive_flag } producer_plugin chain_plugin <nl> - PRIVATE - Wl , $ { whole_archive_flag } wallet_api_plugin - Wl , $ { no_whole_archive_flag } <nl> + PRIVATE - Wl , $ { whole_archive_flag } wallet_api_plugin - Wl , $ { no_whole_archive_flag } <nl> + PRIVATE - Wl , $ { whole_archive_flag } mongo_db_plugin - Wl , $ { no_whole_archive_flag } <nl> PRIVATE net_plugin net_api_plugin - Wl , $ { whole_archive_flag } txn_test_gen_plugin - Wl , $ { no_whole_archive_flag } <nl> PRIVATE http_plugin - Wl , $ { whole_archive_flag } faucet_testnet_plugin - Wl , $ { no_whole_archive_flag } <nl> PRIVATE eosio_chain fc $ { CMAKE_DL_LIBS } $ { PLATFORM_SPECIFIC_LIBS } ) <nl>
|
Add mongo_db_plugin to eosiod .
|
EOSIO/eos
|
470b518612db21edf9fc67a91722403efb6d1112
|
2018-01-11T15:21:40Z
|
mmm a / scripts / generate_deb . sh <nl> ppp b / scripts / generate_deb . sh <nl> fi <nl> <nl> NAME = " $ { PROJECT } _ $ { VERSION_NO_SUFFIX } - $ { RELEASE } _amd64 " <nl> <nl> + if [ [ - f / etc / upstream - release / lsb - release ] ] ; then <nl> + source / etc / upstream - release / lsb - release <nl> + elif [ [ - f / etc / lsb - release ] ] ; then <nl> + source / etc / lsb - release <nl> + else <nl> + echo " Unrecognized Debian derivative . Not generating . deb file . " <nl> + exit 1 <nl> + fi <nl> + <nl> + if [ $ { DISTRIB_RELEASE } = " 16 . 04 " ] ; then <nl> + LIBSSL = " libssl1 . 0 . 0 " <nl> + elif [ $ { DISTRIB_RELEASE } = " 18 . 04 " ] ; then <nl> + LIBSSL = " libssl1 . 1 " <nl> + else <nl> + echo " Unrecognized Ubuntu version . Update generate_deb . sh . Not generating . deb file . " <nl> + exit 1 <nl> + fi <nl> + <nl> mkdir - p $ { PROJECT } / DEBIAN <nl> chmod 0755 $ { PROJECT } / DEBIAN <nl> echo " Package : $ { PROJECT } <nl> Version : $ { VERSION_NO_SUFFIX } - $ { RELEASE } <nl> Section : devel <nl> Priority : optional <nl> - Depends : libc6 , libgcc1 , libssl1 . 0 . 0 , libstdc + + 6 , libtinfo5 , zlib1g <nl> + Depends : libc6 , libgcc1 , $ { LIBSSL } , libstdc + + 6 , libtinfo5 , zlib1g <nl> Architecture : amd64 <nl> Homepage : $ { URL } <nl> Maintainer : $ { EMAIL } <nl>
|
Conditionally depend on libssl1 . 0 . 0 or libssl1 . 1 depending on OS
|
EOSIO/eos
|
3c1dffcd7c80cce86198867e74965a994d7bd5a0
|
2019-01-26T00:34:34Z
|
deleted file mode 100644 <nl> index b39d068e80e . . 00000000000 <nl> mmm a / src / dag_engine / simple_engine . cc <nl> ppp / dev / null <nl> <nl> - / * ! <nl> - * Copyright ( c ) 2015 by Contributors <nl> - * / <nl> - # include " simple_engine . h " <nl> - # include < dmlc / logging . h > <nl> - # include < cassert > <nl> - # include < algorithm > <nl> - # include < utility > <nl> - # include < condition_variable > <nl> - # include < mutex > <nl> - # include " . . / common / cuda_utils . h " <nl> - <nl> - namespace mxnet { <nl> - <nl> - namespace engine { <nl> - <nl> - # if DAG_ENGINE_DEBUG <nl> - std : : atomic < std : : size_t > OprBlock : : counter { 0 } ; <nl> - std : : atomic < std : : size_t > VersionedVarBlock : : counter { 0 } ; <nl> - std : : atomic < std : : size_t > SimpleVar : : counter { 0 } ; <nl> - std : : atomic < std : : size_t > SimpleOpr : : counter { 0 } ; <nl> - # endif / / DAG_ENGINE_DEBUG <nl> - <nl> - SimpleVar * SimpleVar : : CastFromBase ( Var * v ) { return v - > Cast < SimpleVar > ( ) ; } <nl> - <nl> - SimpleOpr * SimpleOpr : : CastFromBase ( Opr * o ) { return o - > Cast < SimpleOpr > ( ) ; } <nl> - <nl> - SimpleEngine : : SimpleEngine ( ) <nl> - : pending_ { 0 } , thread_pool_ { [ this ] ( ) { ThreadWorker ( ) ; } } { } <nl> - <nl> - SimpleEngine : : ~ SimpleEngine ( ) noexcept ( false ) { task_queue_ . SignalForKill ( ) ; } <nl> - <nl> - SimpleVar * SimpleEngine : : NewVar ( ) { <nl> - auto ret = SimpleVar : : New ( ) ; <nl> - ret - > head = VersionedVarBlock : : New ( ) ; <nl> - return ret ; <nl> - } <nl> - <nl> - SimpleOpr * SimpleEngine : : NewOperator ( SimpleEngine : : AsyncFn fn , <nl> - std : : vector < Variable > const & use_vars , <nl> - std : : vector < Variable > const & mutate_vars ) { <nl> - auto ret = SimpleOpr : : New ( ) ; <nl> - ret - > fn = fn ; <nl> - ret - > use_vars . resize ( use_vars . size ( ) ) ; <nl> - ret - > mutate_vars . resize ( mutate_vars . size ( ) ) ; <nl> - std : : transform ( use_vars . begin ( ) , use_vars . end ( ) , ret - > use_vars . begin ( ) , <nl> - SimpleVar : : CastFromBase ) ; <nl> - std : : transform ( mutate_vars . begin ( ) , mutate_vars . end ( ) , <nl> - ret - > mutate_vars . begin ( ) , SimpleVar : : CastFromBase ) ; <nl> - # if DAG_ENGINE_DEBUG <nl> - / / Check for duplicates . <nl> - auto use = use_vars ; <nl> - auto mutate = mutate_vars ; <nl> - auto use_size = use . size ( ) ; <nl> - auto mutate_size = mutate . size ( ) ; <nl> - std : : sort ( use . begin ( ) , use . end ( ) ) ; <nl> - std : : sort ( mutate . begin ( ) , mutate . end ( ) ) ; <nl> - for ( std : : size_t i = 0 ; i < use_size ; + + i ) { <nl> - if ( i ! = 0 & & use . at ( i ) = = use . at ( i - 1 ) ) { <nl> - LOG ( FATAL ) < < " duplicate items found in ` use_vars ` " ; <nl> - } <nl> - } <nl> - for ( std : : size_t i = 0 ; i < mutate_size ; + + i ) { <nl> - if ( i ! = 0 & & mutate . at ( i ) = = mutate . at ( i - 1 ) ) { <nl> - LOG ( FATAL ) < < " duplicate items found in ` mutate_vars ` " ; <nl> - } <nl> - } <nl> - std : : size_t j = 0 ; <nl> - for ( std : : size_t i = 0 ; i < use_size ; + + i ) { <nl> - while ( j < mutate_size & & mutate . at ( j ) < use . at ( i ) ) { <nl> - + + j ; <nl> - } <nl> - if ( j = = mutate_size ) { <nl> - break ; <nl> - } <nl> - if ( mutate . at ( j ) = = use . at ( i ) ) { <nl> - LOG ( FATAL ) <nl> - < < " duplicate items found between ` use_vars ` and ` mutate_vars ` " ; <nl> - } <nl> - } <nl> - # endif / / DAG_ENGINE_DEBUG <nl> - return ret ; <nl> - } <nl> - <nl> - void SimpleEngine : : DeleteOperator ( OprHandle op ) { <nl> - auto & & simple_opr = SimpleOpr : : CastFromBase ( op ) ; <nl> - std : : vector < Variable > deps { } ; <nl> - deps . reserve ( simple_opr - > use_vars . size ( ) + simple_opr - > mutate_vars . size ( ) ) ; <nl> - deps . insert ( deps . end ( ) , simple_opr - > use_vars . begin ( ) , <nl> - simple_opr - > use_vars . end ( ) ) ; <nl> - deps . insert ( deps . end ( ) , simple_opr - > mutate_vars . begin ( ) , <nl> - simple_opr - > mutate_vars . end ( ) ) ; <nl> - auto & & func = [ simple_opr ] ( RunContext ) { SimpleOpr : : Delete ( simple_opr ) ; } ; <nl> - Push ( func , Context { } , { } , deps ) ; <nl> - } <nl> - <nl> - void SimpleEngine : : Push ( Fn exec_fun , Context exec_ctx , <nl> - std : : vector < Variable > const & use_vars , <nl> - std : : vector < Variable > const & mutate_vars ) { <nl> - auto f = [ exec_fun ] ( RunContext ctx , Callback on_complete ) { <nl> - exec_fun ( ctx ) ; <nl> - on_complete ( ) ; <nl> - } ; <nl> - PushAsync ( f , exec_ctx , use_vars , mutate_vars ) ; <nl> - } <nl> - <nl> - void SimpleEngine : : Push ( OprHandle op , Context exec_ctx ) { <nl> - auto & & simple_opr = SimpleOpr : : CastFromBase ( op ) ; <nl> - auto & & opr_block = OprBlock : : New ( ) ; <nl> - opr_block - > opr = simple_opr ; <nl> - opr_block - > wait . store ( simple_opr - > use_vars . size ( ) + <nl> - simple_opr - > mutate_vars . size ( ) + 1 ) ; <nl> - opr_block - > ctx = exec_ctx ; <nl> - opr_block - > rctx = RunContext { nullptr } ; <nl> - + + pending_ ; <nl> - / / Add read dependencies . <nl> - for ( auto & & i : simple_opr - > use_vars ) { <nl> - std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> - if ( i - > ready_to_read ) { <nl> - assert ( i - > pending_write = = nullptr ) ; <nl> - + + i - > num_pending_reads ; <nl> - - - opr_block - > wait ; <nl> - } else { <nl> - auto & & new_var_block = VersionedVarBlock : : New ( ) ; <nl> - assert ( i - > head - > next = = nullptr ) ; <nl> - assert ( i - > head - > trigger = = nullptr ) ; <nl> - assert ( i - > head - > write = = false ) ; <nl> - i - > head - > next = new_var_block ; <nl> - i - > head - > trigger = opr_block ; <nl> - i - > head = new_var_block ; <nl> - } <nl> - } <nl> - / / Add write dependencies . <nl> - for ( auto & & i : simple_opr - > mutate_vars ) { <nl> - std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> - auto & & new_var_block = VersionedVarBlock : : New ( ) ; <nl> - i - > head - > next = new_var_block ; <nl> - i - > head - > trigger = opr_block ; <nl> - i - > head - > write = true ; <nl> - if ( i - > ready_to_read ) { <nl> - / * ! <nl> - * Raise ` num_pending_reads ` temporarily to avoid premature triggering . <nl> - * / <nl> - + + i - > num_pending_reads ; <nl> - i - > pending_write = i - > head ; <nl> - if ( - - i - > num_pending_reads = = 0 ) { <nl> - - - opr_block - > wait ; <nl> - } <nl> - i - > ready_to_read = false ; <nl> - } <nl> - i - > head = new_var_block ; <nl> - } <nl> - if ( - - opr_block - > wait = = 0 ) { <nl> - task_queue_ . Push ( opr_block ) ; <nl> - } <nl> - } <nl> - <nl> - void SimpleEngine : : PushAsync ( AsyncFn fn , Context exec_ctx , <nl> - std : : vector < Variable > const & use_vars , <nl> - std : : vector < Variable > const & mutate_vars ) { <nl> - auto & & opr = NewOperator ( fn , use_vars , mutate_vars ) ; <nl> - opr - > temporary = true ; <nl> - Push ( opr , exec_ctx ) ; <nl> - } <nl> - <nl> - void SimpleEngine : : PushDelete ( Fn delete_fn , Context exec_ctx , Variable var ) { <nl> - auto & & simple_var = SimpleVar : : CastFromBase ( var ) ; <nl> - auto & & func = [ delete_fn , simple_var ] ( RunContext ctx ) { <nl> - / * ! <nl> - * Mark variable as orphan , so during ` SimpleEngine : : OnComplete ` it could be <nl> - * recycled . <nl> - * / <nl> - simple_var - > to_delete = true ; <nl> - delete_fn ( ctx ) ; <nl> - } ; <nl> - Push ( func , exec_ctx , { } , { var } ) ; <nl> - } <nl> - <nl> - void SimpleEngine : : WaitForVar ( Variable var ) { <nl> - std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> - std : : atomic < bool > done { false } ; <nl> - auto & & callback = [ this , & done ] ( RunContext ) { <nl> - std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> - done . store ( true ) ; <nl> - finished_cv_ . notify_all ( ) ; <nl> - } ; <nl> - Push ( callback , Context { } , { var } , { } ) ; <nl> - finished_cv_ . wait ( lock , [ & done ] ( ) { return done . load ( ) ; } ) ; <nl> - } <nl> - <nl> - void SimpleEngine : : WaitForAll ( ) { <nl> - std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> - finished_cv_ . wait ( lock , [ this ] ( ) { return pending_ . load ( ) = = 0 ; } ) ; <nl> - } <nl> - <nl> - void SimpleEngine : : OnComplete ( SimpleOpr * simple_opr ) { <nl> - / * ! <nl> - * Mark complete for read variables . <nl> - * / <nl> - for ( auto & & i : simple_opr - > use_vars ) { <nl> - std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> - if ( - - i - > num_pending_reads = = 0 ) { <nl> - if ( i - > pending_write ! = nullptr & & <nl> - - - i - > pending_write - > trigger - > wait = = 0 ) { <nl> - task_queue_ . Push ( i - > pending_write - > trigger ) ; <nl> - } <nl> - } <nl> - } <nl> - / * ! <nl> - * Mark complete for write variables . <nl> - * / <nl> - for ( auto & & i : simple_opr - > mutate_vars ) { <nl> - bool to_delete = false ; <nl> - { <nl> - std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> - assert ( i - > ready_to_read = = false ) ; <nl> - auto head = i - > pending_write - > next ; <nl> - VersionedVarBlock : : Delete ( i - > pending_write ) ; <nl> - i - > pending_write = nullptr ; <nl> - if ( i - > to_delete ) { <nl> - assert ( head - > next = = nullptr ) ; <nl> - VersionedVarBlock : : Delete ( head ) ; <nl> - to_delete = true ; <nl> - } else { <nl> - while ( true ) { <nl> - if ( head - > write = = true ) { <nl> - + + i - > num_pending_reads ; <nl> - i - > pending_write = head ; <nl> - if ( - - i - > num_pending_reads = = 0 ) { <nl> - if ( - - head - > trigger - > wait = = 0 ) { <nl> - task_queue_ . Push ( head - > trigger ) ; <nl> - } <nl> - } <nl> - break ; <nl> - } else if ( head - > next = = nullptr ) { <nl> - i - > ready_to_read = true ; <nl> - break ; <nl> - } else { <nl> - + + i - > num_pending_reads ; <nl> - if ( - - head - > trigger - > wait = = 0 ) { <nl> - task_queue_ . Push ( head - > trigger ) ; <nl> - } <nl> - auto prev = head ; <nl> - head = head - > next ; <nl> - VersionedVarBlock : : Delete ( prev ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - if ( to_delete ) { <nl> - SimpleVar : : Delete ( i ) ; <nl> - } <nl> - } <nl> - { <nl> - std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> - if ( - - pending_ = = 0 ) { <nl> - finished_cv_ . notify_all ( ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - void SimpleEngine : : ThreadWorker ( ) { <nl> - OprBlock * opr_block ; <nl> - while ( task_queue_ . Pop ( & opr_block ) ) { <nl> - assert ( opr_block - > wait . load ( ) = = 0 ) ; <nl> - auto simple_opr = opr_block - > opr ; <nl> - auto callback = [ this , simple_opr ] ( ) { <nl> - OnComplete ( simple_opr ) ; <nl> - if ( simple_opr - > temporary ) { <nl> - SimpleOpr : : Delete ( simple_opr ) ; <nl> - } <nl> - } ; <nl> - if ( opr_block - > ctx . dev_mask = = gpu : : kDevMask ) { <nl> - # if MXNET_USE_CUDA <nl> - CUDA_CALL ( cudaSetDevice ( opr_block - > ctx . dev_id ) ) ; <nl> - # else / / MXNET_USE_CUDA <nl> - LOG ( FATAL ) < < " Please compile with CUDA enabled " ; <nl> - # endif / / MXNET_USE_CUDA <nl> - } <nl> - simple_opr - > fn ( opr_block - > rctx , callback ) ; <nl> - OprBlock : : Delete ( opr_block ) ; <nl> - } <nl> - } <nl> - <nl> - } / / namespace engine <nl> - <nl> - } / / namespace mxnet <nl> mmm a / src / dag_engine / threaded_engine . cc <nl> ppp b / src / dag_engine / threaded_engine . cc <nl> <nl> - / / Copyright ( c ) 2015 by Contributors <nl> - # include < queue > <nl> - # include < memory > <nl> - # include < tuple > <nl> + / * ! <nl> + * Copyright ( c ) 2015 by Contributors <nl> + * / <nl> + # include " simple_engine . h " <nl> + # include < dmlc / logging . h > <nl> + # include < cassert > <nl> + # include < algorithm > <nl> # include < utility > <nl> - # include < atomic > <nl> - # include < thread > <nl> - # include < random > <nl> + # include < condition_variable > <nl> + # include < mutex > <nl> + # include " . . / common / cuda_utils . h " <nl> <nl> - # include " dmlc / logging . h " <nl> - # include " mxnet / dag_engine . h " <nl> - # include " . . / common / spin_lock . h " <nl> - # include " . . / common / concurrent_blocking_queue . h " <nl> + namespace mxnet { <nl> <nl> - using namespace std ; <nl> + namespace engine { <nl> <nl> - namespace mxnet { <nl> + # if DAG_ENGINE_DEBUG <nl> + std : : atomic < std : : size_t > OprBlock : : counter { 0 } ; <nl> + std : : atomic < std : : size_t > VersionedVarBlock : : counter { 0 } ; <nl> + std : : atomic < std : : size_t > SimpleVar : : counter { 0 } ; <nl> + std : : atomic < std : : size_t > SimpleOpr : : counter { 0 } ; <nl> + # endif / / DAG_ENGINE_DEBUG <nl> + <nl> + SimpleVar * SimpleVar : : CastFromBase ( Var * v ) { return v - > Cast < SimpleVar > ( ) ; } <nl> <nl> - # define DEFAULT_NUM_WORKER_THREADS 4 <nl> + SimpleOpr * SimpleOpr : : CastFromBase ( Opr * o ) { return o - > Cast < SimpleOpr > ( ) ; } <nl> <nl> - class ThreadedEngine : public DAGEngine { <nl> - public : <nl> - explicit ThreadedEngine ( int numthreads = DEFAULT_NUM_WORKER_THREADS ) : numthreads_ ( numthreads ) { <nl> - for ( int i = 0 ; i < numthreads ; + + i ) { <nl> - worker_queues_ . push_back ( new ConcurrentBlockingQueue < OpDescr * > ( ) ) ; <nl> - workers_ . emplace_back ( & ThreadedEngine : : WorkerRoutine , this , i ) ; <nl> + SimpleEngine : : SimpleEngine ( ) <nl> + : pending_ { 0 } , thread_pool_ { [ this ] ( ) { ThreadWorker ( ) ; } } { } <nl> + <nl> + SimpleEngine : : ~ SimpleEngine ( ) noexcept ( false ) { task_queue_ . SignalForKill ( ) ; } <nl> + <nl> + SimpleVar * SimpleEngine : : NewVar ( ) { <nl> + auto ret = SimpleVar : : New ( ) ; <nl> + ret - > head = VersionedVarBlock : : New ( ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + SimpleOpr * SimpleEngine : : NewOperator ( SimpleEngine : : AsyncFn fn , <nl> + std : : vector < Variable > const & use_vars , <nl> + std : : vector < Variable > const & mutate_vars ) { <nl> + auto ret = SimpleOpr : : New ( ) ; <nl> + ret - > fn = fn ; <nl> + ret - > use_vars . resize ( use_vars . size ( ) ) ; <nl> + ret - > mutate_vars . resize ( mutate_vars . size ( ) ) ; <nl> + std : : transform ( use_vars . begin ( ) , use_vars . end ( ) , ret - > use_vars . begin ( ) , <nl> + SimpleVar : : CastFromBase ) ; <nl> + std : : transform ( mutate_vars . begin ( ) , mutate_vars . end ( ) , <nl> + ret - > mutate_vars . begin ( ) , SimpleVar : : CastFromBase ) ; <nl> + # if DAG_ENGINE_DEBUG <nl> + / / Check for duplicates . <nl> + auto use = use_vars ; <nl> + auto mutate = mutate_vars ; <nl> + auto use_size = use . size ( ) ; <nl> + auto mutate_size = mutate . size ( ) ; <nl> + std : : sort ( use . begin ( ) , use . end ( ) ) ; <nl> + std : : sort ( mutate . begin ( ) , mutate . end ( ) ) ; <nl> + for ( std : : size_t i = 0 ; i < use_size ; + + i ) { <nl> + if ( i ! = 0 & & use . at ( i ) = = use . at ( i - 1 ) ) { <nl> + LOG ( FATAL ) < < " duplicate items found in ` use_vars ` " ; <nl> } <nl> } <nl> - ~ ThreadedEngine ( ) { <nl> - for ( int i = 0 ; i < numthreads_ ; + + i ) { <nl> - worker_queues_ [ i ] - > SignalForKill ( ) ; <nl> - delete worker_queues_ [ i ] ; <nl> - workers_ [ i ] . join ( ) ; <nl> + for ( std : : size_t i = 0 ; i < mutate_size ; + + i ) { <nl> + if ( i ! = 0 & & mutate . at ( i ) = = mutate . at ( i - 1 ) ) { <nl> + LOG ( FATAL ) < < " duplicate items found in ` mutate_vars ` " ; <nl> } <nl> } <nl> - void Push ( AsyncOp exec_fun , <nl> - Context exec_ctx , <nl> - const vector < Variable > & use_vars , <nl> - const vector < Variable > & mutate_vars ) override { <nl> - shared_ptr < OpDescr > opd ( new OpDescr { exec_fun , exec_ctx , use_vars , mutate_vars } , <nl> - [ this ] ( OpDescr * o ) { this - > OnDepsResolved ( o ) ; } ) ; <nl> - for ( Variable v : use_vars ) { / / read <nl> - VarDescr * vard = static_cast < VarDescr * > ( v ) ; / / safe to cast here <nl> - spin_lock ( & vard - > lock ) ; <nl> - if ( vard - > rw < 0 ) { <nl> - vard - > waitings . push ( make_pair ( opd , DepType : : kRead ) ) ; <nl> - } else { <nl> - + + vard - > rw ; <nl> - } <nl> - spin_unlock ( & vard - > lock ) ; <nl> + std : : size_t j = 0 ; <nl> + for ( std : : size_t i = 0 ; i < use_size ; + + i ) { <nl> + while ( j < mutate_size & & mutate . at ( j ) < use . at ( i ) ) { <nl> + + + j ; <nl> } <nl> - for ( Variable v : mutate_vars ) { / / write <nl> - VarDescr * vard = static_cast < VarDescr * > ( v ) ; / / safe to cast here <nl> - spin_lock ( & vard - > lock ) ; <nl> - if ( vard - > rw ! = 0 ) { <nl> - vard - > waitings . push ( make_pair ( opd , DepType : : kWrite ) ) ; <nl> - } else { <nl> - vard - > rw = - 1 ; <nl> - } <nl> - spin_unlock ( & vard - > lock ) ; <nl> + if ( j = = mutate_size ) { <nl> + break ; <nl> + } <nl> + if ( mutate . at ( j ) = = use . at ( i ) ) { <nl> + LOG ( FATAL ) <nl> + < < " duplicate items found between ` use_vars ` and ` mutate_vars ` " ; <nl> } <nl> } <nl> - void Push ( Op exec_fun , <nl> - Context exec_ctx , <nl> - const vector < Variable > & use_vars , <nl> - const vector < Variable > & mutate_vars ) override { <nl> - this - > Push ( [ exec_fun ] ( RunContext ctx , Callback on_complete ) { <nl> - exec_fun ( ctx ) ; on_complete ( ) ; <nl> - } , exec_ctx , use_vars , mutate_vars ) ; <nl> - } <nl> - void PushDelete ( Op delete_fun , Context exec_ctx , Variable var ) override { <nl> - this - > Push ( [ delete_fun , var ] ( RunContext ctx ) { <nl> - delete_fun ( ctx ) ; <nl> - delete static_cast < VarDescr * > ( var ) ; / / TODO ( minjie ) : use variable pool instead <nl> - } , exec_ctx , { } , { var } ) ; <nl> - } <nl> - Variable NewVar ( ) override { <nl> - / / in practice return a ptr to a cell <nl> - / / that have the info about the variable <nl> - / / use ptr directly instead of ID because this avoids an indirect mapping <nl> - / / TODO ( minjie ) : use variable pool instead <nl> - VarDescr * vd = new VarDescr ; <nl> - vd - > lock = SPINLOCK_INITIALIZER ; <nl> - vd - > rw = 0 ; <nl> - return vd ; <nl> + # endif / / DAG_ENGINE_DEBUG <nl> + return ret ; <nl> + } <nl> + <nl> + void SimpleEngine : : DeleteOperator ( OprHandle op ) { <nl> + auto & & simple_opr = SimpleOpr : : CastFromBase ( op ) ; <nl> + std : : vector < Variable > deps { } ; <nl> + deps . reserve ( simple_opr - > use_vars . size ( ) + simple_opr - > mutate_vars . size ( ) ) ; <nl> + deps . insert ( deps . end ( ) , simple_opr - > use_vars . begin ( ) , <nl> + simple_opr - > use_vars . end ( ) ) ; <nl> + deps . insert ( deps . end ( ) , simple_opr - > mutate_vars . begin ( ) , <nl> + simple_opr - > mutate_vars . end ( ) ) ; <nl> + auto & & func = [ simple_opr ] ( RunContext ) { SimpleOpr : : Delete ( simple_opr ) ; } ; <nl> + Push ( func , Context { } , { } , deps ) ; <nl> + } <nl> + <nl> + void SimpleEngine : : Push ( Fn exec_fun , Context exec_ctx , <nl> + std : : vector < Variable > const & use_vars , <nl> + std : : vector < Variable > const & mutate_vars ) { <nl> + auto f = [ exec_fun ] ( RunContext ctx , Callback on_complete ) { <nl> + exec_fun ( ctx ) ; <nl> + on_complete ( ) ; <nl> + } ; <nl> + PushAsync ( f , exec_ctx , use_vars , mutate_vars ) ; <nl> + } <nl> + <nl> + void SimpleEngine : : Push ( OprHandle op , Context exec_ctx ) { <nl> + auto & & simple_opr = SimpleOpr : : CastFromBase ( op ) ; <nl> + auto & & opr_block = OprBlock : : New ( ) ; <nl> + opr_block - > opr = simple_opr ; <nl> + opr_block - > wait . store ( simple_opr - > use_vars . size ( ) + <nl> + simple_opr - > mutate_vars . size ( ) + 1 ) ; <nl> + opr_block - > ctx = exec_ctx ; <nl> + opr_block - > rctx = RunContext { nullptr } ; <nl> + + + pending_ ; <nl> + / / Add read dependencies . <nl> + for ( auto & & i : simple_opr - > use_vars ) { <nl> + std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> + if ( i - > ready_to_read ) { <nl> + assert ( i - > pending_write = = nullptr ) ; <nl> + + + i - > num_pending_reads ; <nl> + - - opr_block - > wait ; <nl> + } else { <nl> + auto & & new_var_block = VersionedVarBlock : : New ( ) ; <nl> + assert ( i - > head - > next = = nullptr ) ; <nl> + assert ( i - > head - > trigger = = nullptr ) ; <nl> + assert ( i - > head - > write = = false ) ; <nl> + i - > head - > next = new_var_block ; <nl> + i - > head - > trigger = opr_block ; <nl> + i - > head = new_var_block ; <nl> + } <nl> } <nl> - void WaitForVar ( Variable var ) override { <nl> - / / TODO ( minjie ) : tbd <nl> + / / Add write dependencies . <nl> + for ( auto & & i : simple_opr - > mutate_vars ) { <nl> + std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> + auto & & new_var_block = VersionedVarBlock : : New ( ) ; <nl> + i - > head - > next = new_var_block ; <nl> + i - > head - > trigger = opr_block ; <nl> + i - > head - > write = true ; <nl> + if ( i - > ready_to_read ) { <nl> + / * ! <nl> + * Raise ` num_pending_reads ` temporarily to avoid premature triggering . <nl> + * / <nl> + + + i - > num_pending_reads ; <nl> + i - > pending_write = i - > head ; <nl> + if ( - - i - > num_pending_reads = = 0 ) { <nl> + - - opr_block - > wait ; <nl> + } <nl> + i - > ready_to_read = false ; <nl> + } <nl> + i - > head = new_var_block ; <nl> } <nl> - void WaitForAll ( ) override { <nl> - / / TODO ( minjie ) : tbd <nl> + if ( - - opr_block - > wait = = 0 ) { <nl> + task_queue_ . Push ( opr_block ) ; <nl> } <nl> + } <nl> <nl> - private : <nl> - enum class DepType { <nl> - kRead = 0 , <nl> - kWrite , <nl> - kDelete , <nl> - } ; <nl> - struct OpDescr { <nl> - AsyncOp op ; <nl> - Context exec_ctx ; <nl> - vector < Variable > read_vars ; <nl> - vector < Variable > write_vars ; <nl> + void SimpleEngine : : PushAsync ( AsyncFn fn , Context exec_ctx , <nl> + std : : vector < Variable > const & use_vars , <nl> + std : : vector < Variable > const & mutate_vars ) { <nl> + auto & & opr = NewOperator ( fn , use_vars , mutate_vars ) ; <nl> + opr - > temporary = true ; <nl> + Push ( opr , exec_ctx ) ; <nl> + } <nl> + <nl> + void SimpleEngine : : PushDelete ( Fn delete_fn , Context exec_ctx , Variable var ) { <nl> + auto & & simple_var = SimpleVar : : CastFromBase ( var ) ; <nl> + auto & & func = [ delete_fn , simple_var ] ( RunContext ctx ) { <nl> + / * ! <nl> + * Mark variable as orphan , so during ` SimpleEngine : : OnComplete ` it could be <nl> + * recycled . <nl> + * / <nl> + simple_var - > to_delete = true ; <nl> + delete_fn ( ctx ) ; <nl> } ; <nl> - struct VarDescr { <nl> - spinlock lock ; <nl> - int rw ; / / a semaphore - like count <nl> - / / if rw > 0 , the variable has several readers and the number <nl> - / / means how many operators are currently reading it ; <nl> - / / if rw < 0 , the varaible has one writer ( should be - 1 ) <nl> - queue < pair < shared_ptr < OpDescr > , DepType > > waitings ; <nl> + Push ( func , exec_ctx , { } , { var } ) ; <nl> + } <nl> + <nl> + void SimpleEngine : : WaitForVar ( Variable var ) { <nl> + std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> + std : : atomic < bool > done { false } ; <nl> + auto & & callback = [ this , & done ] ( RunContext ) { <nl> + std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> + done . store ( true ) ; <nl> + finished_cv_ . notify_all ( ) ; <nl> } ; <nl> - void TriggerWaiting ( VarDescr * vard ) { <nl> - / / ATTENTION : this function should be called with vard - > lock held . <nl> - CHECK ( vard - > rw = = 0 ) < < " the variable should be free during triggering " ; <nl> - if ( ! vard - > waitings . empty ( ) ) { <nl> - / / pop all reads first <nl> - while ( vard - > waitings . front ( ) . second = = DepType : : kRead ) { <nl> - vard - > waitings . pop ( ) ; <nl> - + + vard - > rw ; <nl> - } <nl> - if ( vard - > rw = = 0 ) { <nl> - / / pop the next write <nl> - vard - > waitings . pop ( ) ; <nl> - vard - > rw = - 1 ; <nl> + Push ( callback , Context { } , { var } , { } ) ; <nl> + finished_cv_ . wait ( lock , [ & done ] ( ) { return done . load ( ) ; } ) ; <nl> + } <nl> + <nl> + void SimpleEngine : : WaitForAll ( ) { <nl> + std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> + finished_cv_ . wait ( lock , [ this ] ( ) { return pending_ . load ( ) = = 0 ; } ) ; <nl> + } <nl> + <nl> + void SimpleEngine : : OnComplete ( SimpleOpr * simple_opr ) { <nl> + / * ! <nl> + * Mark complete for read variables . <nl> + * / <nl> + for ( auto & & i : simple_opr - > use_vars ) { <nl> + std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> + if ( - - i - > num_pending_reads = = 0 ) { <nl> + if ( i - > pending_write ! = nullptr & & <nl> + - - i - > pending_write - > trigger - > wait = = 0 ) { <nl> + task_queue_ . Push ( i - > pending_write - > trigger ) ; <nl> } <nl> } <nl> } <nl> - void OnOpFinished ( OpDescr * opd ) { <nl> - CHECK ( opd ) < < " completing a nullptr op ! " ; <nl> - for ( Variable v : opd - > read_vars ) { <nl> - VarDescr * vard = static_cast < VarDescr * > ( v ) ; / / safe to cast here <nl> - spin_lock ( & vard - > lock ) ; <nl> - CHECK ( vard - > rw > 0 ) < < " incorrect rw count ( reader ) : " < < vard - > rw ; <nl> - if ( - - vard - > rw = = 0 ) { <nl> - TriggerWaiting ( vard ) ; <nl> + / * ! <nl> + * Mark complete for write variables . <nl> + * / <nl> + for ( auto & & i : simple_opr - > mutate_vars ) { <nl> + bool to_delete = false ; <nl> + { <nl> + std : : lock_guard < std : : mutex > lock { i - > m } ; <nl> + assert ( i - > ready_to_read = = false ) ; <nl> + auto head = i - > pending_write - > next ; <nl> + VersionedVarBlock : : Delete ( i - > pending_write ) ; <nl> + i - > pending_write = nullptr ; <nl> + if ( i - > to_delete ) { <nl> + assert ( head - > next = = nullptr ) ; <nl> + VersionedVarBlock : : Delete ( head ) ; <nl> + to_delete = true ; <nl> + } else { <nl> + while ( true ) { <nl> + if ( head - > write = = true ) { <nl> + + + i - > num_pending_reads ; <nl> + i - > pending_write = head ; <nl> + if ( - - i - > num_pending_reads = = 0 ) { <nl> + if ( - - head - > trigger - > wait = = 0 ) { <nl> + task_queue_ . Push ( head - > trigger ) ; <nl> + } <nl> + } <nl> + break ; <nl> + } else if ( head - > next = = nullptr ) { <nl> + i - > ready_to_read = true ; <nl> + break ; <nl> + } else { <nl> + + + i - > num_pending_reads ; <nl> + if ( - - head - > trigger - > wait = = 0 ) { <nl> + task_queue_ . Push ( head - > trigger ) ; <nl> + } <nl> + auto prev = head ; <nl> + head = head - > next ; <nl> + VersionedVarBlock : : Delete ( prev ) ; <nl> + } <nl> + } <nl> } <nl> - spin_unlock ( & vard - > lock ) ; <nl> } <nl> - for ( Variable v : opd - > write_vars ) { <nl> - VarDescr * vard = static_cast < VarDescr * > ( v ) ; / / safe to cast here <nl> - spin_lock ( & vard - > lock ) ; <nl> - CHECK ( vard - > rw = = - 1 ) < < " incorrect rw count ( writer ) : " < < vard - > rw ; <nl> - vard - > rw = 0 ; <nl> - TriggerWaiting ( vard ) ; <nl> - spin_unlock ( & vard - > lock ) ; <nl> + if ( to_delete ) { <nl> + SimpleVar : : Delete ( i ) ; <nl> } <nl> - delete opd ; / / delete the operator <nl> } <nl> - RunContext GetRunContext ( const Context & ctx ) { <nl> - / / TODO ( minjie ) : get the correct runtime context <nl> - return RunContext ( ) ; <nl> - } <nl> - void OnDepsResolved ( OpDescr * opd ) { <nl> - static default_random_engine generator ; <nl> - static uniform_int_distribution < int > distribution ( 0 , numthreads_ - 1 ) ; <nl> - int thrid = distribution ( generator ) ; <nl> - / / LOG ( INFO ) < < " schedule operator " < < opd < < " to thread # " < < thrid ; <nl> - worker_queues_ [ thrid ] - > Push ( opd ) ; <nl> + { <nl> + std : : unique_lock < std : : mutex > lock { finished_m_ } ; <nl> + if ( - - pending_ = = 0 ) { <nl> + finished_cv_ . notify_all ( ) ; <nl> + } <nl> } <nl> - void WorkerRoutine ( int thrid ) { <nl> - OpDescr * opd = nullptr ; <nl> - while ( ! worker_queues_ [ thrid ] - > Pop ( opd ) ) { <nl> - / / LOG ( INFO ) < < " worker thread # " < < thrid < < " got operator " < < opd ; <nl> - opd - > op ( GetRunContext ( opd - > exec_ctx ) , [ this , opd ] ( ) { this - > OnOpFinished ( opd ) ; } ) ; <nl> - opd = nullptr ; <nl> + } <nl> + <nl> + void SimpleEngine : : ThreadWorker ( ) { <nl> + OprBlock * opr_block ; <nl> + while ( task_queue_ . Pop ( & opr_block ) ) { <nl> + assert ( opr_block - > wait . load ( ) = = 0 ) ; <nl> + auto simple_opr = opr_block - > opr ; <nl> + auto callback = [ this , simple_opr ] ( ) { <nl> + OnComplete ( simple_opr ) ; <nl> + if ( simple_opr - > temporary ) { <nl> + SimpleOpr : : Delete ( simple_opr ) ; <nl> + } <nl> + } ; <nl> + if ( opr_block - > ctx . dev_mask = = gpu : : kDevMask ) { <nl> + # if MXNET_USE_CUDA <nl> + CUDA_CALL ( cudaSetDevice ( opr_block - > ctx . dev_id ) ) ; <nl> + # else / / MXNET_USE_CUDA <nl> + LOG ( FATAL ) < < " Please compile with CUDA enabled " ; <nl> + # endif / / MXNET_USE_CUDA <nl> } <nl> + simple_opr - > fn ( opr_block - > rctx , callback ) ; <nl> + OprBlock : : Delete ( opr_block ) ; <nl> } <nl> + } <nl> <nl> - private : <nl> - const int numthreads_ ; <nl> - vector < ConcurrentBlockingQueue < OpDescr * > * > worker_queues_ ; <nl> - vector < thread > workers_ ; <nl> - } ; <nl> + } / / namespace engine <nl> <nl> - / / implements the singleton factory <nl> - DAGEngine * DAGEngine : : Get ( ) { <nl> - static ThreadedEngine engine ; <nl> - return & engine ; <nl> - } <nl> } / / namespace mxnet <nl> similarity index 100 % <nl> rename from src / dag_engine / simple_engine . h <nl> rename to src / dag_engine / threaded_engine . h <nl>
|
[ engine - refactor ] rename
|
apache/incubator-mxnet
|
25b9ee6df4f67cbbc03061f68a8b3d3a8b5f0517
|
2015-09-05T08:31:48Z
|
new file mode 100644 <nl> index 000000000 . . 9d38a3a34 <nl> mmm / dev / null <nl> ppp b / tests / YGZeroOutLayoutRecursivlyTest . cpp <nl> <nl> + / * * <nl> + * Copyright ( c ) 2014 - present , Facebook , Inc . <nl> + * All rights reserved . <nl> + * <nl> + * This source code is licensed under the BSD - style license found in the <nl> + * LICENSE file in the root directory of this source tree . An additional grant <nl> + * of patent rights can be found in the PATENTS file in the same directory . <nl> + * / <nl> + <nl> + # include < gtest / gtest . h > <nl> + # include < yoga / Yoga . h > <nl> + <nl> + TEST ( YogaTest , zero_out_layout ) { <nl> + const YGNodeRef root = YGNodeNew ( ) ; <nl> + YGNodeStyleSetFlexDirection ( root , YGFlexDirectionRow ) ; <nl> + YGNodeStyleSetWidth ( root , 200 ) ; <nl> + YGNodeStyleSetHeight ( root , 200 ) ; <nl> + <nl> + const YGNodeRef child = YGNodeNew ( ) ; <nl> + YGNodeInsertChild ( root , child , 0 ) ; <nl> + YGNodeStyleSetWidth ( child , 100 ) ; <nl> + YGNodeStyleSetHeight ( child , 100 ) ; <nl> + YGNodeStyleSetMargin ( child , YGEdgeTop , 10 ) ; <nl> + YGNodeStyleSetPadding ( child , YGEdgeTop , 10 ) ; <nl> + <nl> + YGNodeCalculateLayout ( root , 100 , 100 , YGDirectionLTR ) ; <nl> + <nl> + ASSERT_FLOAT_EQ ( 10 , YGNodeLayoutGetMargin ( child , YGEdgeTop ) ) ; <nl> + ASSERT_FLOAT_EQ ( 10 , YGNodeLayoutGetPadding ( child , YGEdgeTop ) ) ; <nl> + <nl> + YGNodeStyleSetDisplay ( child , YGDisplayNone ) ; <nl> + <nl> + YGNodeCalculateLayout ( root , 100 , 100 , YGDirectionLTR ) ; <nl> + <nl> + ASSERT_FLOAT_EQ ( 0 , YGNodeLayoutGetMargin ( child , YGEdgeTop ) ) ; <nl> + ASSERT_FLOAT_EQ ( 0 , YGNodeLayoutGetPadding ( child , YGEdgeTop ) ) ; <nl> + <nl> + YGNodeFreeRecursive ( root ) ; <nl> + } <nl> mmm a / yoga / Yoga . c <nl> ppp b / yoga / Yoga . c <nl> static bool YGNodeFixedSizeSetMeasuredDimensions ( const YGNodeRef node , <nl> } <nl> <nl> static void YGZeroOutLayoutRecursivly ( const YGNodeRef node ) { <nl> - node - > layout . dimensions [ YGDimensionHeight ] = 0 ; <nl> - node - > layout . dimensions [ YGDimensionWidth ] = 0 ; <nl> - node - > layout . position [ YGEdgeTop ] = 0 ; <nl> - node - > layout . position [ YGEdgeBottom ] = 0 ; <nl> - node - > layout . position [ YGEdgeLeft ] = 0 ; <nl> - node - > layout . position [ YGEdgeRight ] = 0 ; <nl> - node - > layout . cachedLayout . availableHeight = 0 ; <nl> - node - > layout . cachedLayout . availableWidth = 0 ; <nl> - node - > layout . cachedLayout . heightMeasureMode = YGMeasureModeExactly ; <nl> - node - > layout . cachedLayout . widthMeasureMode = YGMeasureModeExactly ; <nl> - node - > layout . cachedLayout . computedWidth = 0 ; <nl> - node - > layout . cachedLayout . computedHeight = 0 ; <nl> + memset ( & ( node - > layout ) , 0 , sizeof ( YGLayout ) ) ; <nl> node - > hasNewLayout = true ; <nl> const uint32_t childCount = YGNodeGetChildCount ( node ) ; <nl> for ( uint32_t i = 0 ; i < childCount ; i + + ) { <nl>
|
Zero out all fields in YGZeroOutLayoutRecursivly using memset
|
facebook/yoga
|
bcc36cc1b2a8e90a1bc2142b8615c84afc81b31c
|
2017-09-15T15:32:36Z
|
mmm a / CMake / CMakeLibs . cmake <nl> ppp b / CMake / CMakeLibs . cmake <nl> macro ( ADD_OSQUERY_LINK_INTERNAL LINK LINK_PATHS LINK_SET ) <nl> " $ { BUILD_DEPS } / lib " <nl> " $ { CMAKE_BUILD_DIR } / third - party / * / lib " <nl> $ { LINK_PATHS } <nl> - " / lib " <nl> - " / lib64 " <nl> - " / usr / lib " <nl> - " / usr / lib64 " <nl> - " / usr / lib / x86_64 - linux - gnu / " <nl> + $ { OS_LIB_DIRS } <nl> " $ ENV { HOME } " <nl> ) <nl> set ( LINK_PATHS_SYSTEM <nl> macro ( ADD_OSQUERY_LINK_INTERNAL LINK LINK_PATHS LINK_SET ) <nl> " $ { BUILD_DEPS } / legacy / lib " <nl> # Allow the build to search the default deps include for libz . <nl> " $ { BUILD_DEPS } / lib " <nl> - " / lib " <nl> - " / lib64 " <nl> - " / usr / lib " <nl> - " / usr / lib64 " <nl> - " / usr / lib / x86_64 - linux - gnu / " <nl> + $ { OS_LIB_DIRS } <nl> ) <nl> <nl> if ( NOT " $ { LINK } " MATCHES " ( ^ [ - / ] . * ) " ) <nl> string ( REPLACE " " " ; " ITEMS " $ { LINK } " ) <nl> foreach ( ITEM $ { ITEMS } ) <nl> if ( NOT DEFINED $ { $ { ITEM } _library } ) <nl> - if ( " $ { ITEM } " MATCHES " ( ^ lib . * ) " OR DEFINED ENV { BUILD_LINK_SHARED } ) <nl> + if ( " $ { ITEM } " MATCHES " ( ^ lib . * ) " OR " $ { ITEM } " MATCHES " ( . * lib $ ) " OR DEFINED ENV { BUILD_LINK_SHARED } ) <nl> # Use a system - provided library <nl> set ( ITEM_SYSTEM TRUE ) <nl> else ( ) <nl> macro ( ADD_OSQUERY_LINK_INTERNAL LINK LINK_PATHS LINK_SET ) <nl> endif ( ) <nl> if ( NOT $ { ITEM_SYSTEM } ) <nl> find_library ( " $ { ITEM } _library " <nl> - NAMES " lib $ { ITEM } . a " " $ { ITEM } " HINTS $ { LINK_PATHS_RELATIVE } ) <nl> + NAMES " $ { ITEM } . lib " " lib $ { ITEM } . lib " " lib $ { ITEM } . a " " $ { ITEM } " HINTS $ { LINK_PATHS_RELATIVE } ) <nl> else ( ) <nl> find_library ( " $ { ITEM } _library " <nl> - NAMES " lib $ { ITEM } . so " " lib $ { ITEM } . dylib " " $ { ITEM } . so " " $ { ITEM } . dylib " " $ { ITEM } " <nl> + NAMES " $ { ITEM } . lib " " lib $ { ITEM } . lib " " lib $ { ITEM } . so " " lib $ { ITEM } . dylib " " $ { ITEM } . so " " $ { ITEM } . dylib " " $ { ITEM } " <nl> HINTS $ { LINK_PATHS_SYSTEM } ) <nl> endif ( ) <nl> LOG_LIBRARY ( $ { ITEM } " $ { $ { ITEM } _library } " ) <nl> - if ( " $ { $ { ITEM } _library } " STREQUAL " $ { $ { ITEM } _library } - NOTFOUND " ) <nl> + if ( " $ { $ { ITEM } _library } " STREQUAL " $ { ITEM } _library - NOTFOUND " ) <nl> WARNING_LOG ( " Dependent library ' $ { ITEM } ' not found " ) <nl> list ( APPEND $ { LINK_SET } $ { ITEM } ) <nl> else ( ) <nl> macro ( ADD_OSQUERY_LIBRARY IS_CORE TARGET ) <nl> add_library ( $ { TARGET } OBJECT $ { ARGN } ) <nl> add_dependencies ( $ { TARGET } osquery_extensions ) <nl> # TODO ( # 1985 ) : For Windows , ignore the - static compiler flag <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> SET_OSQUERY_COMPILE ( $ { TARGET } " $ { CXX_COMPILE_FLAGS } / EHsc / MD " ) <nl> else ( ) <nl> SET_OSQUERY_COMPILE ( $ { TARGET } " $ { CXX_COMPILE_FLAGS } " ) # - static <nl> macro ( ADD_OSQUERY_OBJCXX_LIBRARY IS_CORE TARGET ) <nl> add_library ( $ { TARGET } OBJECT $ { ARGN } ) <nl> add_dependencies ( $ { TARGET } osquery_extensions ) <nl> # TODO ( # 1985 ) : For Windows , ignore the - static compiler flag <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> SET_OSQUERY_COMPILE ( $ { TARGET } " $ { CXX_COMPILE_FLAGS } $ { OBJCXX_COMPILE_FLAGS } / EHsc / MD " ) <nl> else ( ) <nl> SET_OSQUERY_COMPILE ( $ { TARGET } " $ { CXX_COMPILE_FLAGS } $ { OBJCXX_COMPILE_FLAGS } " ) <nl> endmacro ( ADD_OSQUERY_EXTENSION ) <nl> <nl> macro ( ADD_OSQUERY_MODULE TARGET ) <nl> add_library ( $ { TARGET } SHARED $ { ARGN } ) <nl> - if ( NOT FREEBSD AND NOT WIN32 ) <nl> + if ( NOT FREEBSD AND NOT WINDOWS ) <nl> target_link_libraries ( $ { TARGET } dl ) <nl> endif ( ) <nl> <nl> macro ( ADD_OSQUERY_MODULE TARGET ) <nl> endmacro ( ADD_OSQUERY_MODULE ) <nl> <nl> # Helper to abstract OS / Compiler whole linking . <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> macro ( TARGET_OSQUERY_LINK_WHOLE TARGET OSQUERY_LIB ) <nl> target_link_libraries ( $ { TARGET } " $ { OS_WHOLELINK_PRE } $ < TARGET_FILE_NAME : $ { OSQUERY_LIB } > " ) <nl> target_link_libraries ( $ { TARGET } $ { OSQUERY_LIB } ) <nl> macro ( GENERATE_TABLES TABLES_PATH ) <nl> elseif ( DEBIAN_BASED ) <nl> list ( APPEND TABLE_CATEGORIES " ubuntu " ) <nl> endif ( ) <nl> - elseif ( WIN32 ) <nl> + elseif ( WINDOWS ) <nl> list ( APPEND TABLE_CATEGORIES " windows " ) <nl> else ( ) <nl> message ( FATAL_ERROR " Unknown platform detected , cannot generate tables " ) <nl> mmm a / CMake / Packages . cmake <nl> ppp b / CMake / Packages . cmake <nl> if ( APPLE ) <nl> add_custom_target ( <nl> packages <nl> COMMAND bash " $ { CMAKE_SOURCE_DIR } / tools / deployment / make_osx_package . sh " <nl> - COMMAND python " $ { CMAKE_SOURCE_DIR } / tools / codegen / genapi . py " " $ { CMAKE_SOURCE_DIR } " <nl> + COMMAND $ { PYTHON_EXECUTABLE } " $ { CMAKE_SOURCE_DIR } / tools / codegen / genapi . py " " $ { CMAKE_SOURCE_DIR } " <nl> " - - output " " - - directory " " $ { CMAKE_BINARY_DIR } " <nl> WORKING_DIRECTORY " $ { CMAKE_SOURCE_DIR } " <nl> COMMENT " Building default OS X package ( no custom config ) " VERBATIM <nl> elseif ( LINUX ) <nl> COMMAND bash " $ { CMAKE_SOURCE_DIR } / tools / deployment / make_linux_package . sh " <nl> - t $ { PACKAGE_TYPE } - i " $ { PACKAGE_ITERATION } " <nl> - d " $ { PACKAGE_DEPENDENCIES } " <nl> - COMMAND python " $ { CMAKE_SOURCE_DIR } / tools / codegen / genapi . py " " $ { CMAKE_SOURCE_DIR } " <nl> + COMMAND $ { PYTHON_EXECUTABLE } " $ { CMAKE_SOURCE_DIR } / tools / codegen / genapi . py " " $ { CMAKE_SOURCE_DIR } " <nl> " - - output " " - - directory " " $ { CMAKE_BINARY_DIR } " <nl> WORKING_DIRECTORY " $ { CMAKE_SOURCE_DIR } " <nl> COMMENT " Building linux packages ( no custom config ) " VERBATIM <nl> mmm a / CMakeLists . txt <nl> ppp b / CMakeLists . txt <nl> else ( ) <nl> set ( BUILD_DEPS " / usr / local / osquery " ) <nl> endif ( ) <nl> <nl> + if ( WIN32 ) <nl> + set ( WINDOWS_DEP_DIR " $ ENV { ChocolateyInstall } / lib " ) <nl> + string ( REGEX REPLACE " \ \ \ \ " " / " WINDOWS_DEP_DIR $ { WINDOWS_DEP_DIR } ) <nl> + list ( APPEND WINDOWS_DEP_LIST $ { WINDOWS_DEP_DIR } ) <nl> + list ( APPEND WINDOWS_DEP_LIST " $ ENV { HOMEDRIVE } / local / boost - msvc14 " ) <nl> + <nl> + list ( APPEND CMAKE_PROGRAM_PATH " $ { WINDOWS_DEP_DIR } / * / tools " ) <nl> + endif ( ) <nl> + <nl> # If no explicit compiler override and clang + + exists , prefer clang . <nl> find_program ( CLANGXX_EXISTS " clang + + " ENV PATH ) <nl> if ( DEFINED ENV { CC } ) <nl> endif ( ) <nl> set ( C_COMPILE_FLAGS " " ) <nl> set ( CXX_COMPILE_FLAGS " " ) <nl> <nl> - if ( NOT WIN32 ) <nl> - find_program ( THRIFT_COMPILER " thrift " ENV PATH ) <nl> - find_program ( PYTHON_EXECUTABLE " python " ENV PATH ) <nl> - endif ( ) <nl> + find_program ( PYTHON_EXECUTABLE " python " ENV PATH ) <nl> + find_program ( THRIFT_COMPILER " thrift " ENV PATH ) <nl> <nl> # Use osquery language to set platform / os <nl> if ( DEFINED ENV { OSQUERY_PLATFORM } ) <nl> set ( PLATFORM " $ ENV { OSQUERY_PLATFORM } " ) <nl> else ( ) <nl> execute_process ( <nl> - COMMAND python " $ { CMAKE_SOURCE_DIR } / tools / get_platform . py " <nl> + COMMAND $ { PYTHON_EXECUTABLE } " $ { CMAKE_SOURCE_DIR } / tools / get_platform . py " <nl> WORKING_DIRECTORY " $ { CMAKE_SOURCE_DIR } " <nl> OUTPUT_VARIABLE PLATFORM <nl> OUTPUT_STRIP_TRAILING_WHITESPACE <nl> set ( ENV { SKIP_BENCHMARKS } TRUE ) <nl> if ( DEFINED ENV { DEBUG } ) <nl> set ( DEBUG TRUE ) <nl> set ( CMAKE_BUILD_TYPE " Debug " ) <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> # TODO ( # 1985 ) : Is there a MSVC flag congruent to - fstandalone - debug ? <nl> add_compile_options ( <nl> / Zi <nl> elseif ( DEFINED ENV { SANITIZE } ) <nl> add_definitions ( - fsanitize - blacklist = $ { SANITIZE_BLACKLIST } ) <nl> else ( ) <nl> set ( DEBUG FALSE ) <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> add_compile_options ( / Ot ) <nl> else ( ) <nl> add_compile_options ( - Os ) <nl> else ( ) <nl> # Do not enable fortify with clang : http : / / llvm . org / bugs / show_bug . cgi ? id = 16821 <nl> # set ( C_COMPILE_FLAGS " $ { C_COMPILE_FLAGS } - D_FORTIFY_SOURCE = 2 " ) <nl> <nl> - # TSAN and MSAN do not like PIE / PIC on Linux 4 . 1 . <nl> - # To be safe , only include them when building ' release ' outputs . <nl> - add_compile_options ( <nl> - - fPIE <nl> - - fpie <nl> - - fPIC <nl> - - fpic <nl> - ) <nl> + # Visual Studio does not support generation of PIC code <nl> + if ( NOT WINDOWS ) <nl> + # TSAN and MSAN do not like PIE / PIC on Linux 4 . 1 . <nl> + # To be safe , only include them when building ' release ' outputs . <nl> + add_compile_options ( <nl> + - fPIE <nl> + - fpie <nl> + - fPIC <nl> + - fpic <nl> + ) <nl> + endif ( ) <nl> endif ( ) <nl> # Generate a compile_commands . json for static analyzer input . <nl> set ( CMAKE_EXPORT_COMPILE_COMMANDS ON ) <nl> <nl> if ( NOT DEFINED ENV { OPTIMIZED } ) <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> # It is unclear if AVX must be managed on Windows . <nl> add_compile_options ( / favor : AMD64 ) <nl> else ( ) <nl> endif ( ) <nl> # make analyze ( environment variable from Makefile ) <nl> if ( DEFINED ENV { ANALYZE } ) <nl> # TODO ( # 1985 ) : clang - analyze on Windows <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> message ( FATAL_ERROR " Cannot analyze on Windows right now . " ) <nl> else ( ) <nl> set ( CMAKE_CXX_COMPILER " $ { CMAKE_SOURCE_DIR } / tools / analysis / clang - analyze . sh " ) <nl> elseif ( LINUX ) <nl> include_directories ( SYSTEM " $ { CMAKE_SOURCE_DIR } / third - party / sysroots / linux " ) <nl> endif ( ) <nl> <nl> - if ( NOT WIN32 ) <nl> + if ( NOT WINDOWS ) <nl> include_directories ( SYSTEM " $ { BUILD_DEPS } / legacy / include " ) <nl> include_directories ( SYSTEM " $ { BUILD_DEPS } / include " ) <nl> include_directories ( " $ { BUILD_DEPS } / include / openssl " ) <nl> include_directories ( " $ { CMAKE_SOURCE_DIR } / include " ) <nl> include_directories ( " $ { CMAKE_SOURCE_DIR } " ) <nl> <nl> set ( MKDIR_OPTS " " ) <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> set ( PROCESS_FAMILY " windows " ) <nl> <nl> - set ( WINDOWS_DEP_DIR " $ ENV { ChocolateyInstall } / lib " ) <nl> - string ( REGEX REPLACE " \ \ \ \ " " / " WINDOWS_DEP_DIR $ { WINDOWS_DEP_DIR } ) <nl> - set ( BOOST_DEP_DIR " $ ENV { HOMEDRIVE } / local / boost - msvc14 " ) <nl> - <nl> - # Win64 specific BZIP2 variables <nl> - set ( BZIP2_INCLUDE_DIR " $ { WINDOWS_DEP_DIR } / bzip2 / local / include " ) <nl> - set ( BZIP2_LIBRARIES " $ { WINDOWS_DEP_DIR } / bzip2 / local / lib / libbz2 . lib " ) <nl> - <nl> - # Win64 specific OpenSSL variables <nl> - set ( OPENSSL_ROOT_DIR " $ { WINDOWS_DEP_DIR } / openssl / local / lib " ) <nl> - set ( OPENSSL_INCLUDE_DIR " $ { WINDOWS_DEP_DIR } / openssl / local / include " ) <nl> - set ( OPENSSL_CRYPTO_LIBRARY " $ { WINDOWS_DEP_DIR } / openssl / local / lib / libeay32 . lib " ) <nl> - set ( OPENSSL_SSL_LIBRARY " $ { WINDOWS_DEP_DIR } / openssl / local / lib / ssleay32 . lib " ) <nl> - set ( OPENSSL_LIBRARIES $ { OPENSSL_SSL_LIBRARY } $ { OPENSSL_CRYPTO_LIBRARY } ) <nl> - set ( OPENSSL_USE_STATIC_LIBS TRUE ) <nl> - <nl> - # Win64 specific Thrift <nl> - set ( THRIFT_INCLUDE_DIR " $ { WINDOWS_DEP_DIR } / thrift - dev / local / include " ) <nl> - set ( thrift_library " $ { WINDOWS_DEP_DIR } / thrift - dev / local / lib / thriftmd . lib " ) <nl> - set ( THRIFT_COMPILER " $ { WINDOWS_DEP_DIR } / thrift / tools / thrift . exe " ) <nl> - <nl> - # Win64 specific rocksdb <nl> - set ( ROCKSDB_STATIC_LIBRARY " $ { WINDOWS_DEP_DIR } / rocksdb / local / lib / rocksdblib . lib " ) <nl> - set ( ROCKSDB_SNAPPY_LIBRARY " $ { WINDOWS_DEP_DIR } / snappy - msvc / tools / snappy - windows - 1 . 1 . 1 . 8 / native / snappy64 . lib " ) <nl> - <nl> - # Win64 specific doxygen <nl> - set ( DOXYGEN_EXECUTABLE " $ { WINDOWS_DEP_DIR } / doxygen / tools / doxygen . exe " ) <nl> - <nl> - # Win64 specific boost <nl> - set ( boost_filesystem_library " $ { BOOST_DEP_DIR } / lib64 - msvc - 14 . 0 / libboost_filesystem - vc140 - mt - 1_59 . lib " ) <nl> - set ( boost_system_library " $ { BOOST_DEP_DIR } / lib64 - msvc - 14 . 0 / libboost_system - vc140 - mt - 1_59 . lib " ) <nl> - set ( boost_regex_library " $ { BOOST_DEP_DIR } / lib64 - msvc - 14 . 0 / libboost_regex - vc140 - mt - 1_59 . lib " ) <nl> - <nl> # Win64 specific gflags <nl> set ( BUILD_SHARED_LIBS ON CACHE BOOL " Build shared gtest library " FORCE ) <nl> - set ( gflags_library " $ { WINDOWS_DEP_DIR } / gflags - dev / local / lib / gflags_static . lib " ) <nl> <nl> - # Win64 specific glog <nl> - set ( glog_library " $ { WINDOWS_DEP_DIR } / glog / local / lib / glog . lib " ) <nl> + include_directories ( " $ ENV { HOMEDRIVE } / local / boost - msvc14 / boost " ) <nl> + include_directories ( " $ ENV { HOMEDRIVE } / local / boost - msvc14 " ) <nl> + file ( GLOB INCLUDE_DIRS LIST_DIRECTORIES true " $ { WINDOWS_DEP_DIR } / * / * / include " ) <nl> + include_directories ( $ { INCLUDE_DIRS } ) <nl> <nl> - # Win64 specific cpp - netlib library <nl> - set ( cppnetlib - uri_library " $ { WINDOWS_DEP_DIR } / cpp - netlib / local / lib / cppnetlib - uri . lib " ) <nl> - set ( cppnetlib - client - connections_library " $ { WINDOWS_DEP_DIR } / cpp - netlib / local / lib / cppnetlib - client - connections . lib " ) <nl> - <nl> - <nl> - include_directories ( " $ { THRIFT_INCLUDE_DIR } " ) <nl> - include_directories ( " $ { BOOST_DEP_DIR } " ) <nl> - include_directories ( " $ { BOOST_DEP_DIR } / boost " ) <nl> - include_directories ( " $ { WINDOWS_DEP_DIR } / glog / local / include " ) <nl> - include_directories ( " $ { WINDOWS_DEP_DIR } / gflags - dev / local / include " ) <nl> - <nl> - # TODO ( FIXME ) : temporary for now <nl> - include_directories ( " $ { WINDOWS_DEP_DIR } / cpp - netlib / local / include " ) <nl> + # # TODO ( FIXME ) : temporary for now <nl> include_directories ( " $ { WINDOWS_DEP_DIR } / linenoise - ng / local / include / linenoise " ) <nl> include_directories ( " $ { WINDOWS_DEP_DIR } / snappy - msvc / tools / snappy - windows - 1 . 1 . 1 . 8 / include " ) <nl> - include_directories ( " $ { WINDOWS_DEP_DIR } / rocksdb / local / include " ) <nl> - <nl> - # TODO ( # 1990 ) : We probably need to add our third - party link directories here <nl> - link_directories ( " $ { BOOST_DEP_DIR } / lib64 - msvc - 14 . 0 " ) <nl> - link_directories ( " $ { WINDOWS_DEP_DIR } / linenoise - ng / local / lib " ) <nl> else ( ) <nl> set ( PROCESS_FAMILY " posix " ) <nl> set ( MKDIR_OPTS " - p " ) <nl> endif ( ) <nl> <nl> + if ( WINDOWS ) <nl> + foreach ( DEP_DIR $ { WINDOWS_DEP_LIST } ) <nl> + file ( GLOB_RECURSE WINDOWS_LOCAL_LIB_DIRS LIST_DIRECTORIES false " $ { DEP_DIR } / * . lib " ) <nl> + foreach ( LIB_FILE $ { WINDOWS_LOCAL_LIB_DIRS } ) <nl> + get_filename_component ( LIB_DIR $ { LIB_FILE } DIRECTORY ) <nl> + list ( APPEND OS_LIB_DIRS $ { LIB_DIR } ) <nl> + endforeach ( ) <nl> + endforeach ( ) <nl> + list ( REMOVE_DUPLICATES OS_LIB_DIRS ) <nl> + link_directories ( $ { OS_LIB_DIRS } ) <nl> + else ( ) <nl> + set ( OS_LIB_DIRS <nl> + " / lib " <nl> + " / lib64 " <nl> + " / usr / lib " <nl> + " / usr / lib64 " <nl> + " / usr / lib / x86_64 - linux - gnu / " <nl> + ) <nl> + endif ( ) <nl> + <nl> # Make sure the generated paths exist <nl> execute_process ( COMMAND mkdir $ { MKDIR_OPTS } " $ { CMAKE_BINARY_DIR } / generated " ) <nl> <nl> # We need to link some packages as dynamic / dependent . <nl> - set ( CMAKE_FIND_LIBRARY_SUFFIXES . dll . dylib . so . a ) <nl> + set ( CMAKE_FIND_LIBRARY_SUFFIXES . lib . dylib . so . a ) <nl> <nl> # Most dependent packages / libs we want static . <nl> if ( DEFINED ENV { BUILD_LINK_SHARED } ) <nl> set ( ENV { OSQUERY_BUILD_LINK_SHARED } TRUE ) <nl> endif ( ) <nl> if ( NOT DEFINED ENV { OSQUERY_BUILD_LINK_SHARED } ) <nl> - set ( CMAKE_FIND_LIBRARY_SUFFIXES . a . dylib . so ) <nl> + set ( CMAKE_FIND_LIBRARY_SUFFIXES . lib . a . dylib . so ) <nl> endif ( ) <nl> <nl> # Previously , this would find_package for Gtest . <nl> mmm a / osquery / CMakeLists . txt <nl> ppp b / osquery / CMakeLists . txt <nl> set ( OSQUERY_ADDITIONAL_TESTS " " ) <nl> set ( OSQUERY_TABLES_TESTS " " ) <nl> <nl> # Add all and extra for osquery code . <nl> - # TODO ( WIN64 ) : Changes for Win64 CMake <nl> if ( WINDOWS ) <nl> add_compile_options ( / W3 ) <nl> else ( ) <nl> if ( WINDOWS ) <nl> ADD_OSQUERY_LINK_CORE ( " shlwapi . lib " ) <nl> ADD_OSQUERY_LINK_CORE ( " wbemuuid . lib " ) <nl> ADD_OSQUERY_LINK_CORE ( " linenoise . lib " ) <nl> + ADD_OSQUERY_LINK_CORE ( " boost_system - vc140 - mt - 1_59 " ) <nl> + ADD_OSQUERY_LINK_CORE ( " boost_regex - vc140 - mt - 1_59 " ) <nl> + ADD_OSQUERY_LINK_CORE ( " boost_filesystem - vc140 - mt - 1_59 " ) <nl> + ADD_OSQUERY_LINK_CORE ( " rocksdblib " ) <nl> + ADD_OSQUERY_LINK_CORE ( " snappy64 " ) <nl> + ADD_OSQUERY_LINK_CORE ( " gflags_static " ) <nl> + ADD_OSQUERY_LINK_CORE ( " thriftmd " ) <nl> else ( ) <nl> ADD_OSQUERY_LINK_CORE ( " libpthread " ) <nl> ADD_OSQUERY_LINK_CORE ( " libz " ) <nl> + ADD_OSQUERY_LINK_CORE ( " lz4 " ) <nl> + ADD_OSQUERY_LINK_CORE ( " boost_system - mt " ) <nl> + ADD_OSQUERY_LINK_CORE ( " boost_filesystem - mt " ) <nl> + ADD_OSQUERY_LINK_CORE ( " boost_regex - mt " ) <nl> + ADD_OSQUERY_LINK_CORE ( " rocksdb_lite " ) <nl> + ADD_OSQUERY_LINK_CORE ( " snappy " ) <nl> + ADD_OSQUERY_LINK_CORE ( " gflags " ) <nl> + ADD_OSQUERY_LINK_CORE ( " thrift " ) <nl> endif ( ) <nl> <nl> if ( APPLE OR LINUX ) <nl> if ( LINUX OR FREEBSD ) <nl> ADD_OSQUERY_LINK_CORE ( " libc " ) <nl> endif ( ) <nl> <nl> - ADD_OSQUERY_LINK_CORE ( " rocksdb_lite " ) <nl> - ADD_OSQUERY_LINK_CORE ( " snappy " ) <nl> - ADD_OSQUERY_LINK_CORE ( " lz4 " ) <nl> - ADD_OSQUERY_LINK_CORE ( " thrift " ) <nl> - ADD_OSQUERY_LINK_CORE ( " gflags " ) <nl> ADD_OSQUERY_LINK_CORE ( " glog " ) <nl> - ADD_OSQUERY_LINK_CORE ( " boost_system - mt " ) <nl> - ADD_OSQUERY_LINK_CORE ( " boost_filesystem - mt " ) <nl> - ADD_OSQUERY_LINK_CORE ( " boost_regex - mt " ) <nl> + # Remaining additional development libraries . <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " cppnetlib - uri " ) <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " cppnetlib - client - connections " ) <nl> <nl> - if ( NOT WINDOWS ) <nl> + if ( WINDOWS ) <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " ssleay32 " ) <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " eay32 " ) <nl> + else ( ) <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " ssl " ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " yara " ) <nl> - # This is needed for the hash functions ( and hash table ) . <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " readline " ) <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " ncurses " ) <nl> + ADD_OSQUERY_LINK_ADDITIONAL ( " crypto " ) <nl> ADD_OSQUERY_LINK_CORE ( " crypto " ) <nl> endif ( ) <nl> <nl> - # Remaining additional development libraries . <nl> - ADD_OSQUERY_LINK_ADDITIONAL ( " cppnetlib - uri " ) <nl> - ADD_OSQUERY_LINK_ADDITIONAL ( " cppnetlib - client - connections " ) <nl> - ADD_OSQUERY_LINK_ADDITIONAL ( " ssl " ) <nl> - ADD_OSQUERY_LINK_ADDITIONAL ( " crypto " ) <nl> - ADD_OSQUERY_LINK_ADDITIONAL ( " readline " ) <nl> - ADD_OSQUERY_LINK_ADDITIONAL ( " ncurses " ) <nl> - <nl> if ( APPLE ) <nl> ADD_OSQUERY_LINK_CORE ( " liblzma libbz2 " ) <nl> else ( ) <nl> - ADD_OSQUERY_LINK_CORE ( " lzma bz2 " ) <nl> + if ( NOT WINDOWS ) <nl> + ADD_OSQUERY_LINK_CORE ( " lzma " ) <nl> + endif ( ) <nl> + ADD_OSQUERY_LINK_CORE ( " bz2 " ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " bz2 " ) <nl> endif ( ) <nl> <nl> # The platform - specific SDK + core linker flags . <nl> - ADD_OSQUERY_LINK_CORE ( " - rdynamic " ) <nl> + if ( NOT WINDOWS ) <nl> + ADD_OSQUERY_LINK_CORE ( " - rdynamic " ) <nl> + endif ( ) <nl> if ( APPLE ) <nl> ADD_OSQUERY_LINK_CORE ( " - Wl , - dead_strip " ) <nl> ADD_OSQUERY_LINK_CORE ( " - mmacosx - version - min = $ { OSX_VERSION_MIN } " ) <nl> endif ( ) <nl> # A friendly echo printed after the library is built . <nl> add_custom_target ( osquery_library ALL <nl> COMMAND $ { CMAKE_COMMAND } - E cmake_echo_color - - cyan - - bold <nl> - " - - Built libosquery : $ { CMAKE_BINARY_DIR } / libosquery . a " <nl> + " - - Built libosquery : $ < TARGET_FILE : libosquery > " <nl> DEPENDS libosquery <nl> ) <nl> <nl> if ( NOT $ { OSQUERY_BUILD_SDK_ONLY } ) <nl> endif ( ) <nl> SET_OSQUERY_COMPILE ( shell " $ { CXX_COMPILE_FLAGS } " ) <nl> set_target_properties ( shell PROPERTIES OUTPUT_NAME osqueryi ) <nl> - add_dependencies ( shell osquery_tools ) <nl> <nl> add_executable ( daemon main / $ { PROCESS_FAMILY } / daemon . cpp ) <nl> if ( DEFINED ENV { OSQUERY_BUILD_SHARED } ) <nl> if ( NOT $ { OSQUERY_BUILD_SDK_ONLY } ) <nl> PATTERN " . * " EXCLUDE <nl> ) <nl> <nl> - # A friendly echo printed after the library is built . <nl> - add_custom_target ( osquery_tools ALL <nl> + # A friendly echo printed before building the shell <nl> + add_custom_command ( TARGET shell PRE_BUILD <nl> + COMMAND $ { CMAKE_COMMAND } - E cmake_echo_color - - cyan - - bold <nl> + " - - Building osqueryi : $ < TARGET_FILE : shell > " <nl> + ) <nl> + <nl> + # A friendly echo printed before building the daemon <nl> + add_custom_command ( TARGET daemon PRE_BUILD <nl> COMMAND $ { CMAKE_COMMAND } - E cmake_echo_color - - cyan - - bold <nl> - " - - Building osqueryi : $ { CMAKE_BINARY_DIR } / osquery / osqueryi " <nl> - " - - Building osqueryd : $ { CMAKE_BINARY_DIR } / osquery / osqueryd " <nl> + " - - Building osqueryd : $ < TARGET_FILE : daemon > " <nl> ) <nl> <nl> # make install ( executables ) <nl> mmm a / osquery / config / CMakeLists . txt <nl> ppp b / osquery / config / CMakeLists . txt <nl> ADD_OSQUERY_LIBRARY ( TRUE osquery_config <nl> packs . cpp <nl> ) <nl> <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> set ( OSQUERY_CONFIG_PLUGINS " plugins / filesystem . cpp " ) <nl> else ( ) <nl> file ( GLOB OSQUERY_CONFIG_PLUGINS " plugins / * . cpp " ) <nl> mmm a / osquery / distributed / CMakeLists . txt <nl> ppp b / osquery / distributed / CMakeLists . txt <nl> ADD_OSQUERY_LIBRARY ( TRUE osquery_distributed <nl> distributed . cpp <nl> ) <nl> <nl> - if ( NOT WIN32 ) <nl> + if ( NOT WINDOWS ) <nl> ADD_OSQUERY_LIBRARY ( FALSE osquery_distributed_plugins <nl> plugins / tls . cpp <nl> ) <nl> mmm a / osquery / events / CMakeLists . txt <nl> ppp b / osquery / events / CMakeLists . txt <nl> if ( APPLE ) <nl> elseif ( FREEBSD ) <nl> file ( GLOB OSQUERY_EVENTS_FREEBSD " freebsd / * . cpp " ) <nl> ADD_OSQUERY_LIBRARY ( FALSE osquery_events_freebsd $ { OSQUERY_EVENTS_FREEBSD } ) <nl> - elseif ( WIN32 ) <nl> + elseif ( WINDOWS ) <nl> # TODO : When we have Windows events , uncomment these <nl> # file ( GLOB OSQUERY_EVENTS_WINDOWS " windows / * . cpp " ) <nl> # ADD_OSQUERY_LIBRARY ( FALSE osquery_events_windows $ { OSQUERY_EVENTS_WINDOWS } ) <nl> ADD_OSQUERY_LIBRARY ( TRUE osquery_events <nl> events . cpp <nl> ) <nl> <nl> - if ( NOT WIN32 ) <nl> + if ( NOT WINDOWS ) <nl> file ( GLOB OSQUERY_EVENTS_TESTS " tests / * . cpp " ) <nl> ADD_OSQUERY_TEST ( TRUE $ { OSQUERY_EVENTS_TESTS } ) <nl> <nl> mmm a / osquery / extensions / CMakeLists . txt <nl> ppp b / osquery / extensions / CMakeLists . txt <nl> add_custom_command ( <nl> OUTPUT $ { OSQUERY_THRIFT_GENERATED_FILES } <nl> ) <nl> <nl> - if ( NOT WIN32 ) <nl> + if ( NOT WINDOWS ) <nl> add_compile_options ( <nl> - Wno - macro - redefined <nl> ) <nl> mmm a / osquery / logger / CMakeLists . txt <nl> ppp b / osquery / logger / CMakeLists . txt <nl> <nl> file ( GLOB OSQUERY_LOGGER " * . cpp " ) <nl> ADD_OSQUERY_LIBRARY ( TRUE osquery_logger $ { OSQUERY_LOGGER } ) <nl> <nl> - if ( WIN32 ) <nl> + if ( WINDOWS ) <nl> file ( GLOB OSQUERY_LOGGER_PLUGINS " plugins / filesystem . cpp " ) <nl> file ( GLOB OSQUERY_LOGGER_PLUGIN_TESTS " plugins / tests / filesystem_logger_tests . cpp " ) <nl> else ( ) <nl> mmm a / osquery / tables / CMakeLists . txt <nl> ppp b / osquery / tables / CMakeLists . txt <nl> elseif ( FREEBSD ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " kvm " ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " elf " ) <nl> ADD_OSQUERY_LINK_ADDITIONAL ( " magic " ) <nl> - elseif ( WIN32 ) <nl> + elseif ( WINDOWS ) <nl> # Windows specific tables <nl> file ( GLOB OSQUERY_WINDOWS_TABLES " * / windows / * . cpp " ) <nl> ADD_OSQUERY_LIBRARY_ADDITIONAL ( osquery_tables_windows <nl> else ( ) <nl> endif ( ) <nl> <nl> # TODO : These tables should be made Windows - compatible <nl> - if ( NOT WIN32 ) <nl> + if ( NOT WINDOWS ) <nl> file ( GLOB OSQUERY_CROSS_APPLICATIONS_TABLES " applications / * . cpp " ) <nl> file ( GLOB OSQUERY_CROSS_NETWORKING_TABLES " networking / * . cpp " ) <nl> file ( GLOB OSQUERY_CROSS_FORENSIC_TABLES " forensic / * . cpp " ) <nl> ADD_OSQUERY_LIBRARY_CORE ( osquery_tables_utility <nl> $ { OSQUERY_UTILITY_TABLES } <nl> ) <nl> <nl> - if ( NOT FREEBSD AND NOT WIN32 ) <nl> + if ( NOT FREEBSD AND NOT WINDOWS ) <nl> file ( GLOB OSQUERY_UTILS " other / * . cpp " ) <nl> ADD_OSQUERY_LIBRARY_ADDITIONAL ( osquery_utils <nl> $ { OSQUERY_UTILS } <nl>
|
Fix Windows under 1 . 8 build system ( )
|
osquery/osquery
|
d8bfe962aae9699da0b953a7b9eed649da784ac1
|
2016-08-10T21:06:47Z
|
mmm a / tensorflow / core / kernels / map_kernels . cc <nl> ppp b / tensorflow / core / kernels / map_kernels . cc <nl> REGISTER_KERNEL_BUILDER ( Name ( " EmptyTensorMap " ) . Device ( DEVICE_CPU ) , <nl> REGISTER_KERNEL_BUILDER ( Name ( " TensorMapSize " ) . Device ( DEVICE_CPU ) , <nl> TensorMapSize ) ; <nl> <nl> + REGISTER_KERNEL_BUILDER ( Name ( " TensorMapLookup " ) . Device ( DEVICE_CPU ) , <nl> + TensorMapLookup ) ; <nl> <nl> + REGISTER_KERNEL_BUILDER ( Name ( " TensorMapErase " ) . Device ( DEVICE_CPU ) , <nl> + TensorMapErase ) ; <nl> <nl> REGISTER_KERNEL_BUILDER ( Name ( " ZeroOut " ) . Device ( DEVICE_CPU ) , <nl> ZeroOutOp ) ; <nl> mmm a / tensorflow / core / kernels / map_kernels . h <nl> ppp b / tensorflow / core / kernels / map_kernels . h <nl> class TensorMapSize : public OpKernel { <nl> class TensorMapInsert : public OpKernel { <nl> public : <nl> explicit TensorMapInsert ( OpKernelConstruction * c ) : OpKernel ( c ) { <nl> - / / OP_REQUIRES_OK ( c , c - > GetAttr ( " element_dtype " , & element_dtype_ ) ) ; <nl> + OP_REQUIRES_OK ( c , c - > GetAttr ( " element_dtype " , & element_dtype_ ) ) ; <nl> } <nl> ~ TensorMapInsert ( ) override { } <nl> <nl> class TensorMapInsert : public OpKernel { <nl> " list size : " , l - > tensors ( ) . size ( ) , <nl> " max_num_elements : " , l - > max_num_elements ) ) ; <nl> } * / <nl> - <nl> TensorMap * output_map = nullptr ; <nl> OP_REQUIRES_OK ( c , ForwardInputOrCreateNewMap ( c , 0 , 0 , * m , & output_map ) ) ; <nl> std : : cout < < " create output " < < std : : endl ; <nl> class TensorMapInsert : public OpKernel { <nl> REGISTER_KERNEL_BUILDER ( Name ( " TensorMapInsert " ) . Device ( DEVICE_CPU ) , <nl> TensorMapInsert ) ; <nl> <nl> + class TensorMapLookup : public OpKernel { <nl> + public : <nl> + explicit TensorMapLookup ( OpKernelConstruction * c ) : OpKernel ( c ) { <nl> + OP_REQUIRES_OK ( c , c - > GetAttr ( " element_dtype " , & element_dtype_ ) ) ; <nl> + } <nl> + ~ TensorMapLookup ( ) override { } <nl> + <nl> + void Compute ( OpKernelContext * c ) override { <nl> + std : : cout < < " hello TensorMapInsert kernel " < < std : : endl ; <nl> + const Tensor & temp_key = c - > input ( 1 ) ; <nl> + const TensorKey key = TensorKey ( temp_key ) ; <nl> + std : : cout < < " got key " < < std : : endl ; <nl> + const TensorMap * m = nullptr ; <nl> + OP_REQUIRES_OK ( c , GetInputMap ( c , 0 , & m ) ) ; <nl> + std : : cout < < " got map " < < std : : endl ; <nl> + c - > set_output ( 0 , m - > tensors ( ) . find ( key ) - > second ) ; <nl> + std : : cout < < " finished " < < std : : endl ; <nl> + } <nl> + <nl> + private : <nl> + DataType element_dtype_ ; <nl> + } ; <nl> + <nl> + class TensorMapErase : public OpKernel { <nl> + public : <nl> + explicit TensorMapErase ( OpKernelConstruction * c ) : OpKernel ( c ) { <nl> + OP_REQUIRES_OK ( c , c - > GetAttr ( " element_dtype " , & element_dtype_ ) ) ; <nl> + } <nl> + <nl> + void Compute ( OpKernelContext * c ) override { <nl> + std : : cout < < " hello TensorMapErase op " < < std : : endl ; <nl> + const TensorMap * m = nullptr ; <nl> + OP_REQUIRES_OK ( c , GetInputMap ( c , 0 , & m ) ) ; <nl> + const Tensor & temp_key = c - > input ( 1 ) ; <nl> + const TensorKey key = TensorKey ( temp_key ) ; <nl> + / * OP_REQUIRES ( c , element_dtype_ = = l - > element_dtype , <nl> + errors : : InvalidArgument ( " Invalid data types ; op elements " , <nl> + DataTypeString ( element_dtype_ ) , <nl> + " but list elements " , <nl> + DataTypeString ( l - > element_dtype ) ) ) ; * / <nl> + <nl> + OP_REQUIRES ( c , ! m - > tensors ( ) . empty ( ) , <nl> + errors : : InvalidArgument ( " Trying to erase from an empty map . " ) ) ; <nl> + <nl> + OP_REQUIRES ( c , m - > tensors ( ) . find ( key ) ! = m - > tensors ( ) . end ( ) , <nl> + errors : : InvalidArgument ( " Trying to erase non - existent item . " ) ) ; <nl> + <nl> + const Tensor & t = m - > tensors ( ) . find ( key ) - > second ; <nl> + c - > set_output ( 1 , t ) ; <nl> + / * if ( t . dtype ( ) ! = DT_INVALID ) { <nl> + c - > set_output ( 1 , t ) ; <nl> + } else { <nl> + PartialTensorShape partial_element_shape ; <nl> + OP_REQUIRES_OK ( <nl> + c , GetElementShapeFromInput ( c , * l , 1 , & partial_element_shape ) ) ; <nl> + TensorShape element_shape ; <nl> + OP_REQUIRES ( <nl> + c , partial_element_shape . AsTensorShape ( & element_shape ) , <nl> + errors : : InvalidArgument ( " Trying to read an uninitialized tensor but " , <nl> + " element_shape is not fully defined . " , <nl> + partial_element_shape . DebugString ( ) ) ) ; <nl> + Tensor * result ; <nl> + AllocatorAttributes attr ; <nl> + if ( element_dtype_ = = DT_VARIANT ) { <nl> + attr . set_on_host ( true ) ; <nl> + } <nl> + OP_REQUIRES_OK ( c , c - > allocate_output ( 1 , element_shape , & result , attr ) ) ; <nl> + functor : : SetZeroFunctor < Device , T > ( ) ( c - > eigen_device < Device > ( ) , <nl> + result - > flat < T > ( ) ) ; <nl> + } * / <nl> + <nl> + TensorMap * output_map = nullptr ; <nl> + OP_REQUIRES_OK ( c , ForwardInputOrCreateNewMap ( c , 0 , 0 , * m , & output_map ) ) ; <nl> + output_map - > tensors ( ) . erase ( key ) ; <nl> + } <nl> + <nl> + private : <nl> + DataType element_dtype_ ; <nl> + } ; <nl> + <nl> + class TensorMapReplace : public OpKernel { <nl> + public : <nl> + explicit TensorMapReplace ( OpKernelConstruction * c ) : OpKernel ( c ) { <nl> + OP_REQUIRES_OK ( c , c - > GetAttr ( " element_dtype " , & element_dtype_ ) ) ; <nl> + } <nl> + ~ TensorMapReplace ( ) override { } <nl> + <nl> + void Compute ( OpKernelContext * c ) override { <nl> + std : : cout < < " hello TensorMapReplace kernel " < < std : : endl ; <nl> + const Tensor & temp_key = c - > input ( 1 ) ; <nl> + const TensorKey key = TensorKey ( temp_key ) ; <nl> + std : : cout < < " got key " < < std : : endl ; <nl> + const Tensor & value = c - > input ( 2 ) ; <nl> + std : : cout < < " got value " < < std : : endl ; <nl> + / * OP_REQUIRES ( c , element_dtype_ = = value . dtype ( ) , <nl> + errors : : InvalidArgument ( " Invalid data types ; list elements " , <nl> + DataTypeString ( element_dtype_ ) , <nl> + " but tried to append " , <nl> + DataTypeString ( value . dtype ( ) ) ) ) ; * / <nl> + <nl> + const TensorMap * m = nullptr ; <nl> + OP_REQUIRES_OK ( c , GetInputMap ( c , 0 , & m ) ) ; <nl> + std : : cout < < " got map " < < std : : endl ; <nl> + / * OP_REQUIRES ( c , m - > element_shape . IsCompatibleWith ( input . shape ( ) ) , <nl> + errors : : InvalidArgument ( <nl> + " Tried to append a map with incompatible shape to a " <nl> + " list . Op element shape : " , <nl> + input . shape ( ) . DebugString ( ) , <nl> + " list shape : " , m - > element_shape . DebugString ( ) ) ) ; * / <nl> + / * OP_REQUIRES ( c , element_dtype_ = = m - > element_dtype , <nl> + errors : : InvalidArgument ( " Invalid data types ; op elements " , <nl> + DataTypeString ( element_dtype_ ) , <nl> + " but list elements " , <nl> + DataTypeString ( l - > element_dtype ) ) ) ; <nl> + <nl> + if ( l - > max_num_elements ! = - 1 ) { <nl> + OP_REQUIRES ( <nl> + c , l - > tensors ( ) . size ( ) < l - > max_num_elements , <nl> + errors : : InvalidArgument ( " Tried to push item into a full list " , <nl> + " list size : " , l - > tensors ( ) . size ( ) , <nl> + " max_num_elements : " , l - > max_num_elements ) ) ; <nl> + } * / <nl> + TensorMap * output_map = nullptr ; <nl> + OP_REQUIRES_OK ( c , ForwardInputOrCreateNewMap ( c , 0 , 0 , * m , & output_map ) ) ; <nl> + std : : cout < < " create output " < < std : : endl ; <nl> + output_map - > replace ( key , value ) ; <nl> + std : : cout < < " inserted " < < std : : endl ; <nl> + } <nl> + <nl> + private : <nl> + DataType element_dtype_ ; <nl> + } ; <nl> + <nl> + REGISTER_KERNEL_BUILDER ( Name ( " TensorMapReplace " ) . Device ( DEVICE_CPU ) , <nl> + TensorMapReplace ) ; <nl> + <nl> class ZeroOutOp : public OpKernel { <nl> public : <nl> explicit ZeroOutOp ( OpKernelConstruction * c ) : OpKernel ( c ) { } <nl> mmm a / tensorflow / core / kernels / tensor_map . h <nl> ppp b / tensorflow / core / kernels / tensor_map . h <nl> class TensorMap { <nl> <nl> / / Insert key and value if the key does not already exist . <nl> / / Returns true if the insertion happens . <nl> - bool insert ( TensorKey key , Tensor value ) { <nl> + bool insert ( const TensorKey & key , const Tensor & value ) { <nl> auto r = tensors_ - > values_ . try_emplace ( key , value ) ; <nl> return r . second ; <nl> } <nl> class TensorMap { <nl> return tensors_ - > values_ . find ( key ) ; <nl> } <nl> <nl> + Tensor & lookup ( TensorKey key ) { <nl> + return tensors_ - > values_ . find ( key ) - > second ; <nl> + } <nl> + <nl> Tensor & operator [ ] ( TensorKey & k ) { <nl> return tensors_ - > values_ [ k ] ; <nl> } <nl> + <nl> + bool replace ( const TensorKey & k , const Tensor & v ) { <nl> + tensors_ - > values_ [ k ] = v ; <nl> + return true ; <nl> + } <nl> + <nl> / / Removes element with given key . Return size of removed element . <nl> size_t erase ( TensorKey key ) { <nl> return tensors_ - > values_ . erase ( key ) ; <nl> mmm a / tensorflow / core / ops / map_ops . cc <nl> ppp b / tensorflow / core / ops / map_ops . cc <nl> REGISTER_OP ( " TensorMapInsert " ) <nl> return Status : : OK ( ) ; <nl> } ) ; <nl> <nl> - / * REGISTER_OP ( " TensorMapErase " ) <nl> + REGISTER_OP ( " TensorMapLookup " ) <nl> . Input ( " input_handle : variant " ) <nl> - . Input ( " element_shape : int32 " ) <nl> + . Input ( " key : element_dtype " ) <nl> + . Output ( " value : element_dtype " ) <nl> + . Attr ( " element_dtype : type " ) <nl> + . SetShapeFn ( [ ] ( shape_inference : : InferenceContext * c ) { <nl> + c - > set_output ( 0 , c - > Scalar ( ) ) ; <nl> + / * DataType element_dtype ; <nl> + TF_RETURN_IF_ERROR ( c - > GetAttr ( " element_dtype " , & element_dtype ) ) ; <nl> + shape_inference : : ShapeHandle element_shape = c - > UnknownShape ( ) ; * / <nl> + <nl> + / * auto * handle_data = c - > input_handle_shapes_and_types ( 0 ) ; <nl> + if ( handle_data ! = nullptr & & handle_data - > size ( ) > 1 ) { <nl> + return errors : : InvalidArgument ( <nl> + " Trying to push to list with wrong variant data . " ) ; <nl> + } <nl> + if ( IsValidTensorMapHandleData ( handle_data ) ) { <nl> + const shape_inference : : ShapeAndType & map_shape_type = ( * handle_data ) [ 0 ] ; <nl> + if ( list_shape_type . dtype ! = element_dtype ) { <nl> + return errors : : InvalidArgument ( <nl> + " Trying to push to list with wrong element dtype . List has type " , <nl> + DataTypeString ( list_shape_type . dtype ) , <nl> + " but trying to push element with type " , <nl> + DataTypeString ( element_dtype ) ) ; <nl> + } <nl> + shape_inference : : ShapeHandle ignored ; <nl> + TF_RETURN_IF_ERROR ( <nl> + c - > Merge ( element_shape , map_shape_type . shape , & ignored ) ) ; <nl> + element_shape = map_shape_type . shape ; <nl> + } <nl> + c - > set_output_handle_shapes_and_types ( <nl> + 0 , std : : vector < shape_inference : : ShapeAndType > { <nl> + { element_shape , element_dtype } } ) ; * / <nl> + return Status : : OK ( ) ; <nl> + } ) ; <nl> + <nl> + REGISTER_OP ( " TensorMapErase " ) <nl> + . Input ( " input_handle : variant " ) <nl> + . Input ( " key : element_dtype " ) <nl> . Output ( " output_handle : variant " ) <nl> . Output ( " tensor : element_dtype " ) <nl> . Attr ( " element_dtype : type " ) <nl> . SetShapeFn ( [ ] ( shape_inference : : InferenceContext * c ) { <nl> - DataType element_dtype ; <nl> + / * DataType element_dtype ; <nl> TF_RETURN_IF_ERROR ( c - > GetAttr ( " element_dtype " , & element_dtype ) ) ; <nl> shape_inference : : ShapeHandle tensor_shape = c - > UnknownShape ( ) ; <nl> auto * handle_data = c - > input_handle_shapes_and_types ( 0 ) ; <nl> REGISTER_OP ( " TensorMapInsert " ) <nl> c - > Merge ( tensor_shape , list_shape_type . shape , & ignored ) ) ; <nl> c - > set_output_handle_shapes_and_types ( 0 , * handle_data ) ; <nl> tensor_shape = list_shape_type . shape ; <nl> - } <nl> - c - > set_output ( 1 , tensor_shape ) ; <nl> + } * / <nl> + c - > set_output ( 1 , c - > Scalar ( ) ) ; / / removed element <nl> + c - > set_output ( 0 , c - > Scalar ( ) ) ; / / map <nl> + return Status : : OK ( ) ; <nl> + } ) ; <nl> + <nl> + REGISTER_OP ( " TensorMapReplace " ) <nl> + . Input ( " input_handle : variant " ) <nl> + . Input ( " key : element_dtype " ) <nl> + . Input ( " value : element_dtype " ) <nl> + . Output ( " output_handle : variant " ) <nl> + . Attr ( " element_dtype : type " ) <nl> + . SetShapeFn ( [ ] ( shape_inference : : InferenceContext * c ) { <nl> c - > set_output ( 0 , c - > Scalar ( ) ) ; <nl> + / * DataType element_dtype ; <nl> + TF_RETURN_IF_ERROR ( c - > GetAttr ( " element_dtype " , & element_dtype ) ) ; <nl> + shape_inference : : ShapeHandle element_shape = c - > UnknownShape ( ) ; * / <nl> + <nl> + / * auto * handle_data = c - > input_handle_shapes_and_types ( 0 ) ; <nl> + if ( handle_data ! = nullptr & & handle_data - > size ( ) > 1 ) { <nl> + return errors : : InvalidArgument ( <nl> + " Trying to push to list with wrong variant data . " ) ; <nl> + } <nl> + if ( IsValidTensorMapHandleData ( handle_data ) ) { <nl> + const shape_inference : : ShapeAndType & map_shape_type = ( * handle_data ) [ 0 ] ; <nl> + if ( list_shape_type . dtype ! = element_dtype ) { <nl> + return errors : : InvalidArgument ( <nl> + " Trying to push to list with wrong element dtype . List has type " , <nl> + DataTypeString ( list_shape_type . dtype ) , <nl> + " but trying to push element with type " , <nl> + DataTypeString ( element_dtype ) ) ; <nl> + } <nl> + shape_inference : : ShapeHandle ignored ; <nl> + TF_RETURN_IF_ERROR ( <nl> + c - > Merge ( element_shape , map_shape_type . shape , & ignored ) ) ; <nl> + element_shape = map_shape_type . shape ; <nl> + } <nl> + c - > set_output_handle_shapes_and_types ( <nl> + 0 , std : : vector < shape_inference : : ShapeAndType > { <nl> + { element_shape , element_dtype } } ) ; * / <nl> return Status : : OK ( ) ; <nl> - } ) ; * / <nl> + } ) ; <nl> + <nl> <nl> <nl> REGISTER_OP ( " ZeroOut " ) <nl> mmm a / tensorflow / python / kernel_tests / list_ops_test . py <nl> ppp b / tensorflow / python / kernel_tests / list_ops_test . py <nl> <nl> <nl> @ test_util . run_all_in_graph_and_eager_modes <nl> class ListOpsTest ( test_util . TensorFlowTestCase , parameterized . TestCase ) : <nl> - <nl> + ' ' ' <nl> def _testPushPop ( self , max_num_elements ) : <nl> l = list_ops . empty_tensor_list ( <nl> element_dtype = dtypes . float32 , <nl> def testPopUninitializedTensorWithInvalidElementShapeFails ( self ) : <nl> _ , e = gen_list_ops . tensor_list_pop_back ( <nl> l , element_dtype = dtypes . float32 , element_shape = [ 1 , 3 ] ) <nl> self . evaluate ( e ) <nl> - <nl> + ' ' ' <nl> def testPushGetGrad ( self ) : <nl> with backprop . GradientTape ( ) as tape : <nl> l = list_ops . empty_tensor_list ( <nl> def testPushGetGrad ( self ) : <nl> dt0 , dt1 = tape . gradient ( t1 , [ c0 , c1 ] ) <nl> self . assertAllEqual ( self . evaluate ( dt1 ) , [ 1 . 0 , 1 . 0 ] ) <nl> self . assertEqual ( self . evaluate ( dt0 ) , 0 . 0 ) <nl> - <nl> + ' ' ' <nl> def _testStack ( self , max_num_elements ) : <nl> l = list_ops . empty_tensor_list ( <nl> element_dtype = dtypes . float32 , <nl> def testSerializeListWithMaxNumElements ( self ) : <nl> l_worker = array_ops . identity ( l_ps ) <nl> l_worker = list_ops . tensor_list_push_back ( l_worker , 3 . 0 ) <nl> self . evaluate ( l_worker ) <nl> - <nl> + ' ' ' <nl> def testPushPopGradients ( self ) : <nl> with backprop . GradientTape ( ) as tape : <nl> l = list_ops . empty_tensor_list ( <nl> def testGetSetGradients ( self ) : <nl> grad_c , grad_c2 = tape . gradient ( y , [ c , c2 ] ) <nl> self . assertAllEqual ( self . evaluate ( grad_c ) , [ 0 . 0 , 4 . 0 ] ) <nl> self . assertAllEqual ( self . evaluate ( grad_c2 ) , 6 . 0 ) <nl> - <nl> + ' ' ' <nl> @ test_util . run_deprecated_v1 <nl> def testSetOutOfBounds ( self ) : <nl> c = constant_op . constant ( [ 1 . 0 , 2 . 0 ] ) <nl> def upper ( i ) : <nl> upper , constant_op . constant ( [ 0 , 1 , 2 ] ) , dtype = dtypes . string ) <nl> <nl> self . assertAllEqual ( f ( ) , [ b " A " , b " B " , b " C " ] ) <nl> - <nl> + ' ' ' <nl> def testPopBackGrad ( self ) : <nl> # https : / / github . com / tensorflow / tensorflow / issues / 37230 <nl> <nl> mmm a / tensorflow / python / kernel_tests / map_ops_test . py <nl> ppp b / tensorflow / python / kernel_tests / map_ops_test . py <nl> <nl> from __future__ import division <nl> from __future__ import print_function <nl> <nl> - import numpy as np <nl> + # import numpy as np <nl> <nl> from tensorflow . python . platform import test <nl> from absl . testing import parameterized <nl> <nl> <nl> @ test_util . run_all_in_graph_and_eager_modes <nl> class MapOpsTest ( test_util . TensorFlowTestCase , parameterized . TestCase ) : <nl> - def testEmptyTensorMap ( self ) : <nl> + ' ' ' def testEmptyTensorMap ( self ) : <nl> m = map_ops . empty_tensor_map ( ) <nl> print ( " test EmptyTensorMap " ) <nl> <nl> def testTensorMapSize ( self ) : <nl> m = map_ops . empty_tensor_map ( ) <nl> s = map_ops . tensor_map_size ( m ) <nl> print ( " size : " , s ) <nl> + self . assertAllClose ( s , 0 ) <nl> <nl> def testTensorMapInsert ( self ) : <nl> + # with self . test_session ( ) : <nl> + m = map_ops . empty_tensor_map ( ) <nl> + k = constant_op . constant ( 1 . 0 ) <nl> + v = constant_op . constant ( 2 . 0 ) <nl> + m = map_ops . tensor_map_insert ( m , k , v ) <nl> + s = map_ops . tensor_map_size ( m ) <nl> + self . assertAllClose ( s , 1 ) <nl> + print ( " test TensorMapInsert " ) <nl> + <nl> + def testTensorMapLookup ( self ) : <nl> + m = map_ops . empty_tensor_map ( ) <nl> + k = constant_op . constant ( 1 . 0 ) <nl> + v = constant_op . constant ( 2 . 0 ) <nl> + m = map_ops . tensor_map_insert ( m , k , v ) <nl> + l = map_ops . tensor_map_lookup ( m , k ) <nl> + print ( " lookup : " , l ) <nl> + self . assertAllClose ( l , v ) ' ' ' <nl> + <nl> + def testTensorMapReplace ( self ) : <nl> + # with self . test_session ( ) : <nl> + m = map_ops . empty_tensor_map ( ) <nl> + k = constant_op . constant ( 1 . 0 ) <nl> + v = constant_op . constant ( 2 . 0 ) <nl> + m = map_ops . tensor_map_insert ( m , k , v ) <nl> + s = map_ops . tensor_map_size ( m ) <nl> + self . assertAllClose ( s , 1 ) <nl> + <nl> + v2 = constant_op . constant ( 3 . 0 ) <nl> + m = map_ops . tensor_map_replace ( m , k , v2 ) <nl> + l = map_ops . tensor_map_lookup ( m , k ) <nl> + self . assertAllClose ( l , v2 ) <nl> + print ( " test TensorMapReplace " ) <nl> + <nl> + def testTensorMapErase ( self ) : <nl> + print ( " python erase " ) <nl> m = map_ops . empty_tensor_map ( ) <nl> k = constant_op . constant ( 1 . 0 ) <nl> v = constant_op . constant ( 2 . 0 ) <nl> m = map_ops . tensor_map_insert ( m , k , v ) <nl> - print ( " test TensorMapInsert " ) <nl> + s = map_ops . tensor_map_size ( m ) <nl> + self . assertAllClose ( s , 1 ) <nl> + m , e = map_ops . tensor_map_erase ( m , k ) <nl> + s = map_ops . tensor_map_size ( m ) <nl> + print ( " erase : " , e ) <nl> + self . assertAllClose ( s , 0 ) <nl> + self . assertAllClose ( e , v ) <nl> + <nl> + def testInsertLookupGrad ( self ) : <nl> + with backprop . GradientTape ( ) as tape : <nl> + m = map_ops . empty_tensor_map ( ) <nl> + k = constant_op . constant ( 1 . 0 ) <nl> + v = constant_op . constant ( 2 . 0 ) <nl> + tape . watch ( v ) <nl> + m = map_ops . tensor_map_insert ( m , k , v ) <nl> + l = map_ops . tensor_map_lookup ( m , k ) <nl> + l * = 5 <nl> + # print ( " gradient " , tape . gradient ( l , v ) , 2 . 0 ) <nl> + <nl> + <nl> <nl> ' ' ' <nl> @ parameterized . named_parameters ( ( " NoMaxNumElements " , None ) , <nl> def testEraseFromEmptyTensorMapFails ( self , max_num_elements ) : <nl> self . evaluate ( l ) <nl> ' ' ' <nl> <nl> - def testZeroOut ( self ) : <nl> + ' ' ' def testZeroOut ( self ) : <nl> print ( " hello world testZeroOut " ) <nl> with self . test_session ( ) : <nl> self . assertAllClose ( <nl> - map_ops . zero_out ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) , np . array ( [ [ 1 , 0 ] , [ 0 , 0 ] ] ) ) <nl> + map_ops . zero_out ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) , np . array ( [ [ 1 , 0 ] , [ 0 , 0 ] ] ) ) ' ' ' <nl> <nl> <nl> if __name__ = = ' __main__ ' : <nl> mmm a / tensorflow / python / ops / map_ops . py <nl> ppp b / tensorflow / python / ops / map_ops . py <nl> <nl> # resource_loader . get_path_to_datafile ( ' _zero_out_ops . so ' ) ) <nl> # zero_out = zero_out_ops . zero_out <nl> <nl> + ops . NotDifferentiable ( " EmptyTensorMap " ) <nl> + <nl> def empty_tensor_map ( ) : <nl> print ( " hello gen_map_ops . empty_tensor_map " ) <nl> return gen_map_ops . empty_tensor_map ( ) <nl> def tensor_map_insert ( input_handle , key , value ) : <nl> print ( " hello gen_map_ops . tensor_map_insert " ) <nl> return gen_map_ops . tensor_map_insert ( input_handle , key , value ) <nl> <nl> + def tensor_map_lookup ( input_handle , key ) : <nl> + return gen_map_ops . tensor_map_lookup ( input_handle , key ) <nl> + <nl> + def tensor_map_erase ( input_handle , key ) : <nl> + return gen_map_ops . tensor_map_erase ( input_handle , key ) <nl> + <nl> + def tensor_map_replace ( input_handle , key , value ) : <nl> + return gen_map_ops . tensor_map_replace ( input_handle , key , value ) <nl> + <nl> + @ ops . RegisterGradient ( " TensorMapLookup " ) <nl> + def LookupGrad ( op , dval ) : <nl> + map_grad = None <nl> + key_grad = None <nl> + key = op . inputs [ 1 ] <nl> + value_grad = tensor_map_lookup ( dmap , key ) <nl> + return map_grad , key_grad <nl> + <nl> + @ ops . RegisterGradient ( " TensorMapInsert " ) <nl> + def InsertGrad ( op , dmap ) : <nl> + map_grad , _ = gen_map_ops . tensor_map_erase ( dmap , key ) <nl> + key_grad = None <nl> + key = op . inputs [ 1 ] <nl> + value_grad = tensor_map_lookup ( dmap , key ) <nl> + return map_grad , key_grad , value_grad <nl> + <nl> def zero_out ( to_zero ) : <nl> return gen_map_ops . zero_out ( to_zero ) <nl> <nl>
|
insert , lookup , erase , replace , and initial gradients
|
tensorflow/tensorflow
|
609fe7990f8311191c6bffc1ee47034443ac319a
|
2020-07-10T01:25:03Z
|
mmm a / src / library . js <nl> ppp b / src / library . js <nl> var Library = { <nl> llvm_memmove_p0i8_p0i8_i32 : ' memmove ' , <nl> llvm_memmove_p0i8_p0i8_i64 : ' memmove ' , <nl> <nl> - memset : function ( ptr , value , num ) { <nl> - for ( var i = 0 ; i < num ; i + + ) { <nl> - { { { makeSetValue ( ' ptr ' , ' i ' , ' value ' , ' null ' ) } } } <nl> - } <nl> - } , <nl> - llvm_memset_i32 : ' memset ' , <nl> - llvm_memset_p0i8_i32 : ' memset ' , <nl> - llvm_memset_p0i8_i64 : ' memset ' , <nl> + llvm_memset_i32 : ' Runtime . memset ' , <nl> + llvm_memset_p0i8_i32 : ' Runtime . memset ' , <nl> + llvm_memset_p0i8_i64 : ' Runtime . memset ' , <nl> <nl> strlen : function ( ptr ) { <nl> return String_len ( ptr ) ; <nl> var Library = { <nl> * / <nl> } , <nl> <nl> + llvm_bswap_i32 : function ( x ) { <nl> + x = unSign ( x , 32 ) ; <nl> + var bytes = [ ] ; <nl> + for ( var i = 0 ; i < 4 ; i + + ) { <nl> + bytes [ i ] = x & 255 ; <nl> + x > > = 8 ; <nl> + } <nl> + var ret = 0 ; <nl> + for ( i = 0 ; i < 4 ; i + + ) { <nl> + ret < < = 8 ; <nl> + ret + = bytes [ i ] ; <nl> + } <nl> + return ret ; <nl> + } , <nl> + <nl> __assert_fail : function ( condition , file , line ) { <nl> ABORT = true ; <nl> throw ' Assertion failed : ' + Pointer_stringify ( condition ) ; / / JSON . stringify ( arguments ) / / condition ; <nl> mmm a / src / preamble . js <nl> ppp b / src / preamble . js <nl> var TOTAL_MEMORY = 50 * 1024 * 1024 ; <nl> function __initializeRuntime__ ( ) { <nl> / / If we don ' t have malloc / free implemented , use a simple implementation . <nl> Module [ ' _malloc ' ] = _malloc = __Znwj = __Znaj = __Znam = __Znwm = Module [ ' _malloc ' ] ? Module [ ' _malloc ' ] : Runtime . staticAlloc ; <nl> - Module [ ' _calloc ' ] = _calloc = Module [ ' _calloc ' ] ? Module [ ' _calloc ' ] : function ( n , s ) { return _malloc ( n * s ) } ; <nl> + Module [ ' _calloc ' ] = _calloc = Module [ ' _calloc ' ] ? Module [ ' _calloc ' ] : function ( n , s ) { <nl> + var ret = _malloc ( n * s ) ; <nl> + Runtime . memset ( ret , 0 , n * s ) ; <nl> + return ret ; <nl> + } ; <nl> Module [ ' _free ' ] = _free = __ZdlPv = __ZdaPv = Module [ ' _free ' ] ? Module [ ' _free ' ] : function ( ) { } ; <nl> <nl> # if USE_TYPED_ARRAYS <nl> function __initializeRuntime__ ( ) { <nl> Module [ ' FHEAP ' ] = FHEAP ; <nl> <nl> STACK_ROOT = STACKTOP = alignMemoryPage ( 10 ) ; <nl> - if ( ! this [ ' TOTAL_STACK ' ] ) TOTAL_STACK = 1024 * 1024 ; / / Reserved room for stack <nl> + if ( ! this [ ' TOTAL_STACK ' ] ) TOTAL_STACK = 1024 * 1024 ; / / Reserved room for stack XXX : Changing this value can lead to bad perf on v8 ! <nl> STACK_MAX = STACK_ROOT + TOTAL_STACK ; <nl> <nl> STATICTOP = alignMemoryPage ( STACK_MAX ) ; <nl> mmm a / src / runtime . js <nl> ppp b / src / runtime . js <nl> RuntimeGenerator = { <nl> alloc : function ( size , type , init ) { <nl> var ret = type + ' TOP ' ; <nl> if ( GUARD_MEMORY ) { <nl> - ret + = ' ; assert ( ' + size + ' > 0 ) ' ; <nl> + ret + = ' ; assert ( ' + size + ' > 0 , " Trying to allocate 0 " ) ' ; <nl> } <nl> if ( init ) { <nl> - var initMemory = ' for ( var i = 0 ; i < ' + size + ' ; i + + ) ' + ( <nl> - USE_TYPED_ARRAYS ? <nl> - ' IHEAP [ ' + type + ' TOP + i ] = FHEAP [ ' + type + ' TOP + i ] = 0 ' : <nl> - ' HEAP [ ' + type + ' TOP + i ] = 0 ' <nl> - ) ; <nl> - ret + = ' ; ' + initMemory ; <nl> + ret + = ' ; Runtime . memset ( ' + type + ' TOP , 0 , ' + size + ' ) ' ; <nl> } <nl> ret + = ' ; ' + type + ' TOP + = ' + size ; <nl> if ( QUANTUM_SIZE > 1 ) { <nl> RuntimeGenerator = { <nl> stackAlloc : function ( size ) { <nl> var ret = RuntimeGenerator . alloc ( size , ' STACK ' , INIT_STACK ) ; <nl> if ( GUARD_MEMORY ) { <nl> - ret + = ' ; assert ( STACKTOP < STACK_ROOT + STACK_MAX ) ' ; <nl> + ret + = ' ; assert ( STACKTOP < STACK_ROOT + STACK_MAX , " Ran out of stack " ) ' ; <nl> } <nl> return ret ; <nl> } , <nl> RuntimeGenerator = { <nl> ret + = ' ; assert ( STACKTOP < STACK_MAX ) ' ; <nl> } <nl> if ( INIT_STACK ) { <nl> - var initMemory = ' for ( var i = __stackBase__ ; i < STACKTOP ; i + + ) { ' + ( <nl> - USE_TYPED_ARRAYS ? <nl> - ' IHEAP [ i ] = FHEAP [ i ] = 0 ' : / / TODO : Benchmark this . Suboptimal due to type differences ? <nl> - ' HEAP [ i ] = 0 ' <nl> - ) + ( SAFE_HEAP ? ' ; SAFE_HEAP_ACCESS ( i , null , true ) ' : ' ' ) + ' } ' ; <nl> + ret + = ' ; Runtime . memset ( __stackBase__ , 0 , ' + initial + ' ) ' ; <nl> } <nl> - ret + = ' ; ' + initMemory ; <nl> return ret ; <nl> } , <nl> <nl> Runtime = { <nl> staticAlloc : unInline ( ' staticAlloc ' , [ ' size ' ] ) , <nl> alignMemory : unInline ( ' alignMemory ' , [ ' size ' , ' quantum ' ] ) , <nl> <nl> + memset : function ( ptr , value , num ) { <nl> + for ( var i = 0 ; i < num ; i + + ) { <nl> + { { { makeSetValue ( ' ptr ' , ' i ' , ' value ' , ' null ' ) } } } <nl> + } <nl> + } , <nl> + <nl> getFunctionIndex : function getFunctionIndex ( func , ident ) { <nl> var key = FUNCTION_TABLE . length ; <nl> FUNCTION_TABLE [ key ] = func ; <nl> mmm a / tests / runner . py <nl> ppp b / tests / runner . py <nl> def assertNotContained ( self , value , string ) : <nl> <nl> class T ( RunnerCore ) : # Short name , to make it more fun to use manually on the commandline <nl> # # Does a complete test - builds , runs , checks output , etc . <nl> - def do_test ( self , src , expected_output , args = [ ] , output_nicerizer = None , output_processor = None , no_build = False , main_file = None , additional_files = [ ] , js_engines = None , post_build = None , basename = ' src . cpp ' , libraries = [ ] , includes = [ ] ) : <nl> + def do_test ( self , src , expected_output , args = [ ] , output_nicerizer = None , output_processor = None , no_build = False , main_file = None , additional_files = [ ] , js_engines = None , post_build = None , basename = ' src . cpp ' , libraries = [ ] , includes = [ ] , force_c = False ) : <nl> # print ' Running test : ' , inspect . stack ( ) [ 1 ] [ 3 ] . replace ( ' test_ ' , ' ' ) , ' [ % s , % s , % s ] ' % ( COMPILER . split ( os . sep ) [ - 1 ] , ' llvm - optimizations ' if LLVM_OPTS else ' ' , ' reloop & optimize ' if RELOOP else ' ' ) <nl> - if main_file is not None and main_file [ - 2 : ] = = ' . c ' : basename = ' src . c ' <nl> + if force_c or ( main_file is not None and main_file [ - 2 : ] ) = = ' . c ' : <nl> + basename = ' src . c ' <nl> + global COMPILER <nl> + COMPILER = COMPILER . replace ( ' clang + + ' , ' clang ' ) . replace ( ' g + + ' , ' gcc ' ) <nl> + <nl> dirname = self . get_dir ( ) <nl> filename = os . path . join ( dirname , basename ) <nl> if not no_build : <nl> def test_lua ( self ) : <nl> args = [ ' - e ' , ' ' ' print ( " hello lua world ! " ) ; print ( 17 ) ; for x = 1 , 4 do print ( x ) end ; print ( 10 - 3 ) ' ' ' ] , <nl> output_nicerizer = lambda string : string . replace ( ' \ n \ n ' , ' \ n ' ) . replace ( ' \ n \ n ' , ' \ n ' ) ) <nl> <nl> + # Build a library into a . bc file . We build the . bc file once and cache it for all our tests . ( We cache in <nl> + # memory since the test directory is destroyed and recreated for each test . ) <nl> + def get_library ( self , name , generated_lib , make_args = [ ] ) : <nl> + if hasattr ( GlobalCache , ' cached_lib ' + name ) : <nl> + bc_file = os . path . join ( self . get_dir ( ) , ' lib ' + name + ' . bc ' ) <nl> + f = open ( bc_file , ' wb ' ) <nl> + f . write ( getattr ( GlobalCache , ' cached_lib ' + name ) ) <nl> + f . close ( ) <nl> + return bc_file <nl> + <nl> + temp_dir = os . path . join ( self . get_dir ( ) , ' building ' ) <nl> + ft_dir = os . path . join ( temp_dir , name ) <nl> + shutil . copytree ( path_from_root ( ' tests ' , name ) , ft_dir ) <nl> + os . chdir ( ft_dir ) <nl> + env = os . environ . copy ( ) <nl> + env [ ' RANLIB ' ] = env [ ' AR ' ] = env [ ' CXX ' ] = env [ ' CC ' ] = EMMAKEN <nl> + output = Popen ( [ ' . / configure ' ] , stdout = PIPE , stderr = STDOUT , env = env ) . communicate ( ) [ 0 ] <nl> + Popen ( [ ' make ' , ' - j ' , ' 2 ' ] + make_args , stdout = PIPE , stderr = STDOUT ) . communicate ( ) [ 0 ] <nl> + bc_file = os . path . join ( ft_dir , generated_lib ) <nl> + shutil . copyfile ( bc_file , bc_file + ' . bc ' ) <nl> + bc_file + = ' . bc ' <nl> + setattr ( GlobalCache , ' cached_lib ' + name , open ( bc_file , ' rb ' ) . read ( ) ) <nl> + return bc_file <nl> + <nl> def test_freetype ( self ) : <nl> if COMPILER ! = LLVM_GCC : return # TODO : Build in both clang and llvm - gcc . emmaken currently only does llvm - gcc <nl> if LLVM_OPTS : global RELOOP ; RELOOP = 0 # Too slow ; we do care about typed arrays and OPTIMIZE though <nl> <nl> - def get_bc ( ) : <nl> - # We build the . bc file once and cache it for all our tests . ( We cache in <nl> - # memory since the test directory is destroyed and recreated for each test . ) <nl> - if hasattr ( GlobalCache , ' cached_libfreetype ' ) : <nl> - bc_file = os . path . join ( self . get_dir ( ) , ' libfreetype . bc ' ) <nl> - f = open ( bc_file , ' wb ' ) <nl> - f . write ( GlobalCache . cached_libfreetype ) <nl> - f . close ( ) <nl> - return bc_file <nl> - <nl> - temp_dir = os . path . join ( self . get_dir ( ) , ' building ' ) <nl> - ft_dir = os . path . join ( temp_dir , ' freetype ' ) <nl> - shutil . copytree ( path_from_root ( ' tests ' , ' freetype ' ) , ft_dir ) <nl> - os . chdir ( ft_dir ) <nl> - env = os . environ . copy ( ) <nl> - env [ ' RANLIB ' ] = env [ ' AR ' ] = env [ ' CXX ' ] = env [ ' CC ' ] = EMMAKEN <nl> - output = Popen ( [ ' . / configure ' ] , stdout = PIPE , stderr = STDOUT , env = env ) . communicate ( ) [ 0 ] <nl> - self . assertContained ( ' configure : creating . / config . status ' , output ) <nl> - Popen ( [ ' make ' , ' - j ' , ' 2 ' ] , stdout = PIPE , stderr = STDOUT ) . communicate ( ) [ 0 ] <nl> - bc_file = os . path . join ( ft_dir , ' objs ' , ' . libs ' , ' libfreetype ' ) <nl> - shutil . copyfile ( bc_file + ' . so ' , bc_file + ' . bc ' ) <nl> - bc_file + = ' . bc ' <nl> - GlobalCache . cached_libfreetype = open ( bc_file , ' rb ' ) . read ( ) <nl> - return bc_file <nl> - <nl> def post ( filename ) : <nl> # Embed the font into the document <nl> src = open ( filename , ' r ' ) . read ( ) . replace ( <nl> def post ( filename ) : <nl> self . do_test ( open ( path_from_root ( ' tests ' , ' freetype ' , ' main . c ' ) , ' r ' ) . read ( ) , <nl> open ( path_from_root ( ' tests ' , ' freetype ' , ' ref . txt ' ) , ' r ' ) . read ( ) , <nl> [ ' font . ttf ' , ' test ! ' ] , <nl> - libraries = [ get_bc ( ) ] , includes = [ path_from_root ( ' tests ' , ' freetype ' , ' include ' ) ] , <nl> + libraries = [ self . get_library ( ' freetype ' , os . path . join ( ' objs ' , ' . libs ' , ' libfreetype . so ' ) ) ] , <nl> + includes = [ path_from_root ( ' tests ' , ' freetype ' , ' include ' ) ] , <nl> post_build = post ) <nl> <nl> + def zzztest_zlib ( self ) : <nl> + if COMPILER ! = LLVM_GCC : return # TODO : Build in both clang and llvm - gcc . emmaken currently only does llvm - gcc <nl> + <nl> + self . do_test ( open ( path_from_root ( ' tests ' , ' zlib ' , ' example . c ' ) , ' r ' ) . read ( ) , <nl> + open ( path_from_root ( ' tests ' , ' zlib ' , ' ref . txt ' ) , ' r ' ) . read ( ) , <nl> + libraries = [ self . get_library ( ' zlib ' , os . path . join ( ' libz . a ' ) , [ ' libz . a ' ] ) ] , <nl> + includes = [ path_from_root ( ' tests ' , ' zlib ' ) ] , <nl> + force_c = True ) <nl> + <nl> def zzztest_poppler ( self ) : <nl> # Has ' Object ' , which has a big union with a value that can be of any type ( like a dynamic value ) <nl> global SAFE_HEAP ; SAFE_HEAP = 0 <nl> mmm a / tools / emmaken . py <nl> ppp b / tools / emmaken . py <nl> def path_from_root ( * pathelems ) : <nl> try : <nl> print > > sys . stderr , ' emmaken . py : ' , ' ' . join ( sys . argv ) <nl> <nl> - CC = ' / home / alon / Dev / llvm - gcc - 4 . 2 - 2 . 8 . source / cbuild / install / bin / llvm - g + + ' <nl> + CC = ' / home / alon / Dev / llvm - gcc - 4 . 2 - 2 . 8 . source / cbuild / install / bin / llvm - gcc ' <nl> + CXX = ' / home / alon / Dev / llvm - gcc - 4 . 2 - 2 . 8 . source / cbuild / install / bin / llvm - g + + ' <nl> CC_ARG_SKIP = [ ' - g ' , ' - O1 ' , ' - O2 ' , ' - O3 ' ] <nl> CC_ADDITIONAL_ARGS = [ ' - m32 ' , ' - U__i386__ ' , ' - U__x86_64__ ' , ' - UX87_DOUBLE_ROUNDING ' , ' - UHAVE_GCC_ASM_FOR_X87 ' ] <nl> <nl> def path_from_root ( * pathelems ) : <nl> LLVM_DIS = ' / home / alon / Dev / llvm - 2 . 8 / cbuild / Release / bin / llvm - dis ' <nl> ALLOWED_LINK_ARGS = [ ' - f ' , ' - help ' , ' - o ' , ' - print - after ' , ' - print - after - all ' , ' - print - before ' , <nl> ' - print - before - all ' , ' - time - passes ' , ' - v ' , ' - verify - dom - info ' , ' - version ' ] <nl> + DISALLOWED_LINK_ARGS = [ ] # [ ' rc ' ] <nl> # LINK_ARG_SKIP = [ ' - pthread ' , ' - DNDEBUG ' , ' - g ' , ' - O3 ' , ' - Wall ' , ' - Wstrict - prototypes ' , <nl> # ' - lpthread ' , ' - ldl ' , ' - lutil ' , ' - Xlinker ' , ' - export - dynamic ' , ' - lm ' , ' - shared ' ] <nl> <nl> def path_from_root ( * pathelems ) : <nl> # noop ar <nl> sys . exit ( 0 ) <nl> <nl> + use_cxx = True <nl> use_linker = True <nl> - # use_linker = False <nl> <nl> opts = [ ] <nl> files = [ ] <nl> def path_from_root ( * pathelems ) : <nl> opts . append ( arg ) <nl> else : <nl> files . append ( arg ) <nl> + if arg . endswith ( ' . c ' ) : <nl> + use_cxx = False <nl> if arg . endswith ( ( ' . c ' , ' . cc ' , ' . cpp ' ) ) : <nl> use_linker = False <nl> <nl> if ' - - version ' in opts : <nl> use_linker = False <nl> <nl> - if sys . argv [ 1 ] = = ' cru ' : # ar <nl> + if sys . argv [ 1 ] in [ ' cru ' , ' rc ' ] : # ar <nl> sys . argv = sys . argv [ : 1 ] + sys . argv [ 3 : ] + [ ' - o = ' + sys . argv [ 2 ] ] <nl> assert use_linker , ' Linker should be used in this case ' <nl> <nl> def path_from_root ( * pathelems ) : <nl> newargs = [ ] <nl> found_o = False <nl> for arg in sys . argv [ 1 : ] : <nl> - if os . path . basename ( sys . argv [ 0 ] ) = = ' arproxy . py ' : <nl> - if arg . endswith ( ' . a ' ) : <nl> - newargs . append ( ' - o = % s ' % arg ) <nl> - elif arg . endswith ( ' . o ' ) : <nl> - newargs . append ( arg ) <nl> - else : <nl> - pass <nl> - continue <nl> if found_o : <nl> newargs . append ( ' - o = % s ' % arg ) <nl> found_o = False <nl> def path_from_root ( * pathelems ) : <nl> continue # . so ' s do not exist yet , in many cases <nl> else : <nl> # not option , so just append <nl> - newargs . append ( arg ) <nl> + if arg not in DISALLOWED_LINK_ARGS : <nl> + newargs . append ( arg ) <nl> else : <nl> - call = CC <nl> + call = CXX if use_cxx else CC <nl> newargs = [ arg for arg in sys . argv [ 1 : ] if arg not in CC_ARG_SKIP ] + CC_ADDITIONAL_ARGS <nl> if ' conftest . c ' not in files : <nl> newargs . append ( ' - emit - llvm ' ) <nl> - if ' llvm - g ' in CC : <nl> + if not use_linker : <nl> newargs . append ( ' - c ' ) <nl> <nl> print > > sys . stderr , " Running : " , call , ' ' . join ( newargs ) <nl>
|
misc cleanups and fixes
|
emscripten-core/emscripten
|
9c584561a85eb6e011862612a0b21dae9d9ad9bf
|
2011-01-31T15:43:01Z
|
mmm a / xbmc / cores / ExternalPlayer / ExternalPlayer . cpp <nl> ppp b / xbmc / cores / ExternalPlayer / ExternalPlayer . cpp <nl> <nl> * / <nl> <nl> # include " system . h " <nl> + # include " signal . h " <nl> + # include " limits . h " <nl> + # include " SingleLock . h " <nl> # include " AudioContext . h " <nl> # include " ExternalPlayer . h " <nl> + # include " WindowingFactory . h " <nl> # include " GUIDialogOK . h " <nl> # include " GUIFontManager . h " <nl> # include " GUITextLayout . h " <nl> <nl> # include " utils / TimeUtils . h " <nl> # if defined ( _WIN32 ) <nl> # include " Windows . h " <nl> - # ifdef HAS_IRSERVERSUITE <nl> - # include " common / IRServerSuite / IRServerSuite . h " <nl> - # endif <nl> + # ifdef HAS_IRSERVERSUITE <nl> + # include " common / IRServerSuite / IRServerSuite . h " <nl> + # endif <nl> # endif <nl> # if defined ( HAS_LIRC ) <nl> # include " common / LIRC . h " <nl> <nl> # define LAUNCHER_PROCESS_TIME 2000 <nl> / / Time ( ms ) we give a process we sent a WM_QUIT to close before terminating <nl> # define PROCESS_GRACE_TIME 3000 <nl> + / / Default time after which the item ' s playcount is incremented <nl> + # define DEFAULT_PLAYCOUNT_MIN_TIME 10000 <nl> <nl> using namespace XFILE ; <nl> <nl> + # if defined ( _WIN32 ) <nl> + extern HWND g_hWnd ; <nl> + # endif <nl> + <nl> CExternalPlayer : : CExternalPlayer ( IPlayerCallback & callback ) <nl> : IPlayer ( callback ) , <nl> CThread ( ) <nl> { <nl> + m_bAbortRequest = false ; <nl> m_bIsPlaying = false ; <nl> m_paused = false ; <nl> m_playbackStartTime = 0 ; <nl> m_speed = 1 ; <nl> - m_totalTime = 1000 ; <nl> + m_totalTime = 1 ; <nl> m_time = 0 ; <nl> <nl> m_hideconsole = false ; <nl> m_warpcursor = WARP_NONE ; <nl> m_hidexbmc = false ; <nl> m_islauncher = false ; <nl> + m_playCountMinTime = DEFAULT_PLAYCOUNT_MIN_TIME ; <nl> <nl> m_dialog = NULL ; <nl> + <nl> + # if defined ( _WIN32 ) <nl> + memset ( & m_processInfo , 0 , sizeof ( m_processInfo ) ) ; <nl> + # endif <nl> } <nl> <nl> CExternalPlayer : : ~ CExternalPlayer ( ) <nl> bool CExternalPlayer : : OpenFile ( const CFileItem & file , const CPlayerOptions & opti <nl> { <nl> m_launchFilename = file . m_strPath ; <nl> CLog : : Log ( LOGNOTICE , " % s : % s " , __FUNCTION__ , m_launchFilename . c_str ( ) ) ; <nl> - <nl> Create ( ) ; <nl> <nl> return true ; <nl> bool CExternalPlayer : : OpenFile ( const CFileItem & file , const CPlayerOptions & opti <nl> <nl> bool CExternalPlayer : : CloseFile ( ) <nl> { <nl> - StopThread ( ) ; <nl> + m_bAbortRequest = true ; <nl> + <nl> + if ( m_dialog & & m_dialog - > IsActive ( ) ) m_dialog - > Close ( ) ; <nl> + <nl> + # if defined ( _WIN32 ) <nl> + if ( m_bIsPlaying & & m_processInfo . hProcess ) <nl> + { <nl> + TerminateProcess ( m_processInfo . hProcess , 1 ) ; <nl> + } <nl> + # endif <nl> + <nl> return true ; <nl> } <nl> <nl> void CExternalPlayer : : Process ( ) <nl> CLog : : Log ( LOGERROR , " % s : Invalid RegExp : ' % s ' " , __FUNCTION__ , strPat . c_str ( ) ) ; <nl> continue ; <nl> } <nl> - <nl> + <nl> CStdString strRep = vecSplit [ 2 ] ; <nl> strRep . Replace ( " , , " , " , " ) ; <nl> bool bGlobal = vecSplit [ 3 ] . Find ( ' g ' ) > - 1 ; <nl> void CExternalPlayer : : Process ( ) <nl> <nl> if ( ! nReplaced ) <nl> nReplaced = strFArgs . Replace ( " { 1 } " , mainFile ) + strFArgs . Replace ( " { 2 } " , archiveContent ) ; <nl> - <nl> + <nl> if ( ! nReplaced ) <nl> { <nl> strFArgs . append ( " \ " " ) ; <nl> void CExternalPlayer : : Process ( ) <nl> CLog : : Log ( LOGNOTICE , " % s : Warping cursor to ( % d , % d ) " , __FUNCTION__ , x , y ) ; <nl> SetCursorPos ( x , y ) ; <nl> } <nl> - <nl> - m_hwndXbmc = GetForegroundWindow ( ) ; <nl> <nl> - LONG currentStyle ; <nl> - if ( m_hwndXbmc ) <nl> - { <nl> - currentStyle = GetWindowLong ( m_hwndXbmc , GWL_EXSTYLE ) ; <nl> + LONG currentStyle = GetWindowLong ( g_hWnd , GWL_EXSTYLE ) ; <nl> + # endif <nl> <nl> - if ( m_hidexbmc & & ! m_islauncher ) <nl> - { <nl> - CLog : : Log ( LOGNOTICE , " % s : Hiding XBMC window " , __FUNCTION__ ) ; <nl> - ShowWindow ( m_hwndXbmc , SW_HIDE ) ; <nl> - } <nl> - else if ( currentStyle & WS_EX_TOPMOST ) <nl> - { <nl> - CLog : : Log ( LOGNOTICE , " % s : Lowering XBMC window " , __FUNCTION__ ) ; <nl> - SetWindowPos ( m_hwndXbmc , HWND_BOTTOM , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW ) ; <nl> - } <nl> + if ( m_hidexbmc & & ! m_islauncher ) <nl> + { <nl> + CLog : : Log ( LOGNOTICE , " % s : Hiding XBMC window " , __FUNCTION__ ) ; <nl> + g_Windowing . Hide ( ) ; <nl> + } <nl> + # if defined ( _WIN32 ) <nl> + else if ( currentStyle & WS_EX_TOPMOST ) <nl> + { <nl> + CLog : : Log ( LOGNOTICE , " % s : Lowering XBMC window " , __FUNCTION__ ) ; <nl> + SetWindowPos ( g_hWnd , HWND_BOTTOM , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW ) ; <nl> } <nl> <nl> CLog : : Log ( LOGDEBUG , " % s : Unlocking foreground window " , __FUNCTION__ ) ; <nl> void CExternalPlayer : : Process ( ) <nl> # endif <nl> <nl> m_playbackStartTime = CTimeUtils : : GetTimeMS ( ) ; <nl> - <nl> BOOL ret = TRUE ; <nl> # if defined ( _WIN32 ) <nl> ret = ExecuteAppW32 ( strFName . c_str ( ) , strFArgs . c_str ( ) ) ; <nl> # elif defined ( _LINUX ) <nl> ret = ExecuteAppLinux ( strFArgs . c_str ( ) ) ; <nl> # endif <nl> + int64_t elapsedMillis = CTimeUtils : : GetTimeMS ( ) - m_playbackStartTime ; <nl> <nl> - m_time = m_totalTime ; <nl> - m_bIsPlaying = false ; <nl> - CLog : : Log ( LOGNOTICE , " % s : Stop " , __FUNCTION__ ) ; <nl> - <nl> - # if defined ( _WIN32 ) <nl> - if ( m_hwndXbmc ) <nl> + if ( ret & & ( m_islauncher | | elapsedMillis < LAUNCHER_PROCESS_TIME ) ) <nl> { <nl> - if ( currentStyle & WS_EX_TOPMOST ) <nl> + if ( m_hidexbmc ) <nl> { <nl> - CLog : : Log ( LOGNOTICE , " % s : Showing XBMC window TOPMOST " , __FUNCTION__ ) ; <nl> - SetWindowPos ( m_hwndXbmc , HWND_TOPMOST , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW ) ; <nl> + CLog : : Log ( LOGNOTICE , " % s : XBMC cannot stay hidden for a launcher process " , __FUNCTION__ ) ; <nl> + g_Windowing . Show ( false ) ; <nl> } <nl> - else <nl> + <nl> { <nl> - CLog : : Log ( LOGNOTICE , " % s : Showing XBMC window TOP " , __FUNCTION__ ) ; <nl> - SetWindowPos ( m_hwndXbmc , HWND_TOP , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW ) ; <nl> + CSingleLock lock ( g_graphicsContext ) ; <nl> + m_dialog = ( CGUIDialogOK * ) g_windowManager . GetWindow ( WINDOW_DIALOG_OK ) ; <nl> + m_dialog - > SetHeading ( 23100 ) ; <nl> + m_dialog - > SetLine ( 1 , 23104 ) ; <nl> + m_dialog - > SetLine ( 2 , 23105 ) ; <nl> + m_dialog - > SetLine ( 3 , 23106 ) ; <nl> } <nl> + <nl> + if ( ! m_bAbortRequest ) m_dialog - > DoModal ( ) ; <nl> } <nl> <nl> - CLog : : Log ( LOGDEBUG , " % s : Focus XBMC window and lock foreground window " , __FUNCTION__ ) ; <nl> - SetFocus ( m_hwndXbmc ) ; <nl> - SetForegroundWindow ( m_hwndXbmc ) ; <nl> - LockSetForegroundWindow ( LSFW_LOCK ) ; <nl> + m_bIsPlaying = false ; <nl> + CLog : : Log ( LOGNOTICE , " % s : Stop " , __FUNCTION__ ) ; <nl> <nl> + # if defined ( _WIN32 ) <nl> + if ( currentStyle & WS_EX_TOPMOST ) <nl> + { <nl> + CLog : : Log ( LOGNOTICE , " % s : Showing XBMC window TOPMOST " , __FUNCTION__ ) ; <nl> + SetWindowPos ( g_hWnd , HWND_TOPMOST , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW ) ; <nl> + } <nl> + else <nl> + # endif <nl> + { <nl> + CLog : : Log ( LOGNOTICE , " % s : Showing XBMC window " , __FUNCTION__ ) ; <nl> + g_Windowing . Show ( ) ; <nl> + } <nl> + <nl> + # if defined ( _WIN32 ) <nl> if ( m_warpcursor ) <nl> { <nl> m_xPos = 0 ; <nl> void CExternalPlayer : : Process ( ) <nl> g_audioContext . SetActiveDevice ( iActiveDevice ) ; <nl> } <nl> <nl> - if ( ret ) <nl> - m_callback . OnPlayBackEnded ( ) ; <nl> - else <nl> + if ( ! ret | | ( m_playOneStackItem & & g_application . CurrentFileItem ( ) . IsStack ( ) ) ) <nl> m_callback . OnPlayBackStopped ( ) ; <nl> + else <nl> + m_callback . OnPlayBackEnded ( ) ; <nl> } <nl> <nl> # if defined ( _WIN32 ) <nl> BOOL CExternalPlayer : : ExecuteAppW32 ( const char * strPath , const char * strSwitches <nl> CLog : : Log ( LOGNOTICE , " % s : % s % s " , __FUNCTION__ , strPath , strSwitches ) ; <nl> <nl> STARTUPINFOW si ; <nl> - PROCESS_INFORMATION pi ; <nl> memset ( & si , 0 , sizeof ( si ) ) ; <nl> - memset ( & pi , 0 , sizeof ( pi ) ) ; <nl> si . cb = sizeof ( si ) ; <nl> si . dwFlags = STARTF_USESHOWWINDOW ; <nl> si . wShowWindow = m_hideconsole ? SW_HIDE : SW_SHOW ; <nl> BOOL CExternalPlayer : : ExecuteAppW32 ( const char * strPath , const char * strSwitches <nl> g_charsetConverter . utf8ToW ( strPath , WstrPath ) ; <nl> g_charsetConverter . utf8ToW ( strSwitches , WstrSwitches ) ; <nl> <nl> - m_dialog = ( CGUIDialogOK * ) g_windowManager . GetWindow ( WINDOW_DIALOG_OK ) ; <nl> - m_dialog - > SetHeading ( 23100 ) ; <nl> + if ( m_bAbortRequest ) return false ; <nl> <nl> BOOL ret = CreateProcessW ( WstrPath . IsEmpty ( ) ? NULL : WstrPath . c_str ( ) , <nl> ( LPWSTR ) WstrSwitches . c_str ( ) , NULL , NULL , FALSE , NULL , <nl> - NULL , NULL , & si , & pi ) ; <nl> + NULL , NULL , & si , & m_processInfo ) ; <nl> <nl> if ( ret = = FALSE ) <nl> { <nl> BOOL CExternalPlayer : : ExecuteAppW32 ( const char * strPath , const char * strSwitches <nl> } <nl> else <nl> { <nl> - m_playbackStartTime = CTimeUtils : : GetTimeMS ( ) ; <nl> - BOOL bIsLauncher = m_islauncher ; <nl> - <nl> - if ( m_hidexbmc & & ! m_islauncher ) <nl> - { <nl> - int res = WaitForSingleObject ( pi . hProcess , INFINITE ) ; <nl> - if ( CTimeUtils : : GetTimeMS ( ) - m_playbackStartTime < LAUNCHER_PROCESS_TIME ) <nl> - { <nl> - CLog : : Log ( LOGNOTICE , " % s : External player process ended too quickly , assuming it ' s a launcher process " , __FUNCTION__ ) ; <nl> - bIsLauncher = true ; <nl> - <nl> - if ( m_hwndXbmc & & m_hidexbmc ) <nl> - { <nl> - CLog : : Log ( LOGNOTICE , " % s : XBMC cannot stay hidden for a launcher process " , __FUNCTION__ ) ; <nl> - SetWindowPos ( m_hwndXbmc , HWND_BOTTOM , 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - if ( ! m_hidexbmc | | bIsLauncher ) <nl> - { <nl> - BOOL waiting = false ; <nl> - HANDLE hWait ; <nl> - if ( ! bIsLauncher ) <nl> - { <nl> - waiting = RegisterWaitForSingleObject ( & hWait , pi . hProcess , AppFinished , this , INFINITE , WT_EXECUTEDEFAULT | WT_EXECUTEONLYONCE ) ; <nl> - <nl> - if ( ! waiting ) <nl> - CLog : : Log ( LOGERROR , " % s : Failed to register wait callback ( % d ) " , __FUNCTION__ , GetLastError ( ) ) ; <nl> - } <nl> - <nl> - if ( waiting ) <nl> - { <nl> - m_dialog - > SetLine ( 1 , 23101 ) ; <nl> - m_dialog - > SetLine ( 2 , 23102 ) ; <nl> - m_dialog - > SetLine ( 3 , 23103 ) ; <nl> - } <nl> - else <nl> - { <nl> - m_dialog - > SetLine ( 1 , 23104 ) ; <nl> - m_dialog - > SetLine ( 2 , 23105 ) ; <nl> - m_dialog - > SetLine ( 3 , 23106 ) ; <nl> - } <nl> + int res = WaitForSingleObject ( m_processInfo . hProcess , INFINITE ) ; <nl> <nl> - / / Carry on if we failed to register the wait callback , <nl> - / / the user will have to manually dismiss the dialog <nl> - m_dialog - > DoModal ( ) ; <nl> - <nl> - if ( waiting ) <nl> - UnregisterWait ( hWait ) ; <nl> - <nl> - if ( m_dialog - > IsConfirmed ( ) ) <nl> - / / Post a message telling the player to stop <nl> - PostThreadMessage ( pi . dwThreadId , WM_QUIT , 0 , 0 ) ; <nl> - } <nl> - <nl> - / / In case we ' ve just posted a WM_QUIT we ' ll give the process a short while <nl> - / / to comply before using TerminateProcess <nl> - int res = WaitForSingleObject ( pi . hProcess , PROCESS_GRACE_TIME ) ; <nl> switch ( res ) <nl> { <nl> case WAIT_OBJECT_0 : <nl> BOOL CExternalPlayer : : ExecuteAppW32 ( const char * strPath , const char * strSwitches <nl> CLog : : Log ( LOGNOTICE , " % s : WAIT_ABANDONED " , __FUNCTION__ ) ; <nl> break ; <nl> case WAIT_TIMEOUT : <nl> - CLog : : Log ( LOGNOTICE , " % s : WAIT_TIMEOUT , terminating process " , __FUNCTION__ ) ; <nl> - / / The player hasn ' t stopped gracefully , kill it <nl> - TerminateProcess ( pi . hProcess , 1 ) ; <nl> + CLog : : Log ( LOGNOTICE , " % s : WAIT_TIMEOUT " , __FUNCTION__ ) ; <nl> break ; <nl> case WAIT_FAILED : <nl> - CLog : : Log ( LOGNOTICE , " % s : WAIT_FAILED ( % d ) , terminating process " , __FUNCTION__ , GetLastError ( ) ) ; <nl> - / / The wait failed , give the player a few seconds to stop gracefully before killing it <nl> - Sleep ( PROCESS_GRACE_TIME ) ; <nl> - TerminateProcess ( pi . hProcess , 1 ) ; <nl> + CLog : : Log ( LOGNOTICE , " % s : WAIT_FAILED ( % d ) " , __FUNCTION__ , GetLastError ( ) ) ; <nl> + ret = FALSE ; <nl> break ; <nl> } <nl> - / / else the process exited normally and we closed the dialog programatically <nl> <nl> - CloseHandle ( pi . hThread ) ; <nl> - CloseHandle ( pi . hProcess ) ; <nl> + CloseHandle ( m_processInfo . hThread ) ; <nl> + m_processInfo . hThread = 0 ; <nl> + CloseHandle ( m_processInfo . hProcess ) ; <nl> + m_processInfo . hProcess = 0 ; <nl> } <nl> <nl> return ret ; <nl> } <nl> - <nl> - void CALLBACK CExternalPlayer : : AppFinished ( void * closure , BOOLEAN TimerOrWaitFired ) <nl> - { <nl> - CExternalPlayer * player = ( CExternalPlayer * ) closure ; <nl> - if ( CTimeUtils : : GetTimeMS ( ) - player - > m_playbackStartTime < LAUNCHER_PROCESS_TIME ) <nl> - { <nl> - CLog : : Log ( LOGNOTICE , " % s : Process ran for < % dms , probably a launcher , not closing dialog " , __FUNCTION__ , LAUNCHER_PROCESS_TIME ) ; <nl> - } <nl> - else <nl> - { <nl> - CLog : : Log ( LOGNOTICE , " % s : Process ended , closing dialog " , __FUNCTION__ ) ; <nl> - if ( player - > m_dialog - > IsActive ( ) ) <nl> - player - > m_dialog - > Close ( ) ; <nl> - } <nl> - } <nl> # endif <nl> <nl> # if defined ( _LINUX ) <nl> BOOL CExternalPlayer : : ExecuteAppLinux ( const char * strSwitches ) <nl> g_RemoteControl . Disconnect ( ) ; <nl> g_RemoteControl . setUsed ( false ) ; <nl> # endif <nl> - g_graphicsContext . Lock ( ) ; <nl> <nl> int ret = system ( strSwitches ) ; <nl> <nl> - g_graphicsContext . Unlock ( ) ; <nl> # ifdef HAS_LIRC <nl> g_RemoteControl . setUsed ( remoteused ) ; <nl> g_RemoteControl . Initialize ( ) ; <nl> void CExternalPlayer : : SeekPercentage ( float iPercent ) <nl> <nl> float CExternalPlayer : : GetPercentage ( ) <nl> { <nl> - return ( m_totalTime * 100 . 0f ) / m_time ; <nl> + __int64 iTime = GetTime ( ) ; <nl> + __int64 iTotalTime = GetTotalTime ( ) * 1000 ; <nl> + <nl> + if ( iTotalTime ! = 0 ) <nl> + { <nl> + CLog : : Log ( LOGDEBUG , " Percentage is % f " , ( iTime * 100 / ( float ) iTotalTime ) ) ; <nl> + return iTime * 100 / ( float ) iTotalTime ; <nl> + } <nl> + <nl> + return 0 . 0f ; <nl> } <nl> <nl> void CExternalPlayer : : SetAVDelay ( float fValue ) <nl> void CExternalPlayer : : SeekTime ( __int64 iTime ) <nl> { <nl> } <nl> <nl> - __int64 CExternalPlayer : : GetTime ( ) <nl> + __int64 CExternalPlayer : : GetTime ( ) / / in millis <nl> { <nl> + if ( ( CTimeUtils : : GetTimeMS ( ) - m_playbackStartTime ) / 1000 > m_playCountMinTime ) <nl> + { <nl> + m_time = m_totalTime * 1000 ; <nl> + } <nl> + <nl> return m_time ; <nl> } <nl> <nl> - int CExternalPlayer : : GetTotalTime ( ) <nl> + int CExternalPlayer : : GetTotalTime ( ) / / in seconds <nl> { <nl> return m_totalTime ; <nl> } <nl> bool CExternalPlayer : : Initialize ( TiXmlElement * pConfig ) <nl> } <nl> <nl> XMLUtils : : GetString ( pConfig , " args " , m_args ) ; <nl> + XMLUtils : : GetBoolean ( pConfig , " playonestackitem " , m_playOneStackItem ) ; <nl> XMLUtils : : GetBoolean ( pConfig , " islauncher " , m_islauncher ) ; <nl> XMLUtils : : GetBoolean ( pConfig , " hidexbmc " , m_hidexbmc ) ; <nl> if ( ! XMLUtils : : GetBoolean ( pConfig , " hideconsole " , m_hideconsole ) ) <nl> bool CExternalPlayer : : Initialize ( TiXmlElement * pConfig ) <nl> } <nl> } <nl> <nl> + XMLUtils : : GetInt ( pConfig , " playcountminimumtime " , m_playCountMinTime , 1 , INT_MAX ) ; <nl> + <nl> CLog : : Log ( LOGNOTICE , " ExternalPlayer Tweaks : hideconsole ( % s ) , hidexbmc ( % s ) , islauncher ( % s ) , warpcursor ( % s ) " , <nl> m_hideconsole ? " true " : " false " , <nl> m_hidexbmc ? " true " : " false " , <nl> void CExternalPlayer : : GetCustomRegexpReplacers ( TiXmlElement * pRootElement , <nl> strMatch . Replace ( " , " , " , , " ) ; <nl> strPat . Replace ( " , " , " , , " ) ; <nl> strRep . Replace ( " , " , " , , " ) ; <nl> - <nl> + <nl> CStdString strReplacer = strMatch + " , " + strPat + " , " + strRep + " , " + ( bGlobal ? " g " : " " ) + ( bStop ? " s " : " " ) ; <nl> if ( iAction = = 2 ) <nl> settings . insert ( settings . begin ( ) + i + + , 1 , strReplacer ) ; <nl> mmm a / xbmc / cores / ExternalPlayer / ExternalPlayer . h <nl> ppp b / xbmc / cores / ExternalPlayer / ExternalPlayer . h <nl> class CExternalPlayer : public IPlayer , public CThread <nl> <nl> # if defined ( _WIN32 ) <nl> virtual BOOL ExecuteAppW32 ( const char * strPath , const char * strSwitches ) ; <nl> - static void CALLBACK AppFinished ( void * closure , BOOLEAN TimerOrWaitFired ) ; <nl> - # endif <nl> - <nl> - # if defined ( _LINUX ) <nl> + / / static void CALLBACK AppFinished ( void * closure , BOOLEAN TimerOrWaitFired ) ; <nl> + # elif defined ( _LINUX ) <nl> virtual BOOL ExecuteAppLinux ( const char * strSwitches ) ; <nl> # endif <nl> <nl> class CExternalPlayer : public IPlayer , public CThread <nl> void GetCustomRegexpReplacers ( TiXmlElement * pRootElement , CStdStringArray & settings ) ; <nl> virtual void Process ( ) ; <nl> <nl> + bool m_bAbortRequest ; <nl> bool m_bIsPlaying ; <nl> bool m_paused ; <nl> - DWORD m_playbackStartTime ; <nl> + int64_t m_playbackStartTime ; <nl> int m_speed ; <nl> int m_totalTime ; <nl> int m_time ; <nl> class CExternalPlayer : public IPlayer , public CThread <nl> HWND m_hwndXbmc ; <nl> # if defined ( _WIN32 ) <nl> POINT m_ptCursorpos ; <nl> + PROCESS_INFORMATION m_processInfo ; <nl> # endif <nl> CGUIDialogOK * m_dialog ; <nl> int m_xPos ; <nl> class CExternalPlayer : public IPlayer , public CThread <nl> bool m_hideconsole ; <nl> bool m_hidexbmc ; <nl> bool m_islauncher ; <nl> + bool m_playOneStackItem ; <nl> WARP_CURSOR m_warpcursor ; <nl> + int m_playCountMinTime ; <nl> CStdStringArray m_filenameReplacers ; <nl> } ; <nl>
|
updated : extplayer now supports hidexbmc and doesn ' t lock the graphicscontext on linux .
|
xbmc/xbmc
|
ea2c58624d0b3ac2eb519996fa6fe8da50acc2fa
|
2009-10-10T10:30:50Z
|
mmm a / src / mongo / util / log . h <nl> ppp b / src / mongo / util / log . h <nl> namespace logger { <nl> / / MONGO_LOG uses log component from MongoLogDefaultComponent from current or global namespace . <nl> # define MONGO_LOG ( DLEVEL ) \ <nl> if ( ! ( : : mongo : : logger : : globalLogDomain ( ) ) - > shouldLog ( MongoLogDefaultComponent_component , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) ) ) { } \ <nl> - else LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , MongoLogDefaultComponent_component ) <nl> + else : : mongo : : logger : : LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , : : mongo : : getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , MongoLogDefaultComponent_component ) <nl> <nl> # define LOG MONGO_LOG <nl> <nl> # define MONGO_LOG_COMPONENT ( DLEVEL , COMPONENT1 ) \ <nl> if ( ! ( : : mongo : : logger : : globalLogDomain ( ) ) - > shouldLog ( ( COMPONENT1 ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) ) ) { } \ <nl> - else LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , ( COMPONENT1 ) ) <nl> + else : : mongo : : logger : : LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , : : mongo : : getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , ( COMPONENT1 ) ) <nl> <nl> # define MONGO_LOG_COMPONENT2 ( DLEVEL , COMPONENT1 , COMPONENT2 ) \ <nl> if ( ! ( : : mongo : : logger : : globalLogDomain ( ) ) - > shouldLog ( ( COMPONENT1 ) , ( COMPONENT2 ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) ) ) { } \ <nl> - else LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , ( COMPONENT1 ) ) <nl> + else : : mongo : : logger : : LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , : : mongo : : getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , ( COMPONENT1 ) ) <nl> <nl> # define MONGO_LOG_COMPONENT3 ( DLEVEL , COMPONENT1 , COMPONENT2 , COMPONENT3 ) \ <nl> if ( ! ( : : mongo : : logger : : globalLogDomain ( ) ) - > shouldLog ( ( COMPONENT1 ) , ( COMPONENT2 ) , ( COMPONENT3 ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) ) ) { } \ <nl> - else LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , ( COMPONENT1 ) ) <nl> + else : : mongo : : logger : : LogstreamBuilder ( : : mongo : : logger : : globalLogDomain ( ) , : : mongo : : getThreadName ( ) , : : mongo : : LogstreamBuilder : : severityCast ( DLEVEL ) , ( COMPONENT1 ) ) <nl> <nl> / * * <nl> * Rotates the log files . Returns true if all logs rotate successfully . <nl>
|
SERVER - 5092 qualify LogstreamBuilder and getThreadName in MONGO_LOG macros
|
mongodb/mongo
|
adc36ff6450b1ee493b9acd26d3e79bd4facf953
|
2014-08-08T02:13:48Z
|
mmm a / python / mxnet / optimizer . py <nl> ppp b / python / mxnet / optimizer . py <nl> class __metaclass__ ( type ) : <nl> of Optimizer . " " " <nl> __optimizers__ = { } <nl> <nl> - def __new__ ( meta , name , bases , attrs ) : <nl> - cls = type . __new__ ( meta , name , bases , attrs ) <nl> - # Allow overriding of existing optimizer . <nl> + def __new__ ( mcs , name , bases , attrs ) : <nl> + cls = type . __new__ ( mcs , name , bases , attrs ) <nl> + # Allow overriding of existing optimizer , but give a warning . <nl> # Always keep the last one . <nl> - meta . __optimizers__ [ cls . __name__ . lower ( ) ] = cls <nl> + cls_name = cls . __name__ . lower ( ) <nl> + if cls_name in mcs . __optimizers__ : <nl> + print ' WARNING : New optimizer % s . % s is overriding ' \ <nl> + ' existing optimizer % s . % s ' % ( <nl> + cls . __module__ , cls . __name__ , <nl> + mcs . __optimizers__ [ cls_name ] . __module__ , <nl> + mcs . __optimizers__ [ cls_name ] . __name__ ) <nl> + mcs . __optimizers__ [ cls_name ] = cls <nl> return cls <nl> <nl> def __init__ ( self , rescale_grad = 1 ) : <nl> def create ( name , rescale_grad = 1 , * * kwargs ) : <nl> " " " <nl> if name in Optimizer . __optimizers__ : <nl> return Optimizer . __optimizers__ [ name . lower ( ) ] ( <nl> - rescale_grad = rescale_grad , <nl> - * * kwargs ) <nl> + rescale_grad = rescale_grad , <nl> + * * kwargs ) <nl> else : <nl> raise ValueError ( ' Cannot find optimizer % s ' % name ) <nl> <nl>
|
fixed lint error
|
apache/incubator-mxnet
|
d3feb835a1ac3cc065ee922f6b89199eb19b9f3b
|
2015-10-22T18:02:30Z
|
mmm a / tensorflow / python / kernel_tests / cwise_ops_test . py <nl> ppp b / tensorflow / python / kernel_tests / cwise_ops_test . py <nl> class SingularGradientOpTest ( test . TestCase ) : <nl> <nl> @ test_util . run_deprecated_v1 <nl> def testGradientAtSingularity ( self ) : <nl> - if not compat . forward_compatible ( 2019 , 9 , 14 ) : <nl> + if not compat . forward_compatible ( 2019 , 12 , 14 ) : <nl> self . skipTest ( " Skipping test for future functionality . " ) <nl> <nl> ops_and_singularity = [ <nl>
|
Move forward compatibility date by 3 months .
|
tensorflow/tensorflow
|
f15b613f7eb59edb3feec221bfd17a2249efc851
|
2019-09-16T10:07:13Z
|
mmm a / tensorflow / lite / delegates / gpu / cl / arguments . cc <nl> ppp b / tensorflow / lite / delegates / gpu / cl / arguments . cc <nl> void Arguments : : ResolveObjectNames ( const std : : string & object_name , <nl> } <nl> } <nl> <nl> + GPUObjectDescriptor * Arguments : : GetObjectDescriptor ( <nl> + const std : : string & object_name ) const { <nl> + { <nl> + auto it = object_refs_ . find ( object_name ) ; <nl> + if ( it ! = object_refs_ . end ( ) ) { <nl> + return it - > second . descriptor . get ( ) ; <nl> + } <nl> + } <nl> + { <nl> + auto it = objects_ . find ( object_name ) ; <nl> + if ( it ! = objects_ . end ( ) ) { <nl> + return it - > second . descriptor . get ( ) ; <nl> + } <nl> + } <nl> + return nullptr ; <nl> + } <nl> + <nl> absl : : Status Arguments : : ResolveSelector ( <nl> const std : : map < std : : string , std : : string > & linkables , <nl> const std : : string & object_name , const std : : string & selector , <nl> const std : : vector < std : : string > & args , <nl> const std : : vector < std : : string > & template_args , std : : string * result ) { <nl> - const GPUObjectDescriptor * desc_ptr ; <nl> - if ( auto it = object_refs_ . find ( object_name ) ; it ! = object_refs_ . end ( ) ) { <nl> - desc_ptr = it - > second . descriptor . get ( ) ; <nl> - } else if ( auto it = objects_ . find ( object_name ) ; it ! = objects_ . end ( ) ) { <nl> - desc_ptr = it - > second . descriptor . get ( ) ; <nl> - } else { <nl> + const GPUObjectDescriptor * desc_ptr = GetObjectDescriptor ( object_name ) ; <nl> + if ( ! desc_ptr ) { <nl> return absl : : NotFoundError ( <nl> absl : : StrCat ( " No object with name - " , object_name ) ) ; <nl> } <nl> auto names = desc_ptr - > GetGPUResources ( ) . GetNames ( ) ; <nl> const auto * tensor_desc = dynamic_cast < const TensorDescriptor * > ( desc_ptr ) ; <nl> if ( tensor_desc & & selector = = " Write " ) { <nl> - if ( auto it = linkables . find ( object_name ) ; it ! = linkables . end ( ) ) { <nl> + auto it = linkables . find ( object_name ) ; <nl> + if ( it ! = linkables . end ( ) ) { <nl> if ( desc_ptr - > GetAccess ( ) ! = AccessType : : WRITE & & <nl> desc_ptr - > GetAccess ( ) ! = AccessType : : READ_WRITE ) { <nl> return absl : : FailedPreconditionError ( absl : : StrCat ( <nl> mmm a / tensorflow / lite / delegates / gpu / cl / arguments . h <nl> ppp b / tensorflow / lite / delegates / gpu / cl / arguments . h <nl> class Arguments : public ArgumentsBinder { <nl> const std : : vector < std : : string > & member_names , <nl> std : : string * code ) ; <nl> <nl> + GPUObjectDescriptor * GetObjectDescriptor ( <nl> + const std : : string & object_name ) const ; <nl> + <nl> static constexpr char kArgsPrefix [ ] = " args . " ; <nl> <nl> struct IntValue { <nl>
|
Downgrade c + + 17 syntax to c + + 14 .
|
tensorflow/tensorflow
|
7e6c28f901edb49f900d2d721aedd0040c017604
|
2020-10-14T22:11:40Z
|
mmm a / src / core / support / avl . c <nl> ppp b / src / core / support / avl . c <nl> static gpr_avl_node * assert_invariants ( gpr_avl_node * n ) { <nl> return n ; <nl> } <nl> # else <nl> - static gpr_avl_node * assert_invariants ( gpr_avl_node * n ) { <nl> - return n ; <nl> - } <nl> + static gpr_avl_node * assert_invariants ( gpr_avl_node * n ) { return n ; } <nl> # endif <nl> <nl> gpr_avl_node * new_node ( void * key , void * value , gpr_avl_node * left , <nl> static gpr_avl_node * rebalance ( const gpr_avl_vtable * vtable , void * key , <nl> static gpr_avl_node * add ( const gpr_avl_vtable * vtable , gpr_avl_node * node , <nl> void * key , void * value ) { <nl> long cmp ; <nl> - gpr_avl_node * l ; <nl> - gpr_avl_node * r ; <nl> if ( node = = NULL ) { <nl> return new_node ( key , value , NULL , NULL ) ; <nl> } <nl> cmp = vtable - > compare_keys ( node - > key , key ) ; <nl> if ( cmp = = 0 ) { <nl> - return assert_invariants ( <nl> - new_node ( key , value , ref_node ( node - > left ) , ref_node ( node - > right ) ) ) ; <nl> - } <nl> - <nl> - l = node - > left ; <nl> - r = node - > right ; <nl> - if ( cmp > 0 ) { <nl> - l = add ( vtable , l , key , value ) ; <nl> - ref_node ( r ) ; <nl> + return new_node ( key , value , ref_node ( node - > left ) , ref_node ( node - > right ) ) ; <nl> + } else if ( cmp > 0 ) { <nl> + return rebalance ( vtable , vtable - > copy_key ( node - > key ) , <nl> + vtable - > copy_value ( node - > value ) , <nl> + add ( vtable , node - > left , key , value ) , ref_node ( node - > right ) ) ; <nl> } else { <nl> - r = add ( vtable , r , key , value ) ; <nl> - ref_node ( l ) ; <nl> + return rebalance ( vtable , vtable - > copy_key ( node - > key ) , <nl> + vtable - > copy_value ( node - > value ) , ref_node ( node - > left ) , <nl> + add ( vtable , node - > right , key , value ) ) ; <nl> } <nl> - return rebalance ( vtable , vtable - > copy_key ( node - > key ) , <nl> - vtable - > copy_value ( node - > value ) , l , r ) ; <nl> } <nl> <nl> gpr_avl gpr_avl_add ( gpr_avl avl , void * key , void * value ) { <nl> static gpr_avl_node * in_order_tail ( gpr_avl_node * node ) { <nl> static gpr_avl_node * remove ( const gpr_avl_vtable * vtable , gpr_avl_node * node , <nl> void * key ) { <nl> long cmp ; <nl> - gpr_avl_node * l ; <nl> - gpr_avl_node * r ; <nl> if ( node = = NULL ) { <nl> return NULL ; <nl> } <nl> static gpr_avl_node * remove ( const gpr_avl_vtable * vtable , gpr_avl_node * node , <nl> return ref_node ( node - > left ) ; <nl> } else if ( node - > left - > height < node - > right - > height ) { <nl> gpr_avl_node * h = in_order_head ( node - > right ) ; <nl> - l = ref_node ( node - > left ) ; <nl> - r = remove ( vtable , node - > right , h - > key ) ; <nl> - return assert_invariants ( rebalance ( vtable , vtable - > copy_key ( h - > key ) , <nl> - vtable - > copy_value ( h - > value ) , l , r ) ) ; <nl> + return rebalance ( vtable , vtable - > copy_key ( h - > key ) , <nl> + vtable - > copy_value ( h - > value ) , ref_node ( node - > left ) , remove ( vtable , node - > right , h - > key ) ) ; <nl> } else { <nl> gpr_avl_node * h = in_order_tail ( node - > left ) ; <nl> - l = remove ( vtable , node - > left , h - > key ) ; <nl> - r = ref_node ( node - > right ) ; <nl> - return assert_invariants ( rebalance ( vtable , vtable - > copy_key ( h - > key ) , <nl> - vtable - > copy_value ( h - > value ) , l , r ) ) ; <nl> + return rebalance ( vtable , vtable - > copy_key ( h - > key ) , <nl> + vtable - > copy_value ( h - > value ) , remove ( vtable , node - > left , h - > key ) , ref_node ( node - > right ) ) ; <nl> } <nl> - } <nl> - <nl> - l = node - > left ; <nl> - r = node - > right ; <nl> - if ( cmp > 0 ) { <nl> - l = remove ( vtable , l , key ) ; <nl> - ref_node ( r ) ; <nl> + } else if ( cmp > 0 ) { <nl> + return rebalance ( vtable , vtable - > copy_key ( node - > key ) , <nl> + vtable - > copy_value ( node - > value ) , <nl> + remove ( vtable , node - > left , key ) , ref_node ( node - > right ) ) ; <nl> } else { <nl> - r = remove ( vtable , r , key ) ; <nl> - ref_node ( l ) ; <nl> + return rebalance ( vtable , vtable - > copy_key ( node - > key ) , <nl> + vtable - > copy_value ( node - > value ) , ref_node ( node - > left ) , <nl> + remove ( vtable , node - > right , key ) ) ; <nl> } <nl> - return rebalance ( vtable , vtable - > copy_key ( node - > key ) , <nl> - vtable - > copy_value ( node - > value ) , l , r ) ; <nl> } <nl> <nl> gpr_avl gpr_avl_remove ( gpr_avl avl , void * key ) { <nl>
|
Reduce code size for AVL tree
|
grpc/grpc
|
22d11e1a7646f78897b77f8bc0051fc10d459e89
|
2015-11-23T23:33:54Z
|
mmm a / hphp / hack / src / server / serverLocalConfig . ml <nl> ppp b / hphp / hack / src / server / serverLocalConfig . ml <nl> let apply_overrides ~ silent ~ current_version ~ config ~ overrides = <nl> if enabled then ( <nl> Disk . mkdir_p GlobalConfig . tmp_dir ; <nl> let dir = string_ " path " ~ prefix ~ default : GlobalConfig . tmp_dir config in <nl> - let owner = <nl> - Experiments_config_file . get_primary_owner <nl> - ~ logged_in_user : ( Sys_utils . logname ( ) ) <nl> - in <nl> + let owner = Sys_utils . get_primary_owner ( ) in <nl> let file = Filename . concat dir ( Printf . sprintf " hh . % s . experiments " owner ) in <nl> let update = <nl> bool_if_min_version <nl> mmm a / hphp / hack / src / stubs / experiments_config_file . ml <nl> ppp b / hphp / hack / src / stubs / experiments_config_file . ml <nl> let update ~ ( file : string ) ~ ( source : string option ) ~ ( ttl : float ) : <nl> ( string , string ) result = <nl> ignore ( file , source , ttl ) ; <nl> Ok " Experiments config update : nothing to do " <nl> - <nl> - let get_primary_owner ~ ( logged_in_user : string ) : string = logged_in_user <nl> mmm a / hphp / hack / src / utils / sys / sys_utils . ml <nl> ppp b / hphp / hack / src / utils / sys / sys_utils . ml <nl> let logname_lazy = lazy ( logname_impl ( ) ) <nl> <nl> let logname ( ) = Lazy . force logname_lazy <nl> <nl> + let get_primary_owner ( ) = <nl> + let owners_file = " / etc / devserver . owners " in <nl> + let logged_in_user = logname ( ) in <nl> + if not ( Disk . file_exists owners_file ) then <nl> + logged_in_user <nl> + else <nl> + let lines = Core_kernel . String . split_lines ( Disk . cat owners_file ) in <nl> + if List . mem lines logged_in_user ~ equal : ( = ) then <nl> + logged_in_user <nl> + else <nl> + lines | > List . last | > Option . value ~ default : logged_in_user <nl> + <nl> let with_umask umask f = <nl> let old_umask = ref 0 in <nl> Utils . with_context <nl> mmm a / hphp / hack / src / utils / sys / sys_utils . mli <nl> ppp b / hphp / hack / src / utils / sys / sys_utils . mli <nl> val logname_impl : unit - > string <nl> <nl> val logname : unit - > string <nl> <nl> + val get_primary_owner : unit - > string <nl> + <nl> val with_umask : int - > ( unit - > ' a ) - > ' a <nl> <nl> val read_stdin_to_string : unit - > string <nl>
|
Pass unixname to ranked autocomplete server as query argument
|
facebook/hhvm
|
b1a9499b7d1cdfd059922a9b85b7e197954cf9e0
|
2020-06-20T08:53:51Z
|
mmm a / src / wallet / rpcwallet . cpp <nl> ppp b / src / wallet / rpcwallet . cpp <nl> UniValue fundrawtransaction ( const JSONRPCRequest & request ) <nl> " \ " changePosition \ " ( numeric , optional , default random ) The index of the change output \ n " <nl> " \ " includeWatching \ " ( boolean , optional , default false ) Also select inputs which are watch only \ n " <nl> " \ " lockUnspents \ " ( boolean , optional , default false ) Lock selected unspent outputs \ n " <nl> + " \ " reserveChangeKey \ " ( boolean , optional , default true ) Reserves the change output key from the keypool \ n " <nl> " \ " feeRate \ " ( numeric , optional , default not set : makes wallet determine the fee ) Set a specific feerate ( " + CURRENCY_UNIT + " per KB ) \ n " <nl> " \ " subtractFeeFromOutputs \ " ( array , optional ) A json array of integers . \ n " <nl> " The fee will be equally deducted from the amount of each specified output . \ n " <nl> UniValue fundrawtransaction ( const JSONRPCRequest & request ) <nl> int changePosition = - 1 ; <nl> bool includeWatching = false ; <nl> bool lockUnspents = false ; <nl> + bool reserveChangeKey = true ; <nl> CFeeRate feeRate = CFeeRate ( 0 ) ; <nl> bool overrideEstimatedFeerate = false ; <nl> UniValue subtractFeeFromOutputs ; <nl> UniValue fundrawtransaction ( const JSONRPCRequest & request ) <nl> { " changePosition " , UniValueType ( UniValue : : VNUM ) } , <nl> { " includeWatching " , UniValueType ( UniValue : : VBOOL ) } , <nl> { " lockUnspents " , UniValueType ( UniValue : : VBOOL ) } , <nl> + { " reserveChangeKey " , UniValueType ( UniValue : : VBOOL ) } , <nl> { " feeRate " , UniValueType ( ) } , / / will be checked below <nl> { " subtractFeeFromOutputs " , UniValueType ( UniValue : : VARR ) } , <nl> } , <nl> UniValue fundrawtransaction ( const JSONRPCRequest & request ) <nl> if ( options . exists ( " lockUnspents " ) ) <nl> lockUnspents = options [ " lockUnspents " ] . get_bool ( ) ; <nl> <nl> + if ( options . exists ( " reserveChangeKey " ) ) <nl> + reserveChangeKey = options [ " reserveChangeKey " ] . get_bool ( ) ; <nl> + <nl> if ( options . exists ( " feeRate " ) ) <nl> { <nl> feeRate = CFeeRate ( AmountFromValue ( options [ " feeRate " ] ) ) ; <nl> UniValue fundrawtransaction ( const JSONRPCRequest & request ) <nl> CAmount nFeeOut ; <nl> string strFailReason ; <nl> <nl> - if ( ! pwalletMain - > FundTransaction ( tx , nFeeOut , overrideEstimatedFeerate , feeRate , changePosition , strFailReason , includeWatching , lockUnspents , setSubtractFeeFromOutputs , changeAddress ) ) <nl> + if ( ! pwalletMain - > FundTransaction ( tx , nFeeOut , overrideEstimatedFeerate , feeRate , changePosition , strFailReason , includeWatching , lockUnspents , setSubtractFeeFromOutputs , reserveChangeKey , changeAddress ) ) <nl> throw JSONRPCError ( RPC_INTERNAL_ERROR , strFailReason ) ; <nl> <nl> UniValue result ( UniValue : : VOBJ ) ; <nl> mmm a / src / wallet / wallet . cpp <nl> ppp b / src / wallet / wallet . cpp <nl> bool CWallet : : SelectCoins ( const vector < COutput > & vAvailableCoins , const CAmount & <nl> return res ; <nl> } <nl> <nl> - bool CWallet : : FundTransaction ( CMutableTransaction & tx , CAmount & nFeeRet , bool overrideEstimatedFeeRate , const CFeeRate & specificFeeRate , int & nChangePosInOut , std : : string & strFailReason , bool includeWatching , bool lockUnspents , const std : : set < int > & setSubtractFeeFromOutputs , const CTxDestination & destChange ) <nl> + bool CWallet : : FundTransaction ( CMutableTransaction & tx , CAmount & nFeeRet , bool overrideEstimatedFeeRate , const CFeeRate & specificFeeRate , int & nChangePosInOut , std : : string & strFailReason , bool includeWatching , bool lockUnspents , const std : : set < int > & setSubtractFeeFromOutputs , bool keepReserveKey , const CTxDestination & destChange ) <nl> { <nl> vector < CRecipient > vecSend ; <nl> <nl> bool CWallet : : FundTransaction ( CMutableTransaction & tx , CAmount & nFeeRet , bool ov <nl> } <nl> } <nl> <nl> + / / optionally keep the change output key <nl> + if ( keepReserveKey ) <nl> + reservekey . KeepKey ( ) ; <nl> + <nl> return true ; <nl> } <nl> <nl> mmm a / src / wallet / wallet . h <nl> ppp b / src / wallet / wallet . h <nl> class CWallet : public CCryptoKeyStore , public CValidationInterface <nl> * Insert additional inputs into the transaction by <nl> * calling CreateTransaction ( ) ; <nl> * / <nl> - bool FundTransaction ( CMutableTransaction & tx , CAmount & nFeeRet , bool overrideEstimatedFeeRate , const CFeeRate & specificFeeRate , int & nChangePosInOut , std : : string & strFailReason , bool includeWatching , bool lockUnspents , const std : : set < int > & setSubtractFeeFromOutputs , const CTxDestination & destChange = CNoDestination ( ) ) ; <nl> + bool FundTransaction ( CMutableTransaction & tx , CAmount & nFeeRet , bool overrideEstimatedFeeRate , const CFeeRate & specificFeeRate , int & nChangePosInOut , std : : string & strFailReason , bool includeWatching , bool lockUnspents , const std : : set < int > & setSubtractFeeFromOutputs , bool keepReserveKey = true , const CTxDestination & destChange = CNoDestination ( ) ) ; <nl> <nl> / * * <nl> * Create a new transaction paying the recipients with a set of coins <nl>
|
[ Wallet ] Add an option to keep the change address key , true by default
|
bitcoin/bitcoin
|
9aa4e6a6c2cb9b4465d014c8efa672a919ff8f89
|
2017-01-19T19:38:37Z
|
mmm a / hphp / runtime / vm / jit / load - elim . cpp <nl> ppp b / hphp / runtime / vm / jit / load - elim . cpp <nl> <nl> # include " hphp / runtime / vm / jit / opt . h " <nl> <nl> # include < cstdint > <nl> + # include < utility > <nl> + # include < tuple > <nl> <nl> # include < folly / ScopeGuard . h > <nl> <nl> <nl> # include " hphp / runtime / vm / jit / state - vector . h " <nl> # include " hphp / runtime / vm / jit / analysis . h " <nl> # include " hphp / runtime / vm / jit / alias - analysis . h " <nl> + # include " hphp / runtime / vm / jit / mutation . h " <nl> <nl> namespace HPHP { namespace jit { <nl> <nl> struct TrackedLoc { <nl> <nl> / * <nl> * We may have a known type even without an available value , or that is more <nl> - * refined than knownValue - > type ( ) . <nl> + * refined than knownValue - > type ( ) . Always at least as refined as <nl> + * knownValue - > type ( ) , if knownValue is not nullptr . <nl> * / <nl> Type knownType { Type : : Top } ; <nl> } ; <nl> struct Flags { <nl> * / <nl> SSATmp * replaceable { nullptr } ; <nl> <nl> + / * <nl> + * If set , the instruction was a pure load , and ` replaceable ' is not nullptr , <nl> + * this will be the best type we know for the value at this point . <nl> + * / <nl> + Type knownType ; <nl> + <nl> / * <nl> * If true , the instruction was a conditional jump that can be converted to <nl> * an unconditional jump to it ' s next ( ) edge . <nl> TrackedLoc * find_tracked ( Local & env , <nl> : nullptr ; <nl> } <nl> <nl> - SSATmp * load ( Local & env , const IRInstruction & inst , AliasClass acls ) { <nl> + std : : pair < SSATmp * , Type > load ( Local & env , <nl> + const IRInstruction & inst , <nl> + AliasClass acls ) { <nl> acls = canonicalize ( acls ) ; <nl> auto const meta = env . global . ainfo . find ( acls ) ; <nl> - if ( ! meta ) return nullptr ; <nl> + if ( ! meta ) return { nullptr , Type : : Gen } ; <nl> assert ( meta - > index < kMaxTrackedALocs ) ; <nl> auto & tracked = env . state . tracked [ meta - > index ] ; <nl> <nl> if ( env . state . avail [ meta - > index ] ) { <nl> - if ( tracked . knownValue ) return tracked . knownValue ; <nl> + if ( tracked . knownValue ) return { tracked . knownValue , tracked . knownType } ; <nl> / * <nl> * We didn ' t have a value , but we had an available type . This can happen <nl> * at control flow joins right now ( since we don ' t have support for <nl> SSATmp * load ( Local & env , const IRInstruction & inst , AliasClass acls ) { <nl> <nl> FTRACE ( 4 , " { } < - { } \ n " , show ( acls ) , inst . dst ( ) - > toString ( ) ) ; <nl> FTRACE ( 5 , " av : { } \ n " , show ( env . state . avail ) ) ; <nl> - return nullptr ; <nl> + return { nullptr , Type : : Gen } ; <nl> } <nl> <nl> void store ( Local & env , AliasClass acls , SSATmp * value ) { <nl> Flags analyze_inst ( Local & env , <nl> [ & ] ( IterEffects ) { clear_everything ( env ) ; } , <nl> [ & ] ( IterEffects2 ) { clear_everything ( env ) ; } , <nl> <nl> - [ & ] ( PureLoad m ) { flags . replaceable = load ( env , inst , m . src ) ; } , <nl> [ & ] ( PureStore m ) { store ( env , m . dst , m . value ) ; } , <nl> [ & ] ( PureStoreNT m ) { store ( env , m . dst , m . value ) ; } , <nl> <nl> + [ & ] ( PureLoad m ) { <nl> + std : : tie ( flags . replaceable , flags . knownType ) = load ( env , inst , m . src ) ; <nl> + } , <nl> + <nl> [ & ] ( MayLoadStore m ) { <nl> store ( env , m . stores , nullptr ) ; <nl> <nl> void optimize_block ( Local & env , Block * blk ) { <nl> for ( auto & inst : * blk ) { <nl> auto const flags = analyze_inst ( env , inst , [ & ] ( Block * , const State & ) { } ) ; <nl> <nl> - auto const can_replace = [ & ] ( SSATmp * what ) - > bool { <nl> - if ( ! ( what - > type ( ) < = inst . dst ( ) - > type ( ) ) ) { <nl> + auto const can_replace = [ & ] ( SSATmp * what , Type knownType ) - > bool { <nl> + if ( ! ( knownType < = inst . dst ( ) - > type ( ) ) ) { <nl> / * <nl> - * TODO ( # 5664026 ) : For now we can ' t replace values that have types that <nl> - * aren ' t at least as narrow as the current tmp we are replacing . If <nl> - * we wanted to , we could insert them as AssertType opcodes here , but <nl> - * codegen - x64 can ' t handle those kinds of assert types right now . <nl> + * It ' s possible we could assert the intersection of the types , but <nl> + * it ' s not entirely clear what situations this would happen in , so <nl> + * let ' s just not do it in this case for now . <nl> * / <nl> - FTRACE ( 2 , " type would change too much ; not right now \ n " ) ; <nl> + FTRACE ( 2 , " knownType wasn ' t substitutable ; not right now \ n " ) ; <nl> return false ; <nl> } <nl> <nl> void optimize_block ( Local & env , Block * blk ) { <nl> return dominates ( defBlock , inst . block ( ) , env . global . idoms ) ; <nl> } ; <nl> <nl> - if ( flags . replaceable & & can_replace ( flags . replaceable ) ) { <nl> - FTRACE ( 2 , " redundant : { } = Mov { } \ n " , inst . dst ( ) - > toString ( ) , <nl> + if ( flags . replaceable & & can_replace ( flags . replaceable , flags . knownType ) ) { <nl> + FTRACE ( 2 , " redundant : { } : : { } = { } \ n " , <nl> + inst . dst ( ) - > toString ( ) , <nl> + flags . knownType . toString ( ) , <nl> flags . replaceable - > toString ( ) ) ; <nl> - env . global . unit . replace ( & inst , Mov , flags . replaceable ) ; <nl> + env . global . unit . replace ( & inst , AssertType , flags . knownType , <nl> + flags . replaceable ) ; <nl> continue ; <nl> } <nl> <nl> void optimizeLoads ( IRUnit & unit ) { <nl> auto env = Local { genv , genv . blockInfo [ blk ] . stateIn } ; <nl> optimize_block ( env , blk ) ; <nl> } <nl> + FTRACE ( 2 , " reflowing types \ n " ) ; <nl> + reflowTypes ( genv . unit ) ; <nl> } <nl> <nl> / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / <nl> mmm a / hphp / runtime / vm / jit / opt . cpp <nl> ppp b / hphp / runtime / vm / jit / opt . cpp <nl> void optimize ( IRUnit & unit , IRBuilder & irBuilder , TransKind kind ) { <nl> dce ( " reoptimize " ) ; <nl> } <nl> <nl> - if ( false & & / / TODO ( # 5664026 ) <nl> - kind ! = TransKind : : Profile & & RuntimeOption : : EvalHHIRMemoryOpts ) { <nl> + if ( kind ! = TransKind : : Profile & & RuntimeOption : : EvalHHIRMemoryOpts ) { <nl> doPass ( optimizeLoads ) ; <nl> dce ( " loadelim " ) ; <nl> } <nl>
|
Fix load - elim behavior with type reflows
|
facebook/hhvm
|
81b15c3446a282450c145695f3bf55d8e6853232
|
2014-12-10T03:00:28Z
|
mmm a / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js <nl> <nl> - function JSONAdapter ( a , b , c , d , e , f ) { " use strict " ; var g = this , h = { } , i = { } , j = new AbstractAdapter ( b , c , this , d ) ; h . range = e / 2 , h . start = e / 4 , h . getStart = function ( ) { return this . start + Math . random ( ) * this . range } , i . range = f / 2 , i . start = f / 4 , i . getStart = function ( ) { return this . start + Math . random ( ) * this . range } , g . loadNode = function ( a , b ) { g . loadNodeFromTreeById ( a , b ) } , g . loadInitialNode = function ( b , c ) { var d = a + b + " . json " ; j . cleanUp ( ) , d3 . json ( d , function ( a , d ) { void 0 ! = = a & & null ! = = a & & console . log ( a ) ; var e = j . insertInitialNode ( d ) ; g . requestCentralityChildren ( b , function ( a ) { e . _centrality = a } ) , _ . each ( d . children , function ( a ) { var b = j . insertNode ( a ) , c = { _from : e . _id , _to : b . _id , _id : e . _id + " - " + b . _id } ; j . insertEdge ( c ) , g . requestCentralityChildren ( b . _id , function ( a ) { b . _centrality = a } ) , delete b . _data . children } ) , delete e . _data . children , c & & c ( e ) } ) } , g . loadNodeFromTreeById = function ( b , c ) { var d = a + b + " . json " ; d3 . json ( d , function ( a , d ) { void 0 ! = = a & & null ! = = a & & console . log ( a ) ; var e = j . insertNode ( d ) ; g . requestCentralityChildren ( b , function ( a ) { e . _centrality = a } ) , _ . each ( d . children , function ( a ) { var b = j . insertNode ( a ) , c = { _from : e . _id , _to : b . _id , _id : e . _id + " - " + b . _id } ; j . insertEdge ( c ) , g . requestCentralityChildren ( b . _id , function ( a ) { e . _centrality = a } ) , delete b . _data . children } ) , delete e . _data . children , c & & c ( e ) } ) } , g . requestCentralityChildren = function ( b , c ) { var d = a + b + " . json " ; d3 . json ( d , function ( a , b ) { void 0 ! = = a & & null ! = = a & & console . log ( a ) , void 0 ! = = c & & c ( void 0 ! = = b . children ? b . children . length : 0 ) } ) } , g . loadNodeFromTreeByAttributeValue = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . loadInitialNodeByAttributeValue = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . createEdge = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . deleteEdge = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . patchEdge = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . createNode = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . deleteNode = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . patchNode = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . setNodeLimit = function ( a , b ) { } , g . setChildLimit = function ( a ) { } , g . expandCommunity = function ( a , b ) { } , g . setWidth = function ( ) { } , g . explore = j . explore } function AbstractAdapter ( a , b , c , d , e ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " An inheriting class has to be given . " ; if ( void 0 = = = d ) throw " A reference to the graph viewer has to be given . " ; e = e | | { } ; var f , g , h , i , j , k = this , l = ! 1 , m = { } , n = { } , o = { } , p = { } , q = 0 , r = { } , s = { } , t = function ( a ) { void 0 ! = = a . prioList & & g . changePrioList ( a . prioList | | [ ] ) } , u = function ( a ) { m . range = a / 2 , m . start = a / 4 , m . getStart = function ( ) { return this . start + Math . random ( ) * this . range } } , v = function ( a ) { n . range = a / 2 , n . start = a / 4 , n . getStart = function ( ) { return this . start + Math . random ( ) * this . range } } , w = function ( b ) { var c = p [ b ] | | b , d = $ . grep ( a , function ( a ) { return a . _id = = = c } ) ; if ( 0 = = = d . length ) return ! 1 ; if ( 1 = = = d . length ) return d [ 0 ] ; throw " Too many nodes with the same ID , should never happen " } , x = function ( a ) { var c = $ . grep ( b , function ( b ) { return b . _id = = = a } ) ; if ( 0 = = = c . length ) return ! 1 ; if ( 1 = = = c . length ) return c [ 0 ] ; throw " Too many edges with the same ID , should never happen " } , y = function ( b , c , d ) { var e = { _data : b , _id : b . _id } , f = w ( e . _id ) ; return f ? f : ( e . x = c | | m . getStart ( ) , e . y = d | | n . getStart ( ) , e . weight = 1 , a . push ( e ) , e . _outboundCounter = 0 , e . _inboundCounter = 0 , e ) } , z = function ( a ) { var b = y ( a ) ; return b . x = 2 * m . start , b . y = 2 * n . start , b . fixed = ! 0 , b } , A = function ( ) { a . length = 0 , b . length = 0 , p = { } , o = { } , d . cleanUp ( ) } , B = function ( a ) { var c , d , e , f = ! 0 , g = { _data : a , _id : a . _id } , i = x ( g . _id ) ; if ( i ) return i ; if ( c = w ( a . _from ) , d = w ( a . _to ) , ! c ) throw " Unable to insert Edge , source node not existing " + a . _from ; if ( ! d ) throw " Unable to insert Edge , target node not existing " + a . _to ; return g . source = c , g . source . _isCommunity ? ( e = o [ g . source . _id ] , g . source = e . getNode ( a . _from ) , g . source . _outboundCounter + + , e . insertOutboundEdge ( g ) , f = ! 1 ) : c . _outboundCounter + + , g . target = d , g . target . _isCommunity ? ( e = o [ g . target . _id ] , g . target = e . getNode ( a . _to ) , g . target . _inboundCounter + + , e . insertInboundEdge ( g ) , f = ! 1 ) : d . _inboundCounter + + , b . push ( g ) , f & & h . call ( " insertEdge " , c . _id , d . _id ) , g } , C = function ( b ) { var c ; for ( c = 0 ; c < a . length ; c + + ) if ( a [ c ] = = = b ) return void a . splice ( c , 1 ) } , D = function ( a , c ) { var d = b [ a ] , e = d . source . _id , f = d . target . _id ; b . splice ( a , 1 ) , c | | h . call ( " deleteEdge " , e , f ) } , E = function ( a , c ) { var d ; for ( d = 0 ; d < b . length ; d + + ) if ( b [ d ] = = = a ) return void D ( d , c ) } , F = function ( a ) { var c ; for ( c = 0 ; c < b . length ; c + + ) b [ c ] . source = = = a ? ( a . _outboundCounter - - , b [ c ] . target . _inboundCounter - - , D ( c ) , c - - ) : b [ c ] . target = = = a & & ( a . _inboundCounter - - , b [ c ] . source . _outboundCounter - - , D ( c ) , c - - ) } , G = function ( a , c ) { var d , e , f , g , i ; for ( d = 0 ; d < b . length ; d + + ) for ( f = b [ d ] . source , g = b [ d ] . target , e = 0 ; e < a . length ; e + + ) i = ! 1 , f = = = a [ e ] & & ( i = c . insertOutboundEdge ( b [ d ] ) , g . _isCommunity | | h . call ( " deleteEdge " , f . _id , g . _id ) , f = b [ d ] . source ) , g = = = a [ e ] & & ( i = c . insertInboundEdge ( b [ d ] ) , f . _isCommunity | | h . call ( " deleteEdge " , f . _id , g . _id ) , g = b [ d ] . target ) , i & & ( b . splice ( d , 1 ) , d - - ) } , H = function ( a ) { if ( a . _outboundCounter > 0 ) { var c , d = [ ] ; for ( c = 0 ; c < b . length ; c + + ) if ( b [ c ] . source = = = a ) { if ( d . push ( b [ c ] ) , a . _outboundCounter - - , D ( c , b [ c ] . target . _isCommunity ) , 0 = = = a . _outboundCounter ) break ; c - - } return d } } , I = function ( b , c ) { if ( b & & 0 ! = = b . length ) { var d = _ . map ( b , function ( a ) { return w ( a ) } ) , e = new CommunityNode ( k , d ) , f = e . _id ; c & & ( e . _reason = c ) , o [ f ] = e , G ( d , e ) , _ . each ( d , function ( a ) { p [ a . _id ] = f , C ( a ) } ) , a . push ( e ) , l = ! 1 } } , J = function ( a ) { var b = a . data ; if ( b . error ) return console . log ( b . cmd ) , void console . log ( b . error ) ; switch ( b . cmd ) { case " debug " : break ; case " getCommunity " : I ( b . result ) } } , K = function ( a ) { l | | ( l = ! 0 , a ? h . call ( " getCommunity " , f , a . _id ) : h . call ( " getCommunity " , f ) ) } , L = function ( b ) { var c , d = a . length , e = - ( 1 / 0 ) ; _ . each ( o , function ( a ) { a . _expanded = = = ! 0 & & ( e < a . _size & & a ! = = b & & ( c = a , e = a . _size ) , d + = a . _size ) } ) , d > f & & ( c ? c . collapse ( ) : K ( b ) ) } , M = function ( c ) { var d = c . getDissolveInfo ( ) , e = d . nodes , g = d . edges . both , i = d . edges . inbound , j = d . edges . outbound ; C ( c ) , f < a . length + e . length & & K ( ) , _ . each ( e , function ( b ) { delete p [ b . _id ] , a . push ( b ) } ) , _ . each ( i , function ( a ) { a . target = a . _target , delete a . _target , a . source . _isCommunity | | h . call ( " insertEdge " , a . source . _id , a . target . _id ) } ) , _ . each ( j , function ( a ) { a . source = a . _source , delete a . _source , a . target . _isCommunity | | h . call ( " insertEdge " , a . source . _id , a . target . _id ) } ) , _ . each ( g , function ( a ) { a . source = a . _source , delete a . _source , a . target = a . _target , delete a . _target , b . push ( a ) , h . call ( " insertEdge " , a . source . _id , a . target . _id ) } ) , delete o [ c . _id ] } , N = function ( a ) { a . expand ( ) , L ( a ) } , O = function ( a ) { if ( _ . size ( a ) > i ) { var b = g . bucketNodes ( _ . values ( a ) , i ) ; _ . each ( b , function ( a ) { if ( a . nodes . length > 1 ) { var b = _ . map ( a . nodes , function ( a ) { return a . _id } ) ; I ( b , a . reason ) } } ) } } , P = function ( a , b ) { f = a , L ( ) , void 0 ! = = b & & b ( ) } , Q = function ( a ) { i = a } , R = function ( a , b ) { a . _expanded = ! 1 ; var c = b . removeOutboundEdgesFromNode ( a ) ; _ . each ( c , function ( a ) { j ( a ) , E ( a , ! 0 ) } ) } , S = function ( a ) { a . _expanded = ! 1 , p [ a . _id ] & & o [ p [ a . _id ] ] . collapseNode ( a ) ; var b = H ( a ) , c = [ ] ; _ . each ( b , function ( b ) { 0 = = = q ? ( r = b , s = a , c . push ( b ) ) : void 0 ! = = a & & ( a . _id = = = r . target . _id ? b . target . _id = = = s . _id & & c . push ( r ) : c . push ( b ) , r = b , s = a ) , q + + } ) , _ . each ( c , j ) , q = 0 } , T = function ( a ) { var b = a . getDissolveInfo ( ) ; C ( a ) , _ . each ( b . nodes , function ( a ) { delete p [ a . _id ] } ) , _ . each ( b . edges . outbound , function ( a ) { j ( a ) , E ( a , ! 0 ) } ) , delete o [ a . _id ] } , U = function ( a , b ) { a . _isCommunity ? k . expandCommunity ( a , b ) : ( a . _expanded = ! 0 , c . loadNode ( a . _id , b ) ) } , V = function ( a , b ) { a . _expanded ? S ( a ) : U ( a , b ) } ; j = function ( a ) { var b , c = a . target ; return c . _isCommunity ? ( b = a . _target , c . removeInboundEdge ( a ) , b . _inboundCounter - - , 0 = = = b . _inboundCounter & & ( R ( b , c ) , c . removeNode ( b ) , delete p [ b . _id ] ) , void ( 0 = = = c . _inboundCounter & & T ( c ) ) ) : ( c . _inboundCounter - - , void ( 0 = = = c . _inboundCounter & & ( S ( c ) , C ( c ) ) ) ) } , i = Number . POSITIVE_INFINITY , g = e . prioList ? new NodeReducer ( e . prioList ) : new NodeReducer , h = new WebWorkerWrapper ( ModularityJoiner , J ) , m . getStart = function ( ) { return 0 } , n . getStart = function ( ) { return 0 } , this . cleanUp = A , this . setWidth = u , this . setHeight = v , this . insertNode = y , this . insertInitialNode = z , this . insertEdge = B , this . removeNode = C , this . removeEdge = E , this . removeEdgesForNode = F , this . expandCommunity = N , this . setNodeLimit = P , this . setChildLimit = Q , this . checkSizeOfInserted = O , this . checkNodeLimit = L , this . explore = V , this . changeTo = t , this . getPrioList = g . getPrioList , this . dissolveCommunity = M } function ArangoAdapter ( a , b , c , d ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " A reference to the graph viewer has to be given . " ; if ( void 0 = = = d ) throw " A configuration with node - and edgeCollection has to be given . " ; if ( void 0 = = = d . graph ) { if ( void 0 = = = d . nodeCollection ) throw " The nodeCollection or a graphname has to be given . " ; if ( void 0 = = = d . edgeCollection ) throw " The edgeCollection or a graphname has to be given . " } var e , f , g , h , i , j = this , k = { } , l = { } , m = { } , n = function ( a ) { h = a } , o = function ( a ) { f = a , l . node = l . base + " document ? collection = " + f } , p = function ( a ) { g = a , l . edge = l . base + " edge ? collection = " + g } , q = function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : l . graph + " / " + a , contentType : " application / json " , success : function ( a ) { o ( a . graph . vertices ) , p ( a . graph . edges ) } } ) } , r = function ( a ) { console . log ( a . baseUrl ) ; var b = a . baseUrl | | " " ; void 0 ! = = a . width & & e . setWidth ( a . width ) , void 0 ! = = a . height & & e . setHeight ( a . height ) , i = void 0 ! = = a . undirected & & a . undirected = = = ! 0 ? " any " : " outbound " , l . base = b + " _api / " , l . cursor = l . base + " cursor " , l . graph = l . base + " graph " , l . collection = l . base + " collection / " , l . document = l . base + " document / " , l . any = l . base + " simple / any " , a . graph ? ( q ( a . graph ) , n ( a . graph ) ) : ( o ( a . nodeCollection ) , p ( a . edgeCollection ) , n ( void 0 ) ) } , s = function ( a , b , c ) { a ! = = m . getAllGraphs & & ( a ! = = m . connectedEdges & & ( b [ " @ nodes " ] = f , a ! = = m . childrenCentrality & & ( b . dir = i ) ) , b [ " @ edges " ] = g ) ; var d = { query : a , bindVars : b } ; $ . ajax ( { type : " POST " , url : l . cursor , data : JSON . stringify ( d ) , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( a ) { c ( a . result ) } , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw " Undefined ERROR " } } } ) } , t = function ( a , b ) { var c = [ ] , d = 0 , e = function ( d ) { c . push ( d . document | | { } ) , c . length = = = a & & b ( c ) } ; for ( d = 0 ; a > d ; d + + ) $ . ajax ( { cache : ! 1 , type : " PUT " , url : l . any , data : JSON . stringify ( { collection : f } ) , contentType : " application / json " , success : e } ) } , u = function ( b , c ) { if ( 0 = = = b . length ) return void ( c & & c ( { errorCode : 404 } ) ) ; b = b [ 0 ] ; var d = { } , f = e . insertNode ( b [ 0 ] . vertex ) , g = a . length ; _ . each ( b , function ( b ) { var c = e . insertNode ( b . vertex ) , f = b . path ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) , _ . each ( f . vertices , function ( b ) { var c = e . insertNode ( b ) ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) } ) , _ . each ( f . edges , function ( a ) { e . insertEdge ( a ) } ) } ) , delete d [ f . _id ] , e . checkSizeOfInserted ( d ) , e . checkNodeLimit ( f ) , c & & c ( f ) } , v = function ( a ) { return function ( b ) { return b & & b . errorCode ? void a ( b ) : void a ( e . insertInitialNode ( b ) ) } } , w = function ( a ) { s ( m . connectedEdges , { id : a } , function ( a ) { _ . each ( a , j . deleteEdge ) } ) } ; d . prioList & & ( k . prioList = d . prioList ) , e = new AbstractAdapter ( a , b , this , c , k ) , r ( d ) , m . getAllGraphs = " FOR g IN _graphs return g . _key " , m . randomDocuments = " FOR u IN @ @ nodes sort rand ( ) limit 10 return u " , m . nodeById = ' FOR n IN @ @ nodes FILTER n . _id = = @ id LET links = ( FOR l IN @ @ edges FILTER n . _id = = l . _from FOR t IN @ @ nodes FILTER t . _id = = l . _to RETURN t . _id ) RETURN MERGE ( n , { " children " : links } ) ' , m . traversalById = ' RETURN TRAVERSAL ( @ @ nodes , @ @ edges , @ id , @ dir , { strategy : " depthfirst " , maxDepth : 1 , paths : true } ) ' , m . traversalByAttribute = function ( a ) { return " FOR n IN @ @ nodes FILTER n . " + a + ' = = @ value RETURN TRAVERSAL ( @ @ nodes , @ @ edges , n . _id , @ dir , { strategy : " depthfirst " , maxDepth : 1 , paths : true } ) ' } , m . childrenCentrality = " FOR u IN @ @ nodes FILTER u . _id = = @ id LET g = ( FOR l in @ @ edges FILTER l . _from = = u . _id RETURN 1 ) RETURN length ( g ) " , m . connectedEdges = " FOR e IN @ @ edges FILTER e . _to = = @ id | | e . _from = = @ id RETURN e " , j . explore = e . explore , j . loadNode = function ( a , b ) { j . loadNodeFromTreeById ( a , b ) } , j . loadRandomNode = function ( a ) { var b = this ; t ( 1 , function ( c ) { var d = c [ 0 ] ; return d . _id ? void b . loadInitialNode ( d . _id , a ) : void 0 } ) } , j . loadInitialNode = function ( a , b ) { e . cleanUp ( ) , j . loadNode ( a , v ( b ) ) } , j . loadNodeFromTreeById = function ( a , b ) { s ( m . traversalById , { id : a } , function ( a ) { u ( a , b ) } ) } , j . loadNodeFromTreeByAttributeValue = function ( a , b , c ) { s ( m . traversalByAttribute ( a ) , { value : b } , function ( a ) { u ( a , c ) } ) } , j . loadInitialNodeByAttributeValue = function ( a , b , c ) { e . cleanUp ( ) , j . loadNodeFromTreeByAttributeValue ( a , b , v ( c ) ) } , j . requestCentralityChildren = function ( a , b ) { s ( m . childrenCentrality , { id : a } , function ( a ) { b ( a [ 0 ] ) } ) } , j . createEdge = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : l . edge + " & from = " + a . source . _id + " & to = " + a . target . _id , data : JSON . stringify ( { } ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { c . _from = a . source . _id , c . _to = a . target . _id , delete c . error ; var d = e . insertEdge ( c ) ; b ( d ) } , error : function ( a ) { throw a . statusText } } ) } , j . deleteEdge = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : l . document + a . _id , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( ) { e . removeEdge ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { throw a . statusText } } ) } , j . patchEdge = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : l . document + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( d ) { a . _data = $ . extend ( a . _data , b ) , c ( ) } , error : function ( a ) { throw a . statusText } } ) } , j . createNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : l . node , data : JSON . stringify ( a ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { c . error = = = ! 1 & & ( a . _key = c . _key , a . _id = c . _id , a . _rev = c . _rev , e . insertNode ( a ) , b ( a ) ) } , error : function ( a ) { throw a . statusText } } ) } , j . deleteNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : l . document + a . _id , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { e . removeEdgesForNode ( a ) , w ( a . _id ) , e . removeNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { throw a . statusText } } ) } , j . patchNode = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : l . document + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( d ) { a . _data = $ . extend ( a . _data , b ) , c ( a ) } , error : function ( a ) { throw a . statusText } } ) } , j . changeToCollections = function ( a , b , c ) { e . cleanUp ( ) , o ( a ) , p ( b ) , void 0 ! = = c & & ( i = c = = = ! 0 ? " any " : " outbound " ) , n ( void 0 ) } , j . changeToGraph = function ( a , b ) { e . cleanUp ( ) , q ( a ) , void 0 ! = = b & & ( i = b = = = ! 0 ? " any " : " outbound " ) , n ( a ) } , j . setNodeLimit = function ( a , b ) { e . setNodeLimit ( a , b ) } , j . setChildLimit = function ( a ) { e . setChildLimit ( a ) } , j . expandCommunity = function ( a , b ) { e . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } , j . getCollections = function ( a ) { a & & a . length > = 2 & & $ . ajax ( { cache : ! 1 , type : " GET " , url : l . collection , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( b ) { var c = b . collections , d = [ ] , e = [ ] ; _ . each ( c , function ( a ) { a . name . match ( / ^ _ / ) | | ( 3 = = = a . type ? e . push ( a . name ) : 2 = = = a . type & & d . push ( a . name ) ) } ) , a ( d , e ) } , error : function ( a ) { throw a . statusText } } ) } , j . getGraphs = function ( a ) { a & & a . length > = 1 & & s ( m . getAllGraphs , { } , a ) } , j . getAttributeExamples = function ( a ) { a & & a . length > = 1 & & t ( 10 , function ( b ) { var c = _ . sortBy ( _ . uniq ( _ . flatten ( _ . map ( b , function ( a ) { return _ . keys ( a ) } ) ) ) , function ( a ) { return a . toLowerCase ( ) } ) ; a ( c ) } ) } , j . getNodeCollection = function ( ) { return f } , j . getEdgeCollection = function ( ) { return g } , j . getDirection = function ( ) { return i } , j . getGraphName = function ( ) { return h } , j . setWidth = e . setWidth , j . changeTo = e . changeTo , j . getPrioList = e . getPrioList } function ColourMapper ( ) { " use strict " ; var a , b = { } , c = { } , d = [ ] , e = this , f = 0 ; d . push ( { back : " # C8E6C9 " , front : " black " } ) , d . push ( { back : " # 8aa249 " , front : " white " } ) , d . push ( { back : " # 8BC34A " , front : " black " } ) , d . push ( { back : " # 388E3C " , front : " white " } ) , d . push ( { back : " # 4CAF50 " , front : " white " } ) , d . push ( { back : " # 212121 " , front : " white " } ) , d . push ( { back : " # 727272 " , front : " white " } ) , d . push ( { back : " # B6B6B6 " , front : " black " } ) , d . push ( { back : " # e5f0a3 " , front : " black " } ) , d . push ( { back : " # 6c4313 " , front : " white " } ) , d . push ( { back : " # 9d8564 " , front : " white " } ) , this . getColour = function ( g ) { return void 0 = = = b [ g ] & & ( b [ g ] = d [ f ] , void 0 = = = c [ d [ f ] . back ] & & ( c [ d [ f ] . back ] = { front : d [ f ] . front , list : [ ] } ) , c [ d [ f ] . back ] . list . push ( g ) , f + + , f = = = d . length & & ( f = 0 ) ) , void 0 ! = = a & & a ( e . getList ( ) ) , b [ g ] . back } , this . getCommunityColour = function ( ) { return " # 333333 " } , this . getForegroundColour = function ( g ) { return void 0 = = = b [ g ] & & ( b [ g ] = d [ f ] , void 0 = = = c [ d [ f ] . back ] & & ( c [ d [ f ] . back ] = { front : d [ f ] . front , list : [ ] } ) , c [ d [ f ] . back ] . list . push ( g ) , f + + , f = = = d . length & & ( f = 0 ) ) , void 0 ! = = a & & a ( e . getList ( ) ) , b [ g ] . front } , this . getForegroundCommunityColour = function ( ) { return " white " } , this . reset = function ( ) { b = { } , c = { } , f = 0 , void 0 ! = = a & & a ( e . getList ( ) ) } , this . getList = function ( ) { return c } , this . setChangeListener = function ( b ) { a = b } , this . reset ( ) } function CommunityNode ( a , b ) { " use strict " ; if ( _ . isUndefined ( a ) | | ! _ . isFunction ( a . dissolveCommunity ) | | ! _ . isFunction ( a . checkNodeLimit ) ) throw " A parent element has to be given . " ; b = b | | [ ] ; var c , d , e , f , g , h = this , i = { } , j = [ ] , k = [ ] , l = { } , m = { } , n = { } , o = { } , p = function ( a ) { return h . _expanded ? 2 * a * Math . sqrt ( j . length ) : a } , q = function ( a ) { return h . _expanded ? 4 * a * Math . sqrt ( j . length ) : a } , r = function ( a ) { var b = h . position , c = a . x * b . z + b . x , d = a . y * b . z + b . y , e = a . z * b . z ; return { x : c , y : d , z : e } } , s = function ( a ) { return h . _expanded ? r ( a . _source . position ) : h . position } , t = function ( a ) { return h . _expanded ? r ( a . _target . position ) : h . position } , u = function ( ) { var a = document . getElementById ( h . _id ) . getBBox ( ) ; c . attr ( " transform " , " translate ( " + ( a . x - 5 ) + " , " + ( a . y - 25 ) + " ) " ) , d . attr ( " width " , a . width + 10 ) . attr ( " height " , a . height + 30 ) , e . attr ( " width " , a . width + 10 ) } , v = function ( ) { if ( ! f ) { var a = new DomObserverFactory ; f = a . createObserver ( function ( a ) { _ . any ( a , function ( a ) { return " transform " = = = a . attributeName } ) & & ( u ( ) , f . disconnect ( ) ) } ) } return f } , w = function ( ) { g . stop ( ) , j . length = 0 , _ . each ( i , function ( a ) { j . push ( a ) } ) , g . start ( ) } , x = function ( ) { g . stop ( ) , k . length = 0 , _ . each ( l , function ( a ) { k . push ( a ) } ) , g . start ( ) } , y = function ( a ) { var b = [ ] ; return _ . each ( a , function ( a ) { b . push ( a ) } ) , b } , z = function ( a ) { return ! ! i [ a ] } , A = function ( ) { return j } , B = function ( a ) { return i [ a ] } , C = function ( a ) { i [ a . _id ] = a , w ( ) , h . _size + + } , D = function ( a ) { _ . each ( a , function ( a ) { i [ a . _id ] = a , h . _size + + } ) , w ( ) } , E = function ( a ) { var b = a . _id | | a ; delete i [ b ] , w ( ) , h . _size - - } , F = function ( a ) { var b ; return _ . has ( a , " _id " ) ? b = a . _id : ( b = a , a = l [ b ] | | m [ b ] ) , a . target = a . _target , delete a . _target , l [ b ] ? ( delete l [ b ] , h . _outboundCounter + + , n [ b ] = a , void x ( ) ) : ( delete m [ b ] , void h . _inboundCounter - - ) } , G = function ( a ) { var b ; return _ . has ( a , " _id " ) ? b = a . _id : ( b = a , a = l [ b ] | | n [ b ] ) , a . source = a . _source , delete a . _source , delete o [ a . source . _id ] [ b ] , l [ b ] ? ( delete l [ b ] , h . _inboundCounter + + , m [ b ] = a , void x ( ) ) : ( delete n [ b ] , void h . _outboundCounter - - ) } , H = function ( a ) { var b = a . _id | | a , c = [ ] ; return _ . each ( o [ b ] , function ( a ) { G ( a ) , c . push ( a ) } ) , delete o [ b ] , c } , I = function ( a ) { return a . _target = a . target , a . target = h , n [ a . _id ] ? ( delete n [ a . _id ] , h . _outboundCounter - - , l [ a . _id ] = a , x ( ) , ! 0 ) : ( m [ a . _id ] = a , h . _inboundCounter + + , ! 1 ) } , J = function ( a ) { var b = a . source . _id ; return a . _source = a . source , a . source = h , o [ b ] = o [ b ] | | { } , o [ b ] [ a . _id ] = a , m [ a . _id ] ? ( delete m [ a . _id ] , h . _inboundCounter - - , l [ a . _id ] = a , x ( ) , ! 0 ) : ( h . _outboundCounter + + , n [ a . _id ] = a , ! 1 ) } , K = function ( ) { return { nodes : j , edges : { both : k , inbound : y ( m ) , outbound : y ( n ) } } } , L = function ( ) { this . _expanded = ! 0 } , M = function ( ) { a . dissolveCommunity ( h ) } , N = function ( ) { this . _expanded = ! 1 } , O = function ( a , b ) { var c = a . select ( " rect " ) . attr ( " width " ) , d = a . append ( " text " ) . attr ( " text - anchor " , " middle " ) . attr ( " fill " , b . getForegroundCommunityColour ( ) ) . attr ( " stroke " , " none " ) ; c * = 2 , c / = 3 , h . _reason & & h . _reason . key & & ( d . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " - 4 " ) . text ( h . _reason . key + " : " ) , d . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " 16 " ) . text ( h . _reason . value ) ) , d . append ( " tspan " ) . attr ( " x " , c ) . attr ( " y " , " 0 " ) . attr ( " fill " , b . getCommunityColour ( ) ) . text ( h . _size ) } , P = function ( b , c , d , e ) { var f = b . append ( " g " ) . attr ( " stroke " , e . getForegroundCommunityColour ( ) ) . attr ( " fill " , e . getCommunityColour ( ) ) ; c ( f , 9 ) , c ( f , 6 ) , c ( f , 3 ) , c ( f ) , f . on ( " click " , function ( ) { h . expand ( ) , a . checkNodeLimit ( h ) , d ( ) } ) , O ( f , e ) } , Q = function ( a , b ) { var c = a . selectAll ( " . node " ) . data ( j , function ( a ) { return a . _id } ) ; c . enter ( ) . append ( " g " ) . attr ( " class " , " node " ) . attr ( " id " , function ( a ) { return a . _id } ) , c . exit ( ) . remove ( ) , c . selectAll ( " * > * " ) . remove ( ) , b ( c ) } , R = function ( a , b ) { c = a . append ( " g " ) , d = c . append ( " rect " ) . attr ( " rx " , " 8 " ) . attr ( " ry " , " 8 " ) . attr ( " fill " , " none " ) . attr ( " stroke " , " black " ) , e = c . append ( " rect " ) . attr ( " rx " , " 8 " ) . attr ( " ry " , " 8 " ) . attr ( " height " , " 20 " ) . attr ( " fill " , " # 686766 " ) . attr ( " stroke " , " none " ) , c . append ( " image " ) . attr ( " id " , h . _id + " _dissolve " ) . attr ( " xlink : href " , " img / icon_delete . png " ) . attr ( " width " , " 16 " ) . attr ( " height " , " 16 " ) . attr ( " x " , " 5 " ) . attr ( " y " , " 2 " ) . attr ( " style " , " cursor : pointer " ) . on ( " click " , function ( ) { h . dissolve ( ) , b ( ) } ) , c . append ( " image " ) . attr ( " id " , h . _id + " _collapse " ) . attr ( " xlink : href " , " img / gv_collapse . png " ) . attr ( " width " , " 16 " ) . attr ( " height " , " 16 " ) . attr ( " x " , " 25 " ) . attr ( " y " , " 2 " ) . attr ( " style " , " cursor : pointer " ) . on ( " click " , function ( ) { h . collapse ( ) , b ( ) } ) ; var f = c . append ( " text " ) . attr ( " x " , " 45 " ) . attr ( " y " , " 15 " ) . attr ( " fill " , " white " ) . attr ( " stroke " , " none " ) . attr ( " text - anchor " , " left " ) ; h . _reason & & f . text ( h . _reason . text ) , v ( ) . observe ( document . getElementById ( h . _id ) , { subtree : ! 0 , attributes : ! 0 } ) } , S = function ( a ) { if ( h . _expanded ) { var b = a . focus ( ) , c = [ b [ 0 ] - h . position . x , b [ 1 ] - h . position . y ] ; a . focus ( c ) , _ . each ( j , function ( b ) { b . position = a ( b ) , b . position . x / = h . position . z , b . position . y / = h . position . z , b . position . z / = h . position . z } ) , a . focus ( b ) } } , T = function ( a , b , c , d , e ) { return a . on ( " click " , null ) , h . _expanded ? ( R ( a , d ) , void Q ( a , c , d , e ) ) : void P ( a , b , d , e ) } , U = function ( a , b , c ) { if ( h . _expanded ) { var d = a . selectAll ( " . link " ) , e = d . select ( " line " ) ; b ( e , d ) , c ( d ) } } , V = function ( a , b ) { var c , d , e = function ( a ) { return a . _id } ; h . _expanded & & ( d = a . selectAll ( " . link " ) . data ( k , e ) , d . enter ( ) . append ( " g " ) . attr ( " class " , " link " ) . attr ( " id " , e ) , d . exit ( ) . remove ( ) , d . selectAll ( " * > * " ) . remove ( ) , c = d . append ( " line " ) , b ( c , d ) ) } , W = function ( a ) { H ( a ) } ; g = new ForceLayouter ( { distance : 100 , gravity : . 1 , charge : - 500 , width : 1 , height : 1 , nodes : j , links : k } ) , this . _id = " * community_ " + Math . floor ( 1e6 * Math . random ( ) ) , b . length > 0 ? ( this . x = b [ 0 ] . x , this . y = b [ 0 ] . y ) : ( this . x = 0 , this . y = 0 ) , this . _size = 0 , this . _inboundCounter = 0 , this . _outboundCounter = 0 , this . _expanded = ! 1 , this . _isCommunity = ! 0 , D ( b ) , this . hasNode = z , this . getNodes = A , this . getNode = B , this . getDistance = p , this . getCharge = q , this . insertNode = C , this . insertInboundEdge = I , this . insertOutboundEdge = J , this . removeNode = E , this . removeInboundEdge = F , this . removeOutboundEdge = G , this . removeOutboundEdgesFromNode = H , this . collapseNode = W , this . dissolve = M , this . getDissolveInfo = K , this . collapse = N , this . expand = L , this . shapeNodes = T , this . shapeInnerEdges = V , this . updateInnerEdges = U , this . addDistortion = S , this . getSourcePosition = s , this . getTargetPosition = t } function DomObserverFactory ( ) { " use strict " ; var a = window . WebKitMutationObserver | | window . MutationObserver ; this . createObserver = function ( b ) { if ( ! a ) throw " Observer not supported " ; return new a ( b ) } } function EdgeShaper ( a , b , c ) { " use strict " ; var d , e , f , g = this , h = [ ] , i = { } , j = new ContextMenu ( " gv_edge_cm " ) , k = function ( a , b ) { return _ . isArray ( a ) ? b [ _ . find ( a , function ( a ) { return b [ a ] } ) ] : b [ a ] } , l = function ( a ) { if ( void 0 = = = a ) return [ " " ] ; " string " ! = typeof a & & ( a = String ( a ) ) ; var b = a . match ( / [ \ w \ W ] { 1 , 10 } ( \ s | $ ) | \ S + ? ( \ s | $ ) / g ) ; return b [ 0 ] = $ . trim ( b [ 0 ] ) , b [ 1 ] = $ . trim ( b [ 1 ] ) , b [ 0 ] . length > 12 & & ( b [ 0 ] = $ . trim ( a . substring ( 0 , 10 ) ) + " - " , b [ 1 ] = $ . trim ( a . substring ( 10 ) ) , b [ 1 ] . length > 12 & & ( b [ 1 ] = b [ 1 ] . split ( / \ W / ) [ 0 ] , b [ 1 ] . length > 12 & & ( b [ 1 ] = b [ 1 ] . substring ( 0 , 10 ) + " . . . " ) ) , b . length = 2 ) , b . length > 2 & & ( b . length = 2 , b [ 1 ] + = " . . . " ) , b } , m = ! 0 , n = { } , o = function ( a ) { return a . _id } , p = function ( a , b ) { } , q = new ColourMapper , r = function ( ) { q . reset ( ) } , s = p , t = p , u = p , v = p , w = function ( ) { f = { click : p , dblclick : p , mousedown : p , mouseup : p , mousemove : p , mouseout : p , mouseover : p } } , x = function ( a , b ) { return 180 * Math . atan2 ( b . y - a . y , b . x - a . x ) / Math . PI } , y = function ( a , b ) { var c , d = Math . sqrt ( ( b . y - a . y ) * ( b . y - a . y ) + ( b . x - a . x ) * ( b . x - a . x ) ) ; return a . x = = = b . x ? d - = 18 * b . z : ( c = Math . abs ( ( b . y - a . y ) / ( b . x - a . x ) ) , d - = . 4 > c ? Math . abs ( d * b . z * 45 / ( b . x - a . x ) ) : Math . abs ( d * b . z * 18 / ( b . y - a . y ) ) ) , d } , z = function ( a , b ) { _ . each ( f , function ( a , c ) { b . on ( c , a ) } ) } , A = function ( a , b ) { if ( " update " = = = a ) s = b ; else { if ( void 0 = = = f [ a ] ) throw " Sorry Unknown Event " + a + " cannot be bound . " ; f [ a ] = b } } , B = function ( a ) { var b , c , d , e ; return d = a . source , e = a . target , d . _isCommunity ? ( i [ d . _id ] = d , b = d . getSourcePosition ( a ) ) : b = d . position , e . _isCommunity ? ( i [ e . _id ] = e , c = e . getTargetPosition ( a ) ) : c = e . position , { s : b , t : c } } , C = function ( a , b ) { i = { } , b . attr ( " transform " , function ( a ) { var b = B ( a ) ; return " translate ( " + b . s . x + " , " + b . s . y + " ) rotate ( " + x ( b . s , b . t ) + " ) " } ) , a . attr ( " x2 " , function ( a ) { var b = B ( a ) ; return y ( b . s , b . t ) } ) } , D = function ( a , b ) { t ( a , b ) , m & & u ( a , b ) , v ( a , b ) , z ( a , b ) , C ( a , b ) } , E = function ( a ) { void 0 ! = = a & & ( h = a ) ; var b , c = g . parent . selectAll ( " . link " ) . data ( h , o ) ; c . enter ( ) . append ( " g " ) . attr ( " class " , " link " ) . attr ( " id " , o ) , c . exit ( ) . remove ( ) , c . selectAll ( " * > * " ) . remove ( ) , b = c . append ( " line " ) , D ( b , c ) , _ . each ( i , function ( a ) { a . shapeInnerEdges ( d3 . select ( this ) , D ) } ) , j . bindMenu ( $ ( " . link " ) ) } , F = function ( ) { var a = g . parent . selectAll ( " . link " ) , b = a . select ( " line " ) ; C ( b , a ) , s ( a ) , _ . each ( i , function ( a ) { a . updateInnerEdges ( d3 . select ( this ) , C , s ) } ) } , G = function ( a ) { switch ( $ ( " svg defs marker # arrow " ) . remove ( ) , a . type ) { case EdgeShaper . shapes . NONE : t = p ; break ; case EdgeShaper . shapes . ARROW : t = function ( a , b ) { a . attr ( " marker - end " , " url ( # arrow ) " ) } , 0 = = = d . selectAll ( " defs " ) [ 0 ] . length & & d . append ( " defs " ) , d . select ( " defs " ) . append ( " marker " ) . attr ( " id " , " arrow " ) . attr ( " refX " , " 10 " ) . attr ( " refY " , " 5 " ) . attr ( " markerUnits " , " strokeWidth " ) . attr ( " markerHeight " , " 10 " ) . attr ( " markerWidth " , " 10 " ) . attr ( " orient " , " auto " ) . append ( " path " ) . attr ( " d " , " M 0 0 L 10 5 L 0 10 z " ) ; break ; default : throw " Sorry given Shape not known ! " } } , H = function ( a ) { u = _ . isFunction ( a ) ? function ( b , c ) { c . append ( " text " ) . attr ( " text - anchor " , " middle " ) . text ( a ) } : function ( b , c ) { c . append ( " text " ) . attr ( " text - anchor " , " middle " ) . text ( function ( b ) { var c = l ( k ( a , b . _data ) ) ; return c [ 0 ] | | " " } ) } , s = function ( a ) { a . select ( " text " ) . attr ( " transform " , function ( a ) { var b = B ( a ) ; return " translate ( " + y ( b . s , b . t ) / 2 + " , - 3 ) " } ) } } , I = function ( a ) { void 0 ! = = a . reset & & a . reset & & w ( ) , _ . each ( a , function ( a , b ) { " reset " ! = = b & & A ( b , a ) } ) } , J = function ( a ) { switch ( $ ( " svg defs # gradientEdgeColor " ) . remove ( ) , r ( ) , a . type ) { case " single " : v = function ( b , c ) { b . attr ( " stroke " , a . stroke ) } ; break ; case " gradient " : 0 = = = d . selectAll ( " defs " ) [ 0 ] . length & & d . append ( " defs " ) ; var b = d . select ( " defs " ) . append ( " linearGradient " ) . attr ( " id " , " gradientEdgeColor " ) ; b . append ( " stop " ) . attr ( " offset " , " 0 " ) . attr ( " stop - color " , a . source ) , b . append ( " stop " ) . attr ( " offset " , " 0 . 4 " ) . attr ( " stop - color " , a . source ) , b . append ( " stop " ) . attr ( " offset " , " 0 . 6 " ) . attr ( " stop - color " , a . target ) , b . append ( " stop " ) . attr ( " offset " , " 1 " ) . attr ( " stop - color " , a . target ) , v = function ( a , b ) { a . attr ( " stroke " , " url ( # gradientEdgeColor ) " ) , a . attr ( " y2 " , " 0 . 0000000000000001 " ) } ; break ; case " attribute " : v = function ( b , c ) { c . attr ( " stroke " , function ( b ) { return q . getColour ( b . _data [ a . key ] ) } ) } ; break ; default : throw " Sorry given colour - scheme not known " } } , K = function ( a ) { void 0 ! = = a . shape & & G ( a . shape ) , void 0 ! = = a . label & & ( H ( a . label ) , g . label = a . label ) , void 0 ! = = a . actions & & I ( a . actions ) , void 0 ! = = a . color & & J ( a . color ) } ; for ( g . parent = a , w ( ) , d = a ; d [ 0 ] [ 0 ] & & d [ 0 ] [ 0 ] . ownerSVGElement ; ) d = d3 . select ( d [ 0 ] [ 0 ] . ownerSVGElement ) ; void 0 = = = b & & ( b = { color : { type : " single " , stroke : " # 686766 " } } ) , void 0 = = = b . color & & ( b . color = { type : " single " , stroke : " # 686766 " } ) , K ( b ) , _ . isFunction ( c ) & & ( o = c ) , e = d . append ( " g " ) , g . changeTo = function ( a ) { K ( a ) , E ( ) , F ( ) } , g . drawEdges = function ( a ) { E ( a ) , F ( ) } , g . updateEdges = function ( ) { F ( ) } , g . reshapeEdges = function ( ) { E ( ) } , g . activateLabel = function ( a ) { m = a ? ! 0 : ! 1 , E ( ) } , g . addAnEdgeFollowingTheCursor = function ( a , b ) { return n = e . append ( " line " ) , n . attr ( " stroke " , " black " ) . attr ( " id " , " connectionLine " ) . attr ( " x1 " , a ) . attr ( " y1 " , b ) . attr ( " x2 " , a ) . attr ( " y2 " , b ) , function ( a , b ) { n . attr ( " x2 " , a ) . attr ( " y2 " , b ) } } , g . removeCursorFollowingEdge = function ( ) { n . remove & & ( n . remove ( ) , n = { } ) } , g . addMenuEntry = function ( a , b ) { j . addEntry ( a , b ) } , g . getLabel = function ( ) { return g . label | | " " } , g . resetColourMap = r } function EventDispatcher ( a , b , c ) { " use strict " ; var d , e , f , g , h = this , i = function ( b ) { if ( void 0 = = = b . shaper & & ( b . shaper = a ) , d . checkNodeEditorConfig ( b ) ) { var c = new d . InsertNode ( b ) , e = new d . PatchNode ( b ) , f = new d . DeleteNode ( b ) ; h . events . CREATENODE = function ( a , b , d , e ) { var f ; return f = _ . isFunction ( a ) ? a ( ) : a , function ( ) { c ( f , b , d , e ) } } , h . events . PATCHNODE = function ( a , b , c ) { if ( ! _ . isFunction ( b ) ) throw " Please give a function to extract the new node data " ; return function ( ) { e ( a , b ( ) , c ) } } , h . events . DELETENODE = function ( a ) { return function ( b ) { f ( b , a ) } } } } , j = function ( a ) { if ( void 0 = = = a . shaper & & ( a . shaper = b ) , d . checkEdgeEditorConfig ( a ) ) { var c = new d . InsertEdge ( a ) , e = new d . PatchEdge ( a ) , f = new d . DeleteEdge ( a ) , g = null , i = ! 1 ; h . events . STARTCREATEEDGE = function ( a ) { return function ( b ) { var c = d3 . event | | window . event ; g = b , i = ! 1 , void 0 ! = = a & & a ( b , c ) , c . stopPropagation ( ) } } , h . events . CANCELCREATEEDGE = function ( a ) { return function ( ) { g = null , void 0 = = = a | | i | | a ( ) } } , h . events . FINISHCREATEEDGE = function ( a ) { return function ( b ) { null ! = = g & & b ! = = g & & ( c ( g , b , a ) , i = ! 0 ) } } , h . events . PATCHEDGE = function ( a , b , c ) { if ( ! _ . isFunction ( b ) ) throw " Please give a function to extract the new node data " ; return function ( ) { e ( a , b ( ) , c ) } } , h . events . DELETEEDGE = function ( a ) { return function ( b ) { f ( b , a ) } } } } , k = function ( ) { g = g | | $ ( " svg " ) , g . unbind ( ) , _ . each ( e , function ( a , b ) { g . bind ( b , function ( c ) { _ . each ( a , function ( a ) { a ( c ) } ) , f [ b ] & & f [ b ] ( c ) } ) } ) } ; if ( void 0 = = = a ) throw " NodeShaper has to be given . " ; if ( void 0 = = = b ) throw " EdgeShaper has to be given . " ; d = new EventLibrary , e = { click : [ ] , dblclick : [ ] , mousedown : [ ] , mouseup : [ ] , mousemove : [ ] , mouseout : [ ] , mouseover : [ ] } , f = { } , h . events = { } , void 0 ! = = c & & ( void 0 ! = = c . expand & & d . checkExpandConfig ( c . expand ) & & ( h . events . EXPAND = new d . Expand ( c . expand ) , a . setGVStartFunction ( function ( ) { c . expand . reshapeNodes ( ) , c . expand . startCallback ( ) } ) ) , void 0 ! = = c . drag & & d . checkDragConfig ( c . drag ) & & ( h . events . DRAG = d . Drag ( c . drag ) ) , void 0 ! = = c . nodeEditor & & i ( c . nodeEditor ) , void 0 ! = = c . edgeEditor & & j ( c . edgeEditor ) ) , Object . freeze ( h . events ) , h . bind = function ( c , d , e ) { if ( void 0 = = = e | | ! _ . isFunction ( e ) ) throw " You have to give a function that should be bound as a third argument " ; var g = { } ; switch ( c ) { case " nodes " : g [ d ] = e , a . changeTo ( { actions : g } ) ; break ; case " edges " : g [ d ] = e , b . changeTo ( { actions : g } ) ; break ; case " svg " : f [ d ] = e , k ( ) ; break ; default : if ( void 0 = = = c . bind ) throw ' Sorry cannot bind to object . Please give either " nodes " , " edges " or a jQuery - selected DOM - Element ' ; c . unbind ( d ) , c . bind ( d , e ) } } , h . rebind = function ( c , d ) { switch ( d = d | | { } , d . reset = ! 0 , c ) { case " nodes " : a . changeTo ( { actions : d } ) ; break ; case " edges " : b . changeTo ( { actions : d } ) ; break ; case " svg " : f = { } , _ . each ( d , function ( a , b ) { " reset " ! = = b & & ( f [ b ] = a ) } ) , k ( ) ; break ; default : throw ' Sorry cannot rebind to object . Please give either " nodes " , " edges " or " svg " ' } } , h . fixSVG = function ( a , b ) { if ( void 0 = = = e [ a ] ) throw " Sorry unkown event " ; e [ a ] . push ( b ) , k ( ) } , Object . freeze ( h . events ) } function EventLibrary ( ) { " use strict " ; var a = this ; this . checkExpandConfig = function ( a ) { if ( void 0 = = = a . startCallback ) throw " A callback to the Start - method has to be defined " ; if ( void 0 = = = a . adapter | | void 0 = = = a . adapter . explore ) throw " An adapter to load data has to be defined " ; if ( void 0 = = = a . reshapeNodes ) throw " A callback to reshape nodes has to be defined " ; return ! 0 } , this . Expand = function ( b ) { a . checkExpandConfig ( b ) ; var c = b . startCallback , d = b . adapter . explore , e = b . reshapeNodes ; return function ( a ) { d ( a , c ) , e ( ) , c ( ) } } , this . checkDragConfig = function ( a ) { if ( void 0 = = = a . layouter ) throw " A layouter has to be defined " ; if ( void 0 = = = a . layouter . drag | | ! _ . isFunction ( a . layouter . drag ) ) throw " The layouter has to offer a drag function " ; return ! 0 } , this . Drag = function ( b ) { return a . checkDragConfig ( b ) , b . layouter . drag } , this . checkNodeEditorConfig = function ( a ) { if ( void 0 = = = a . adapter ) throw " An adapter has to be defined " ; if ( void 0 = = = a . shaper ) throw " A node shaper has to be defined " ; return ! 0 } , this . checkEdgeEditorConfig = function ( a ) { if ( void 0 = = = a . adapter ) throw " An adapter has to be defined " ; if ( void 0 = = = a . shaper ) throw " An edge Shaper has to be defined " ; return ! 0 } , this . InsertNode = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e , f ) { var g , h ; _ . isFunction ( a ) & & ! b ? ( g = a , h = { } ) : ( g = b , h = a ) , c . createNode ( h , function ( a ) { d . reshapeNodes ( ) , g ( a ) } , e , f ) } } , this . PatchNode = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e ) { c . patchNode ( a , b , function ( a ) { d . reshapeNodes ( ) , e ( a ) } ) } } , this . DeleteNode = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b ) { c . deleteNode ( a , function ( ) { d . reshapeNodes ( ) , b ( ) } ) } } , this . SelectNodeCollection = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter ; if ( ! _ . isFunction ( c . useNodeCollection ) ) throw " The adapter has to support collection changes " ; return function ( a , b ) { c . useNodeCollection ( a ) , b ( ) } } , this . InsertEdge = function ( b ) { a . checkEdgeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e ) { c . createEdge ( { source : a , target : b } , function ( a ) { d . reshapeEdges ( ) , e ( a ) } ) } } , this . PatchEdge = function ( b ) { a . checkEdgeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e ) { c . patchEdge ( a , b , function ( a ) { d . reshapeEdges ( ) , e ( a ) } ) } } , this . DeleteEdge = function ( b ) { a . checkEdgeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b ) { c . deleteEdge ( a , function ( ) { d . reshapeEdges ( ) , b ( ) } ) } } } function ForceLayouter ( a ) { " use strict " ; var b = this , c = d3 . layout . force ( ) , d = a . charge | | - 600 , e = a . distance | | 80 , f = a . gravity | | . 01 , g = function ( a ) { <nl> - var b = 0 ; return b + = a . source . _isCommunity ? a . source . getDistance ( e ) : e , b + = a . target . _isCommunity ? a . target . getDistance ( e ) : e } , h = function ( a ) { return a . _isCommunity ? a . getCharge ( d ) : d } , i = a . onUpdate | | function ( ) { } , j = a . width | | 880 , k = a . height | | 680 , l = function ( a ) { a . distance & & ( e = a . distance ) , a . gravity & & c . gravity ( a . gravity ) , a . charge & & ( d = a . charge ) } ; if ( void 0 = = = a . nodes ) throw " No nodes defined " ; if ( void 0 = = = a . links ) throw " No links defined " ; c . nodes ( a . nodes ) , c . links ( a . links ) , c . size ( [ j , k ] ) , c . linkDistance ( g ) , c . gravity ( f ) , c . charge ( h ) , c . on ( " tick " , function ( ) { } ) , b . start = function ( ) { c . start ( ) } , b . stop = function ( ) { c . stop ( ) } , b . drag = c . drag , b . setCombinedUpdateFunction = function ( a , d , e ) { void 0 ! = = e ? ( i = function ( ) { c . alpha ( ) < . 1 & & ( a . updateNodes ( ) , d . updateEdges ( ) , e ( ) , c . alpha ( ) < . 05 & & b . stop ( ) ) } , c . on ( " tick " , i ) ) : ( i = function ( ) { c . alpha ( ) < . 1 & & ( a . updateNodes ( ) , d . updateEdges ( ) , c . alpha ( ) < . 05 & & b . stop ( ) ) } , c . on ( " tick " , i ) ) } , b . changeTo = function ( a ) { l ( a ) } , b . changeWidth = function ( a ) { j = a , c . size ( [ j , k ] ) } } function FoxxAdapter ( a , b , c , d , e ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " The route has to be given . " ; if ( void 0 = = = d ) throw " A reference to the graph viewer has to be given . " ; e = e | | { } ; var f , g = this , h = { } , i = { } , j = c , k = { cache : ! 1 , contentType : " application / json " , dataType : " json " , processData : ! 1 , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw console . log ( b ) , " Undefined ERROR " } } } , l = function ( ) { i . query = { get : function ( a , b ) { var c = $ . extend ( k , { type : " GET " , url : j + " / query / " + a , success : b } ) ; $ . ajax ( c ) } } , i . nodes = { post : function ( a , b ) { var c = $ . extend ( k , { type : " POST " , url : j + " / nodes " , data : JSON . stringify ( a ) , success : b } ) ; $ . ajax ( c ) } , put : function ( a , b , c ) { var d = $ . extend ( k , { type : " PUT " , url : j + " / nodes / " + a , data : JSON . stringify ( b ) , success : c } ) ; $ . ajax ( d ) } , del : function ( a , b ) { var c = $ . extend ( k , { type : " DELETE " , url : j + " / nodes / " + a , success : b } ) ; $ . ajax ( c ) } } , i . edges = { post : function ( a , b ) { var c = $ . extend ( k , { type : " POST " , url : j + " / edges " , data : JSON . stringify ( a ) , success : b } ) ; $ . ajax ( c ) } , put : function ( a , b , c ) { var d = $ . extend ( k , { type : " PUT " , url : j + " / edges / " + a , data : JSON . stringify ( b ) , success : c } ) ; $ . ajax ( d ) } , del : function ( a , b ) { var c = $ . extend ( k , { type : " DELETE " , url : j + " / edges / " + a , success : b } ) ; $ . ajax ( c ) } } , i . forNode = { del : function ( a , b ) { var c = $ . extend ( k , { type : " DELETE " , url : j + " / edges / forNode / " + a , success : b } ) ; $ . ajax ( c ) } } } , m = function ( a , b , c ) { i [ a ] . get ( b , c ) } , n = function ( a , b , c ) { i [ a ] . post ( b , c ) } , o = function ( a , b , c ) { i [ a ] . del ( b , c ) } , p = function ( a , b , c , d ) { i [ a ] . put ( b , c , d ) } , q = function ( a ) { void 0 ! = = a . width & & f . setWidth ( a . width ) , void 0 ! = = a . height & & f . setHeight ( a . height ) } , r = function ( b , c ) { var d = { } , e = b . first , g = a . length ; e = f . insertNode ( e ) , _ . each ( b . nodes , function ( b ) { b = f . insertNode ( b ) , g < a . length & & ( d [ b . _id ] = b , g = a . length ) } ) , _ . each ( b . edges , function ( a ) { f . insertEdge ( a ) } ) , delete d [ e . _id ] , f . checkSizeOfInserted ( d ) , f . checkNodeLimit ( e ) , void 0 ! = = c & & _ . isFunction ( c ) & & c ( e ) } ; e . prioList & & ( h . prioList = e . prioList ) , f = new AbstractAdapter ( a , b , this , d , h ) , q ( e ) , l ( ) , g . explore = f . explore , g . loadNode = function ( a , b ) { m ( " query " , a , function ( a ) { r ( a , b ) } ) } , g . loadInitialNode = function ( a , b ) { f . cleanUp ( ) ; var c = function ( a ) { b ( f . insertInitialNode ( a ) ) } ; g . loadNode ( a , c ) } , g . requestCentralityChildren = function ( a , b ) { } , g . createEdge = function ( a , b ) { var c = _ . clone ( a ) ; c . _from = a . source . _id , c . _to = a . target . _id , delete c . source , delete c . target , n ( " edges " , c , function ( c ) { c . _from = a . source . _id , c . _to = a . target . _id , delete c . error ; var d = f . insertEdge ( c ) ; void 0 ! = = b & & _ . isFunction ( b ) & & b ( d ) } ) } , g . deleteEdge = function ( a , b ) { o ( " edges " , a . _id , function ( ) { f . removeEdge ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } ) } , g . patchEdge = function ( a , b , c ) { p ( " edges " , a . _id , b , function ( d ) { a . _data = $ . extend ( a . _data , b ) , void 0 ! = = c & & _ . isFunction ( c ) & & c ( ) } ) } , g . createNode = function ( a , b ) { n ( " nodes " , a , function ( a ) { f . insertNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( a ) } ) } , g . deleteNode = function ( a , b ) { o ( " nodes " , a . _id , function ( ) { f . removeEdgesForNode ( a ) , o ( " forNode " , a . _id , function ( ) { } ) , f . removeNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } ) } , g . patchNode = function ( a , b , c ) { p ( " nodes " , a . _id , b , function ( d ) { a . _data = $ . extend ( a . _data , b ) , void 0 ! = = c & & _ . isFunction ( c ) & & c ( a ) } ) } , g . setNodeLimit = function ( a , b ) { f . setNodeLimit ( a , b ) } , g . setChildLimit = function ( a ) { f . setChildLimit ( a ) } , g . expandCommunity = function ( a , b ) { f . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } , g . setWidth = f . setWidth , g . changeTo = f . changeTo , g . getPrioList = f . getPrioList } function GharialAdapter ( a , b , c , d ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " A reference to the graph viewer has to be given . " ; if ( void 0 = = = d ) throw " A configuration with graphName has to be given . " ; if ( void 0 = = = d . graphName ) throw " The graphname has to be given . " ; var e , f , g , h , i , j , k , l = this , m = { } , n = { } , o = { } , p = function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : n . graph + " / " + a + " / edge " , contentType : " application / json " , success : function ( a ) { h = a . collections , i = h [ 0 ] } } ) , $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : n . graph + " / " + a + " / vertex " , contentType : " application / json " , success : function ( a ) { f = a . collections , g = f [ 0 ] } } ) } , q = function ( a ) { j = a , p ( a ) , n . edges = n . graph + " / " + j + " / edge / " , n . vertices = n . graph + " / " + j + " / vertex / " , n . any = n . base + " simple / any " } , r = function ( a ) { var b = a . baseUrl | | " " ; void 0 ! = = a . width & & e . setWidth ( a . width ) , void 0 ! = = a . height & & e . setHeight ( a . height ) , k = void 0 ! = = a . undirected ? a . undirected = = = ! 0 ? " any " : " outbound " : " any " , n . base = b + " _api / " , n . cursor = n . base + " cursor " , n . graph = n . base + " gharial " , a . graphName & & q ( a . graphName ) } , s = function ( a , b , c ) { a ! = = o . getAllGraphs & & ( b . graph = j , a ! = = o . connectedEdges & & a ! = = o . childrenCentrality & & a ! = = o . randomVertices & & ( b . dir = k ) ) ; var d = { query : a , bindVars : b } ; $ . ajax ( { type : " POST " , url : n . cursor , data : JSON . stringify ( d ) , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( a ) { c ( a . result ) } , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw " Undefined ERROR " } } } ) } , t = function ( a , b ) { var c , d = { query : o . randomVertices , bindVars : { " @ collection " : b , limit : a } } ; return $ . ajax ( { type : " POST " , url : n . cursor , data : JSON . stringify ( d ) , contentType : " application / json " , dataType : " json " , processData : ! 1 , async : ! 1 , success : function ( a ) { c = a . result } , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw " Undefined ERROR " } } } ) , c } , u = function ( b , c ) { if ( 0 = = = b . length | | 0 = = = b [ 0 ] . length | | 0 = = = b [ 0 ] [ 0 ] . length ) return void ( c & & c ( { errorCode : 404 } ) ) ; b = b [ 0 ] [ 0 ] ; var d = { } , f = e . insertNode ( b [ 0 ] . vertex ) , g = a . length ; _ . each ( b , function ( b ) { var c = e . insertNode ( b . vertex ) , f = b . path ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) , _ . each ( f . vertices , function ( b ) { var c = e . insertNode ( b ) ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) } ) , _ . each ( f . edges , function ( a ) { e . insertEdge ( a ) } ) } ) , delete d [ f . _id ] , e . checkSizeOfInserted ( d ) , e . checkNodeLimit ( f ) , c & & c ( f ) } , v = function ( a ) { return function ( b ) { return b & & b . errorCode ? void a ( b ) : void a ( e . insertInitialNode ( b ) ) } } ; d . prioList & & ( m . prioList = d . prioList ) , e = new AbstractAdapter ( a , b , this , c , m ) , r ( d ) , o . getAllGraphs = " FOR g IN _graphs return g . _key " , o . traversal = ' RETURN GRAPH_TRAVERSAL ( @ graph , @ example , @ dir , { strategy : " depthfirst " , maxDepth : 1 , paths : true } ) ' , o . childrenCentrality = " RETURN LENGTH ( GRAPH_EDGES ( @ graph , @ id , { direction : any } ) ) " , o . connectedEdges = " RETURN GRAPH_EDGES ( @ graph , @ id ) " , o . randomVertices = " FOR x IN @ @ collection SORT RAND ( ) LIMIT @ limit RETURN x " , l . explore = e . explore , l . loadNode = function ( a , b ) { l . loadNodeFromTreeById ( a , b ) } , l . NODES_TO_DISPLAY = 19 , l . TOTAL_NODES = 0 , l . definedNodes = [ ] , l . randomNodes = [ ] , l . loadRandomNode = function ( a , b ) { var c , d = _ . shuffle ( l . getNodeCollections ( ) ) ; for ( c = 0 ; c < d . length ; + + c ) { void 0 ! = = b & & ( " all " = = = b ? l . NODES_TO_DISPLAY = l . TOTAL_NODES : l . NODES_TO_DISPLAY = parseInt ( b , 10 ) - 1 , l . NODES_TO_DISPLAY > = l . TOTAL_NODES ? $ ( " . infoField " ) . hide ( ) : $ ( " . infoField " ) . show ( ) ) ; var e = t ( l . NODES_TO_DISPLAY , d [ c ] ) ; if ( e . length > 0 ) { return _ . each ( e , function ( a ) { l . randomNodes . push ( a ) } ) , void l . loadInitialNode ( e [ 0 ] . _id , a ) } } a ( { errorCode : 404 } ) } , l . loadInitialNode = function ( a , b ) { e . cleanUp ( ) , l . loadNode ( a , v ( b ) ) } , l . getRandomNodes = function ( ) { var a = [ ] , b = [ ] ; l . definedNodes . length > 0 & & _ . each ( l . definedNodes , function ( a ) { b . push ( a ) } ) , l . randomNodes . length > 0 & & _ . each ( l . randomNodes , function ( a ) { b . push ( a ) } ) ; var c = 0 ; return _ . each ( b , function ( b ) { c < l . NODES_TO_DISPLAY & & ( a . push ( { vertex : b , path : { edges : [ ] , vertices : [ b ] } } ) , c + + ) } ) , a } , l . loadNodeFromTreeById = function ( a , b ) { s ( o . traversal , { example : a } , function ( c ) { var d = [ ] ; d = l . getRandomNodes ( ) , d . length > 0 ? _ . each ( d , function ( a ) { s ( o . traversal , { example : a . vertex . _id } , function ( a ) { _ . each ( a [ 0 ] [ 0 ] , function ( a ) { c [ 0 ] [ 0 ] . push ( a ) } ) , u ( c , b ) } ) } ) : s ( o . traversal , { example : a } , function ( a ) { u ( a , b ) } ) } ) } , l . loadNodeFromTreeByAttributeValue = function ( a , b , c ) { var d = { } ; d [ a ] = b , s ( o . traversal , { example : d } , function ( a ) { u ( a , c ) } ) } , l . getNodeExampleFromTreeByAttributeValue = function ( a , b , c ) { var d = { } ; d [ a ] = b , s ( o . traversal , { example : d } , function ( d ) { if ( void 0 = = = d [ 0 ] [ 0 ] ) throw arangoHelper . arangoError ( " Graph error " , " no nodes found " ) , " No suitable nodes have been found . " ; _ . each ( d [ 0 ] [ 0 ] , function ( d ) { if ( d . vertex [ a ] = = = b ) { var f = { } ; f . _key = d . vertex . _key , f . _id = d . vertex . _id , f . _rev = d . vertex . _rev , e . insertNode ( f ) , c ( f ) } } ) } ) } , l . loadAdditionalNodeByAttributeValue = function ( a , b , c ) { l . getNodeExampleFromTreeByAttributeValue ( a , b , c ) } , l . loadInitialNodeByAttributeValue = function ( a , b , c ) { e . cleanUp ( ) , l . loadNodeFromTreeByAttributeValue ( a , b , v ( c ) ) } , l . requestCentralityChildren = function ( a , b ) { s ( o . childrenCentrality , { id : a } , function ( a ) { b ( a [ 0 ] ) } ) } , l . createEdge = function ( a , b ) { var c = { } ; c . _from = a . source . _id , c . _to = a . target . _id , $ . ajax ( { cache : ! 1 , type : " POST " , url : n . edges + i , data : JSON . stringify ( c ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( a ) { if ( a . error = = = ! 1 ) { var d , f = a . edge ; f . _from = c . _from , f . _to = c . _to , d = e . insertEdge ( f ) , b ( d ) } } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . deleteEdge = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : n . edges + a . _id , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( ) { e . removeEdge ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . patchEdge = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : n . edges + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { a . _data = $ . extend ( a . _data , b ) , c ( ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . createNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : n . vertices + g , data : JSON . stringify ( a ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { c . error = = = ! 1 & & ( a . _key = c . vertex . _key , a . _id = c . vertex . _id , a . _rev = c . vertex . _rev , e . insertNode ( a ) , b ( a ) ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . deleteNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : n . vertices + a . _id , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { e . removeEdgesForNode ( a ) , e . removeNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . patchNode = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : n . vertices + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { a . _data = $ . extend ( a . _data , b ) , c ( a ) } , error : function ( a ) { throw a . statusText } } ) } , l . changeToGraph = function ( a , b ) { e . cleanUp ( ) , q ( a ) , void 0 ! = = b & & ( k = b = = = ! 0 ? " any " : " outbound " ) } , l . setNodeLimit = function ( a , b ) { e . setNodeLimit ( a , b ) } , l . setChildLimit = function ( a ) { e . setChildLimit ( a ) } , l . expandCommunity = function ( a , b ) { e . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } , l . getGraphs = function ( a ) { a & & a . length > = 1 & & s ( o . getAllGraphs , { } , a ) } , l . getAttributeExamples = function ( a ) { if ( a & & a . length > = 1 ) { var b , c = [ ] , d = _ . shuffle ( l . getNodeCollections ( ) ) ; for ( b = 0 ; b < d . length ; + + b ) { var e = t ( 10 , d [ b ] ) ; $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + encodeURIComponent ( d [ b ] ) + " / count " ) , contentType : " application / json " , success : function ( a ) { l . TOTAL_NODES = l . TOTAL_NODES + a . count } } ) , e . length > 0 & & ( c = c . concat ( _ . flatten ( _ . map ( e , function ( a ) { return _ . keys ( a ) } ) ) ) ) } var c = _ . sortBy ( _ . uniq ( c ) , function ( a ) { return a . toLowerCase ( ) } ) ; a ( c ) } } , l . getEdgeCollections = function ( ) { return h } , l . getSelectedEdgeCollection = function ( ) { return i } , l . useEdgeCollection = function ( a ) { if ( ! _ . contains ( h , a ) ) throw " Collection " + a + " is not available in the graph . " ; i = a } , l . getNodeCollections = function ( ) { return f } , l . getSelectedNodeCollection = function ( ) { return g } , l . useNodeCollection = function ( a ) { if ( ! _ . contains ( f , a ) ) throw " Collection " + a + " is not available in the graph . " ; g = a } , l . getDirection = function ( ) { return k } , l . getGraphName = function ( ) { return j } , l . setWidth = e . setWidth , l . changeTo = e . changeTo , l . getPrioList = e . getPrioList } function ModularityJoiner ( ) { " use strict " ; var a = { } , b = Array . prototype . forEach , c = Object . keys , d = Array . isArray , e = Object . prototype . toString , f = Array . prototype . indexOf , g = Array . prototype . map , h = Array . prototype . some , i = { isArray : d | | function ( a ) { return " [ object Array ] " = = = e . call ( a ) } , isFunction : function ( a ) { return " function " = = typeof a } , isString : function ( a ) { return " [ object String ] " = = = e . call ( a ) } , each : function ( c , d , e ) { if ( null ! = = c & & void 0 ! = = c ) { var f , g , h ; if ( b & & c . forEach = = = b ) c . forEach ( d , e ) ; else if ( c . length = = = + c . length ) { for ( f = 0 , g = c . length ; g > f ; f + + ) if ( d . call ( e , c [ f ] , f , c ) = = = a ) return } else for ( h in c ) if ( c . hasOwnProperty ( h ) & & d . call ( e , c [ h ] , h , c ) = = = a ) return } } , keys : c | | function ( a ) { if ( " object " ! = typeof a | | Array . isArray ( a ) ) throw new TypeError ( " Invalid object " ) ; var b , c = [ ] ; for ( b in a ) a . hasOwnProperty ( b ) & & ( c [ c . length ] = b ) ; return c } , min : function ( a , b , c ) { if ( ! b & & i . isArray ( a ) & & a [ 0 ] = = = + a [ 0 ] & & a . length < 65535 ) return Math . min . apply ( Math , a ) ; if ( ! b & & i . isEmpty ( a ) ) return 1 / 0 ; var d = { computed : 1 / 0 , value : 1 / 0 } ; return i . each ( a , function ( a , e , f ) { var g = b ? b . call ( c , a , e , f ) : a ; g < d . computed & & ( d = { value : a , computed : g } ) } ) , d . value } , map : function ( a , b , c ) { var d = [ ] ; return null = = = a ? d : g & & a . map = = = g ? a . map ( b , c ) : ( i . each ( a , function ( a , e , f ) { d [ d . length ] = b . call ( c , a , e , f ) } ) , d ) } , pluck : function ( a , b ) { return i . map ( a , function ( a ) { return a [ b ] } ) } , uniq : function ( a , b , c , d ) { i . isFunction ( b ) & & ( d = c , c = b , b = ! 1 ) ; var e = c ? i . map ( a , c , d ) : a , f = [ ] , g = [ ] ; return i . each ( e , function ( c , d ) { b ? d & & g [ g . length - 1 ] = = = c | | ( g . push ( c ) , f . push ( a [ d ] ) ) : i . contains ( g , c ) | | ( g . push ( c ) , f . push ( a [ d ] ) ) } ) , f } , union : function ( ) { return i . uniq ( Array . prototype . concat . apply ( Array . prototype , arguments ) ) } , isEmpty : function ( a ) { var b ; if ( null = = = a ) return ! 0 ; if ( i . isArray ( a ) | | i . isString ( a ) ) return 0 = = = a . length ; for ( b in a ) if ( a . hasOwnProperty ( b ) ) return ! 1 ; return ! 0 } , any : function ( b , c , d ) { c = c | | i . identity ; var e = ! 1 ; return null = = = b ? e : h & & b . some = = = h ? b . some ( c , d ) : ( i . each ( b , function ( b , f , g ) { return e ? a : ( e = c . call ( d , b , f , g ) , a ) } ) , ! ! e ) } , contains : function ( a , b ) { return null = = = a ? ! 1 : f & & a . indexOf = = = f ? - 1 ! = = a . indexOf ( b ) : i . any ( a , function ( a ) { return a = = = b } ) } , values : function ( a ) { var b , c = [ ] ; for ( b in a ) a . hasOwnProperty ( b ) & & c . push ( a [ b ] ) ; return c } } , j = { } , k = { } , l = { } , m = 0 , n = 0 , o = null , p = null , q = null , r = { } , s = function ( a ) { var b , c = Number . NEGATIVE_INFINITY ; return i . each ( p [ a ] , function ( a , d ) { a > c & & ( c = a , b = d ) } ) , 0 > c ? void delete q [ a ] : void ( q [ a ] = b ) } , t = function ( a , b ) { s ( b ) } , u = function ( a , b ) { return b > a ? p [ a ] & & p [ a ] [ b ] : p [ b ] & & p [ b ] [ a ] } , v = function ( a , b ) { return b > a ? p [ a ] [ b ] : p [ b ] [ a ] } , w = function ( a , b , c ) { return b > a ? ( p [ a ] = p [ a ] | | { } , void ( p [ a ] [ b ] = c ) ) : ( p [ b ] = p [ b ] | | { } , void ( p [ b ] [ a ] = c ) ) } , x = function ( a , b ) { if ( b > a ) { if ( ! p [ a ] ) return ; return delete p [ a ] [ b ] , void ( i . isEmpty ( p [ a ] ) & & delete p [ a ] ) } a ! = = b & & x ( b , a ) } , y = function ( a , b ) { var c , d ; return b > a ? u ( a , b ) ? ( d = v ( a , b ) , q [ a ] = = = b ? void s ( a ) : u ( a , q [ a ] ) ? ( c = v ( a , q [ a ] ) , void ( d > c & & ( q [ a ] = b ) ) ) : void s ( a ) ) : void s ( a ) : void ( a ! = = b & & y ( b , a ) ) } , z = function ( a , b ) { o [ a ] . _in + = o [ b ] . _in , o [ a ] . _out + = o [ b ] . _out , delete o [ b ] } , A = function ( a , b ) { j [ a ] = j [ a ] | | { } , j [ a ] [ b ] = ( j [ a ] [ b ] | | 0 ) + 1 , k [ b ] = k [ b ] | | { } , k [ b ] [ a ] = ( k [ b ] [ a ] | | 0 ) + 1 , l [ a ] = l [ a ] | | { _in : 0 , _out : 0 } , l [ b ] = l [ b ] | | { _in : 0 , _out : 0 } , l [ a ] . _out + + , l [ b ] . _in + + , m + + , n = Math . pow ( m , - 1 ) } , B = function ( a , b ) { j [ a ] & & ( j [ a ] [ b ] - - , 0 = = = j [ a ] [ b ] & & delete j [ a ] [ b ] , k [ b ] [ a ] - - , 0 = = = k [ b ] [ a ] & & delete k [ b ] [ a ] , l [ a ] . _out - - , l [ b ] . _in - - , m - - , n = m > 0 ? Math . pow ( m , - 1 ) : 0 , i . isEmpty ( j [ a ] ) & & delete j [ a ] , i . isEmpty ( k [ b ] ) & & delete k [ b ] , 0 = = = l [ a ] . _in & & 0 = = = l [ a ] . _out & & delete l [ a ] , 0 = = = l [ b ] . _in & & 0 = = = l [ b ] . _out & & delete l [ b ] ) } , C = function ( ) { return o = { } , i . each ( l , function ( a , b ) { o [ b ] = { _in : a . _in / m , _out : a . _out / m } } ) , o } , D = function ( a , b ) { return o [ a ] . _out * o [ b ] . _in + o [ a ] . _in * o [ b ] . _out } , E = function ( a ) { var b = i . keys ( j [ a ] | | { } ) , c = i . keys ( k [ a ] | | { } ) ; return i . union ( b , c ) } , F = function ( ) { p = { } , i . each ( j , function ( a , b ) { var c = k [ b ] | | { } , d = E ( b ) ; i . each ( d , function ( d ) { var e , f = a [ d ] | | 0 ; f + = c [ d ] | | 0 , e = f * n - D ( b , d ) , e > 0 & & w ( b , d , e ) } ) } ) } , G = function ( ) { return q = { } , i . each ( p , t ) , q } , H = function ( a , b , c ) { var d ; return u ( c , a ) ? ( d = v ( c , a ) , u ( c , b ) ? ( d + = v ( c , b ) , w ( c , a , d ) , x ( c , b ) , y ( c , a ) , void y ( c , b ) ) : ( d - = D ( c , b ) , 0 > d & & x ( c , a ) , void y ( c , a ) ) ) : void ( u ( c , b ) & & ( d = v ( c , b ) , d - = D ( c , a ) , d > 0 & & w ( c , a , d ) , y ( c , a ) , x ( c , b ) , y ( c , b ) ) ) } , I = function ( a , b ) { i . each ( p , function ( c , d ) { return d = = = a | | d = = = b ? void i . each ( c , function ( c , d ) { return d = = = b ? ( x ( a , b ) , void y ( a , b ) ) : void H ( a , b , d ) } ) : void H ( a , b , d ) } ) } , J = function ( ) { return j } , K = function ( ) { return q } , L = function ( ) { return p } , M = function ( ) { return o } , N = function ( ) { return r } , O = function ( ) { var a , b , c = Number . NEGATIVE_INFINITY ; return i . each ( q , function ( d , e ) { c < p [ e ] [ d ] & & ( a = d , b = e , c = p [ e ] [ d ] ) } ) , 0 > = c ? null : { sID : b , lID : a , val : c } } , P = function ( a ) { var b , c = Number . NEGATIVE_INFINITY ; return i . each ( a , function ( a ) { a . q > c & & ( c = a . q , b = a . nodes ) } ) , b } , Q = function ( ) { C ( ) , F ( ) , G ( ) , r = { } } , R = function ( a ) { var b = a . sID , c = a . lID , d = a . val ; r [ b ] = r [ b ] | | { nodes : [ b ] , q : 0 } , r [ c ] ? ( r [ b ] . nodes = r [ b ] . nodes . concat ( r [ c ] . nodes ) , r [ b ] . q + = r [ c ] . q , delete r [ c ] ) : r [ b ] . nodes . push ( c ) , r [ b ] . q + = d , I ( b , c ) , z ( b , c ) } , S = function ( a , b , c ) { if ( 0 = = = c . length ) return ! 0 ; var d = [ ] ; return i . each ( c , function ( c ) { a [ c ] = = = Number . POSITIVE_INFINITY & & ( a [ c ] = b , d = d . concat ( E ( c ) ) ) } ) , S ( a , b + 1 , d ) } , T = function ( a ) { var b = { } ; if ( i . each ( j , function ( a , c ) { b [ c ] = Number . POSITIVE_INFINITY } ) , b [ a ] = 0 , S ( b , 1 , E ( a ) ) ) return b ; throw " FAIL ! " } , U = function ( a ) { return function ( b ) { return a [ b ] } } , V = function ( a , b ) { var c , d = { } , e = [ ] , f = { } , g = function ( a , b ) { var c = f [ i . min ( a , U ( f ) ) ] , e = f [ i . min ( b , U ( f ) ) ] , g = e - c ; return 0 = = = g & & ( g = d [ b [ b . length - 1 ] ] . q - d [ a [ a . length - 1 ] ] . q ) , g } ; for ( Q ( ) , c = O ( ) ; null ! = = c ; ) R ( c ) , c = O ( ) ; return d = N ( ) , void 0 ! = = b ? ( i . each ( d , function ( a , c ) { i . contains ( a . nodes , b ) & & delete d [ c ] } ) , e = i . pluck ( i . values ( d ) , " nodes " ) , f = T ( b ) , e . sort ( g ) , e [ 0 ] ) : P ( d ) } ; this . insertEdge = A , this . deleteEdge = B , this . getAdjacencyMatrix = J , this . getHeap = K , this . getDQ = L , this . getDegrees = M , this . getCommunities = N , this . getBest = O , this . setup = Q , this . joinCommunity = R , this . getCommunity = V } function NodeReducer ( a ) { " use strict " ; a = a | | [ ] ; var b = function ( a , b ) { a . push ( b ) } , c = function ( a , b ) { if ( ! a . reason . example ) return a . reason . example = b , 1 ; var c = b . _data | | { } , d = a . reason . example . _data | | { } , e = _ . union ( _ . keys ( d ) , _ . keys ( c ) ) , f = 0 , g = 0 ; return _ . each ( e , function ( a ) { void 0 ! = = d [ a ] & & void 0 ! = = c [ a ] & & ( f + + , d [ a ] = = = c [ a ] & & ( f + = 4 ) ) } ) , g = 5 * e . length , g + + , f + + , f / g } , d = function ( ) { return a } , e = function ( b ) { a = b } , f = function ( b , c ) { var d = { } , e = [ ] ; return _ . each ( b , function ( b ) { var c , e , f = b . _data , g = 0 ; for ( g = 0 ; g < a . length ; g + + ) if ( c = a [ g ] , void 0 ! = = f [ c ] ) return e = f [ c ] , d [ c ] = d [ c ] | | { } , d [ c ] [ e ] = d [ c ] [ e ] | | [ ] , void d [ c ] [ e ] . push ( b ) ; e = " default " , d [ e ] = d [ e ] | | [ ] , d [ e ] . push ( b ) } ) , _ . each ( d , function ( a , b ) { _ . each ( a , function ( a , c ) { var d = { key : b , value : c , text : b + " : " + c } ; e . push ( { reason : d , nodes : a } ) } ) } ) , e } , g = function ( d , e ) { var g = [ ] , h = . 5 ; return d . length < = e ? g = _ . map ( d , function ( a ) { return { reason : { type : " single " , text : " One Node " } , nodes : [ a ] } } ) : _ . isEmpty ( a ) ? ( _ . each ( d , function ( a ) { var d , f , i ; for ( f = 0 , i = Number . POSITIVE_INFINITY , d = 0 ; e > d ; d + + ) { if ( g [ d ] = g [ d ] | | { reason : { type : " similar " , text : " Similar Nodes " } , nodes : [ ] } , c ( g [ d ] , a ) > h ) return void b ( g [ d ] . nodes , a ) ; i > g [ d ] . nodes . length & & ( f = d , i = g [ d ] . nodes . length ) } b ( g [ f ] . nodes , a ) } ) , g ) : f ( d , e ) } ; this . bucketNodes = g , this . changePrioList = e , this . getPrioList = d } function NodeShaper ( a , b , c ) { " use strict " ; var d , e , f = this , g = [ ] , h = ! 0 , i = new ContextMenu ( " gv_node_cm " ) , j = function ( a , b ) { return _ . isArray ( a ) ? b [ _ . find ( a , function ( a ) { return b [ a ] } ) ] : b [ a ] } , k = function ( a ) { if ( void 0 = = = a ) return [ " " ] ; " string " ! = typeof a & & ( a = String ( a ) ) ; var b = a . match ( / [ \ w \ W ] { 1 , 10 } ( \ s | $ ) | \ S + ? ( \ s | $ ) / g ) ; return b [ 0 ] = $ . trim ( b [ 0 ] ) , b [ 1 ] = $ . trim ( b [ 1 ] ) , b [ 0 ] . length > 12 & & ( b [ 0 ] = $ . trim ( a . substring ( 0 , 10 ) ) , b [ 1 ] = $ . trim ( a . substring ( 10 ) ) , b [ 1 ] . length > 12 & & ( b [ 1 ] = b [ 1 ] . split ( / \ W / ) [ 0 ] , b [ 1 ] . length > 2 & & ( b [ 1 ] = b [ 1 ] . substring ( 0 , 5 ) + " . . . " ) ) , b . length = 2 ) , b . length > 2 & & ( b . length = 2 , b [ 1 ] + = " . . . " ) , b } , l = function ( a ) { } , m = l , n = function ( a ) { return { x : a . x , y : a . y , z : 1 } } , o = n , p = function ( ) { _ . each ( g , function ( a ) { a . position = o ( a ) , a . _isCommunity & & a . addDistortion ( o ) } ) } , q = new ColourMapper , r = function ( ) { q . reset ( ) } , s = function ( a ) { return a . _id } , t = l , u = l , v = l , w = function ( ) { return " black " } , x = function ( ) { f . parent . selectAll ( " . node " ) . on ( " mousedown . drag " , null ) , d = { click : l , dblclick : l , drag : l , mousedown : l , mouseup : l , mousemove : l , mouseout : l , mouseover : l } , e = l } , y = function ( a ) { _ . each ( d , function ( b , c ) { " drag " = = = c ? a . call ( b ) : a . on ( c , b ) } ) } , z = function ( a ) { var b = a . filter ( function ( a ) { return a . _isCommunity } ) , c = a . filter ( function ( a ) { return ! a . _isCommunity } ) ; u ( c ) , b . each ( function ( a ) { a . shapeNodes ( d3 . select ( this ) , u , z , m , q ) } ) , h & & v ( c ) , t ( c ) , y ( c ) , p ( ) } , A = function ( a , b ) { if ( " update " = = = a ) e = b ; else { if ( void 0 = = = d [ a ] ) throw " Sorry Unknown Event " + a + " cannot be bound . " ; d [ a ] = b } } , B = function ( ) { var a = f . parent . selectAll ( " . node " ) ; p ( ) , a . attr ( " transform " , function ( a ) { return " translate ( " + a . position . x + " , " + a . position . y + " ) scale ( " + a . position . z + " ) " } ) , e ( a ) } , C = function ( a ) { void 0 ! = = a & & ( g = a ) ; var b = f . parent . selectAll ( " . node " ) . data ( g , s ) ; b . enter ( ) . append ( " g " ) . attr ( " class " , function ( a ) { return a . _isCommunity ? " node communitynode " : " node " } ) . attr ( " id " , s ) , b . exit ( ) . remove ( ) , b . selectAll ( " * > * " ) . remove ( ) , z ( b ) , B ( ) , i . bindMenu ( $ ( " . node " ) ) } , D = function ( a ) { var b , c , d , e , f , g , h ; switch ( a . type ) { case NodeShaper . shapes . NONE : u = l ; break ; case NodeShaper . shapes . CIRCLE : b = a . radius | | 25 , u = function ( a , c ) { a . append ( " circle " ) . attr ( " r " , b ) , c & & a . attr ( " cx " , - c ) . attr ( " cy " , - c ) } ; break ; case NodeShaper . shapes . RECT : c = a . width | | 90 , d = a . height | | 36 , e = _ . isFunction ( c ) ? function ( a ) { return - ( c ( a ) / 2 ) } : function ( a ) { return - ( c / 2 ) } , f = _ . isFunction ( d ) ? function ( a ) { return - ( d ( a ) / 2 ) } : function ( ) { return - ( d / 2 ) } , u = function ( a , b ) { b = b | | 0 , a . append ( " rect " ) . attr ( " width " , c ) . attr ( " height " , d ) . attr ( " x " , function ( a ) { return e ( a ) - b } ) . attr ( " y " , function ( a ) { return f ( a ) - b } ) . attr ( " rx " , " 8 " ) . attr ( " ry " , " 8 " ) } ; break ; case NodeShaper . shapes . IMAGE : c = a . width | | 32 , d = a . height | | 32 , g = a . fallback | | " " , h = a . source | | g , e = _ . isFunction ( c ) ? function ( a ) { return - ( c ( a ) / 2 ) } : - ( c / 2 ) , f = _ . isFunction ( d ) ? function ( a ) { return - ( d ( a ) / 2 ) } : - ( d / 2 ) , u = function ( a ) { var b = a . append ( " image " ) . attr ( " width " , c ) . attr ( " height " , d ) . attr ( " x " , e ) . attr ( " y " , f ) ; _ . isFunction ( h ) ? b . attr ( " xlink : href " , h ) : b . attr ( " xlink : href " , function ( a ) { return a . _data [ h ] ? a . _data [ h ] : g } ) } ; break ; case void 0 : break ; default : throw " Sorry given Shape not known ! " } } , E = function ( a ) { var b = [ ] ; _ . each ( a , function ( a ) { b = $ ( a ) . find ( " text " ) , $ ( a ) . css ( " width " , " 90px " ) , $ ( a ) . css ( " height " , " 36px " ) , $ ( a ) . textfill ( { innerTag : " text " , maxFontPixels : 16 , minFontPixels : 10 , explicitWidth : 90 , explicitHeight : 36 } ) } ) } , F = function ( a ) { v = _ . isFunction ( a ) ? function ( b ) { var c = b . append ( " text " ) . attr ( " text - anchor " , " middle " ) . attr ( " fill " , w ) . attr ( " stroke " , " none " ) ; c . each ( function ( b ) { var c = k ( a ( b ) ) , d = c [ 0 ] ; 2 = = = c . length & & ( d + = c [ 1 ] ) , d . length > 15 & & ( d = d . substring ( 0 , 13 ) + " . . . " ) , ( void 0 = = = d | | " " = = = d ) & & ( d = " ATTR NOT SET " ) , d3 . select ( this ) . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " 5 " ) . text ( d ) } ) , E ( b ) } : function ( b ) { var c = b . append ( " text " ) . attr ( " text - anchor " , " middle " ) . attr ( " fill " , w ) . attr ( " stroke " , " none " ) ; c . each ( function ( b ) { var c = k ( j ( a , b . _data ) ) , d = c [ 0 ] ; 2 = = = c . length & & ( d + = c [ 1 ] ) , d . length > 15 & & ( d = d . substring ( 0 , 13 ) + " . . . " ) , ( void 0 = = = d | | " " = = = d ) & & ( d = " ATTR NOT SET " ) , d3 . select ( this ) . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " 5 " ) . text ( d ) } ) , E ( b ) } } , G = function ( a ) { void 0 ! = = a . reset & & a . reset & & x ( ) , _ . each ( a , function ( a , b ) { " reset " ! = = b & & A ( b , a ) } ) } , H = function ( a ) { switch ( r ( ) , a . type ) { case " single " : t = function ( b ) { b . attr ( " fill " , a . fill ) } , w = function ( b ) { return a . stroke } ; break ; case " expand " : t = function ( b ) { b . attr ( " fill " , function ( b ) { return b . _expanded ? a . expanded : a . collapsed } ) } , w = function ( a ) { return " white " } ; break ; case " attribute " : t = function ( b ) { b . attr ( " fill " , function ( b ) { return void 0 = = = b . _data ? q . getCommunityColour ( ) : q . getColour ( j ( a . key , b . _data ) ) } ) . attr ( " stroke " , function ( a ) { return a . _expanded ? " # fff " : " transparent " } ) . attr ( " fill - opacity " , function ( a ) { return a . _expanded ? " 1 " : " 0 . 3 " } ) } , w = function ( b ) { return void 0 = = = b . _data ? q . getForegroundCommunityColour ( ) : q . getForegroundColour ( j ( a . key , b . _data ) ) } ; break ; default : throw " Sorry given colour - scheme not known " } } , I = function ( a ) { if ( " reset " = = = a ) o = n ; else { if ( ! _ . isFunction ( a ) ) throw " Sorry distortion cannot be parsed . " ; o = a } } , J = function ( a ) { void 0 ! = = a . shape & & D ( a . shape ) , void 0 ! = = a . label & & ( F ( a . label ) , f . label = a . label ) , void 0 ! = = a . actions & & G ( a . actions ) , void 0 ! = = a . color & & ( H ( a . color ) , f . color = a . color ) , void 0 ! = = a . distortion & & I ( a . distortion ) } ; f . parent = a , x ( ) , void 0 = = = b & & ( b = { } ) , void 0 = = = b . shape & & ( b . shape = { type : NodeShaper . shapes . RECT } ) , void 0 = = = b . color & & ( b . color = { type : " single " , fill : " # 333333 " , stroke : " white " } ) , void 0 = = = b . distortion & & ( b . distortion = " reset " ) , J ( b ) , _ . isFunction ( c ) & & ( s = c ) , f . changeTo = function ( a ) { J ( a ) , C ( ) } , f . drawNodes = function ( a ) { C ( a ) } , f . updateNodes = function ( ) { B ( ) } , f . reshapeNodes = function ( ) { C ( ) } , f . activateLabel = function ( a ) { h = a ? ! 0 : ! 1 , C ( ) } , f . getColourMapping = function ( ) { return q . getList ( ) } , f . setColourMappingListener = function ( a ) { q . setChangeListener ( a ) } , f . setGVStartFunction = function ( a ) { m = a } , f . getLabel = function ( ) { return f . label | | " " } , f . getColor = function ( ) { return f . color . key | | " " } , f . addMenuEntry = function ( a , b ) { i . addEntry ( a , b ) } , f . resetColourMap = r } function PreviewAdapter ( a , b , c , d ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " A reference to the graph viewer has to be given . " ; var e = this , f = new AbstractAdapter ( a , b , this , c ) , g = function ( a ) { void 0 ! = = a . width & & f . setWidth ( a . width ) , void 0 ! = = a . height & & f . setHeight ( a . height ) } , h = function ( a , b ) { var c = { } , d = a . first ; d = f . insertNode ( d ) , _ . each ( a . nodes , function ( a ) { a = f . insertNode ( a ) , c [ a . _id ] = a } ) , _ . each ( a . edges , function ( a ) { f . insertEdge ( a ) } ) , delete c [ d . _id ] , void 0 ! = = b & & _ . isFunction ( b ) & & b ( d ) } ; d = d | | { } , g ( d ) , e . loadInitialNode = function ( a , b ) { f . cleanUp ( ) ; var c = function ( a ) { b ( f . insertInitialNode ( a ) ) } ; e . loadNode ( a , c ) } , e . loadNode = function ( a , b ) { var c = [ ] , d = [ ] , e = { } , f = { _id : 1 , label : " Node 1 " , image : " img / stored . png " } , g = { _id : 2 , label : " Node 2 " } , i = { _id : 3 , label : " Node 3 " } , j = { _id : 4 , label : " Node 4 " } , k = { _id : 5 , label : " Node 5 " } , l = { _id : " 1 - 2 " , _from : 1 , _to : 2 , label : " Edge 1 " } , m = { _id : " 1 - 3 " , _from : 1 , _to : 3 , label : " Edge 2 " } , n = { _id : " 1 - 4 " , _from : 1 , _to : 4 , label : " Edge 3 " } , o = { _id : " 1 - 5 " , _from : 1 , _to : 5 , label : " Edge 4 " } , p = { _id : " 2 - 3 " , _from : 2 , _to : 3 , label : " Edge 5 " } ; c . push ( f ) , c . push ( g ) , c . push ( i ) , c . push ( j ) , c . push ( k ) , d . push ( l ) , d . push ( m ) , d . push ( n ) , d . push ( o ) , d . push ( p ) , e . first = f , e . nodes = c , e . edges = d , h ( e , b ) } , e . explore = f . explore , e . requestCentralityChildren = function ( a , b ) { } , e . createEdge = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " createEdge was triggered . " ) } , e . deleteEdge = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " deleteEdge was triggered . " ) } , e . patchEdge = function ( a , b , c ) { arangoHelper . arangoError ( " Server - side " , " patchEdge was triggered . " ) } , e . createNode = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " createNode was triggered . " ) } , e . deleteNode = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " deleteNode was triggered . " ) , arangoHelper . arangoError ( " Server - side " , " onNodeDelete was triggered . " ) } , e . patchNode = function ( a , b , c ) { arangoHelper . arangoError ( " Server - side " , " patchNode was triggered . " ) } , e . setNodeLimit = function ( a , b ) { f . setNodeLimit ( a , b ) } , e . setChildLimit = function ( a ) { f . setChildLimit ( a ) } , e . setWidth = f . setWidth , e . expandCommunity = function ( a , b ) { f . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } } function WebWorkerWrapper ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A class has to be given . " ; if ( void 0 = = = b ) throw " A callback has to be given . " ; var c , d = Array . prototype . slice . call ( arguments ) , e = { } , f = function ( ) { var c , d = function ( a ) { switch ( a . data . cmd ) { case " construct " : try { w = new ( Function . prototype . bind . apply ( Construct , [ null ] . concat ( a . data . args ) ) ) , w ? self . postMessage ( { cmd : " construct " , result : ! 0 } ) : self . postMessage ( { cmd : " construct " , result : ! 1 } ) } catch ( b ) { self . postMessage ( { cmd : " construct " , result : ! 1 , error : b . message | | b } ) } break ; default : var c , d = { cmd : a . data . cmd } ; if ( w & & " function " = = typeof w [ a . data . cmd ] ) try { c = w [ a . data . cmd ] . apply ( w , a . data . args ) , c & & ( d . result = c ) , self . postMessage ( d ) } catch ( e ) { d . error = e . message | | e , self . postMessage ( d ) } else d . error = " Method not known " , self . postMessage ( d ) } } , e = function ( a ) { var b = " var w , Construct = " + a . toString ( ) + " ; self . onmessage = " + d . toString ( ) ; return new window . Blob ( b . split ( ) ) } , f = window . URL , g = new e ( a ) ; return c = new window . Worker ( f . createObjectURL ( g ) ) , c . onmessage = b , c } , g = function ( ) { return a . apply ( this , d ) } ; try { return c = f ( ) , e . call = function ( a ) { var b = Array . prototype . slice . call ( arguments ) ; b . shift ( ) , c . postMessage ( { cmd : a , args : b } ) } , d . shift ( ) , d . shift ( ) , d . unshift ( " construct " ) , e . call . apply ( this , d ) , e } catch ( h ) { d . shift ( ) , d . shift ( ) , g . prototype = a . prototype ; try { c = new g } catch ( i ) { return void b ( { data : { cmd : " construct " , error : i } } ) } return e . call = function ( a ) { var d = Array . prototype . slice . call ( arguments ) , e = { data : { cmd : a } } ; if ( ! _ . isFunction ( c [ a ] ) ) return e . data . error = " Method not known " , void b ( e ) ; d . shift ( ) ; try { e . data . result = c [ a ] . apply ( c , d ) , b ( e ) } catch ( f ) { e . data . error = f , b ( e ) } } , b ( { data : { cmd : " construct " , result : ! 0 } } ) , e } } function ZoomManager ( a , b , c , d , e , f , g , h ) { " use strict " ; if ( void 0 = = = a | | 0 > a ) throw " A width has to be given . " ; if ( void 0 = = = b | | 0 > b ) throw " A height has to be given . " ; if ( void 0 = = = c | | void 0 = = = c . node | | " svg " ! = = c . node ( ) . tagName . toLowerCase ( ) ) throw " A svg has to be given . " ; if ( void 0 = = = d | | void 0 = = = d . node | | " g " ! = = d . node ( ) . tagName . toLowerCase ( ) ) throw " A group has to be given . " ; if ( void 0 = = = e | | void 0 = = = e . activateLabel | | void 0 = = = e . changeTo | | void 0 = = = e . updateNodes ) throw " The Node shaper has to be given . " ; if ( void 0 = = = f | | void 0 = = = f . activateLabel | | void 0 = = = f . updateEdges ) throw " The Edge shaper has to be given . " ; var i , j , k , l , m , n , o , p , q , r , s , t , u , v , w , x = this , y = a * b , z = h | | function ( ) { } , A = function ( ) { var a , b ; return l > = k ? ( b = i * l , b * = b , a = 60 * b ) : ( b = j * l , b * = b , a = 4 * Math . PI * b ) , Math . floor ( y / a ) } , B = function ( ) { q = s / l - . 99999999 , r = t / l , p . distortion ( q ) , p . radius ( r ) } , C = function ( a , b , c , g ) { g ? null ! = = a & & ( l = a ) : l = a , null ! = = b & & ( m [ 0 ] + = b ) , null ! = = c & & ( m [ 1 ] + = c ) , o = A ( ) , z ( o ) , e . activateLabel ( l > = k ) , f . activateLabel ( l > = k ) , B ( ) ; var h = " translate ( " + m + " ) " , i = " scale ( " + l + " ) " ; d . _isCommunity ? d . attr ( " transform " , h ) : d . attr ( " transform " , h + i ) , v & & v . slider ( " option " , " value " , l ) } , D = function ( a ) { var b = [ ] ; return b [ 0 ] = a [ 0 ] - n [ 0 ] , b [ 1 ] = a [ 1 ] - n [ 1 ] , n [ 0 ] = a [ 0 ] , n [ 1 ] = a [ 1 ] , b } , E = function ( a ) { void 0 = = = a & & ( a = { } ) ; var b = a . maxFont | | 16 , c = a . minFont | | 6 , d = a . maxRadius | | 25 , e = a . minRadius | | 4 ; s = a . focusZoom | | 1 , t = a . focusRadius | | 100 , w = e / d , i = b , j = d , k = c / b , l = 1 , m = [ 0 , 0 ] , n = [ 0 , 0 ] , B ( ) , o = A ( ) , u = d3 . behavior . zoom ( ) . scaleExtent ( [ w , 1 ] ) . on ( " zoom " , function ( ) { var a , b = d3 . event . sourceEvent , c = l ; " mousewheel " = = = b . type | | " DOMMouseScroll " = = = b . type ? ( b . wheelDelta ? b . wheelDelta > 0 ? ( c + = . 01 , c > 1 & & ( c = 1 ) ) : ( c - = . 01 , w > c & & ( c = w ) ) : b . detail > 0 ? ( c + = . 01 , c > 1 & & ( c = 1 ) ) : ( c - = . 01 , w > c & & ( c = w ) ) , a = [ 0 , 0 ] ) : a = D ( d3 . event . translate ) , C ( c , a [ 0 ] , a [ 1 ] ) } ) } , F = function ( ) { } ; p = d3 . fisheye . circular ( ) , E ( g ) , c . call ( u ) , e . changeTo ( { distortion : p } ) , c . on ( " mousemove " , F ) , x . translation = function ( ) { return null } , x . scaleFactor = function ( ) { return l } , x . scaledMouse = function ( ) { return null } , x . getDistortion = function ( ) { return q } , x . getDistortionRadius = function ( ) { return r } , x . getNodeLimit = function ( ) { return o } , x . getMinimalZoomFactor = function ( ) { return w } , x . registerSlider = function ( a ) { v = a } , x . triggerScale = function ( a ) { C ( a , null , null , ! 0 ) } , x . triggerTranslation = function ( a , b ) { C ( null , a , b , ! 0 ) } , x . changeWidth = function ( c ) { y = a * b } } function ArangoAdapterControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The ArangoAdapter has to be given . " ; this . addControlChangeCollections = function ( c ) { var d = " control_adapter_collections " , e = d + " _ " ; b . getCollections ( function ( f , g ) { b . getGraphs ( function ( h ) { uiComponentsHelper . createButton ( a , " Collections " , d , function ( ) { modalDialogHelper . createModalDialog ( " Switch Collections " , e , [ { type : " decission " , id : " collections " , group : " loadtype " , text : " Select existing collections " , isDefault : void 0 = = = b . getGraphName ( ) , interior : [ { type : " list " , id : " node_collection " , text : " Vertex collection " , objects : f , selected : b . getNodeCollection ( ) } , { type : " list " , id : " edge_collection " , text : " Edge collection " , objects : g , selected : b . getEdgeCollection ( ) } ] } , { type : " decission " , <nl> - id : " graphs " , group : " loadtype " , text : " Select existing graph " , isDefault : void 0 ! = = b . getGraphName ( ) , interior : [ { type : " list " , id : " graph " , objects : h , selected : b . getGraphName ( ) } ] } , { type : " checkbox " , text : " Start with random vertex " , id : " random " , selected : ! 0 } , { type : " checkbox " , id : " undirected " , selected : " any " = = = b . getDirection ( ) } ] , function ( ) { var a = $ ( " # " + e + " node_collection " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , d = $ ( " # " + e + " edge_collection " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , f = $ ( " # " + e + " graph " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , g = ! ! $ ( " # " + e + " undirected " ) . prop ( " checked " ) , h = ! ! $ ( " # " + e + " random " ) . prop ( " checked " ) , i = $ ( " input [ type = ' radio ' ] [ name = ' loadtype ' ] : checked " ) . prop ( " id " ) ; return i = = = e + " collections " ? b . changeToCollections ( a , d , g ) : b . changeToGraph ( f , g ) , h ? void b . loadRandomNode ( c ) : void ( _ . isFunction ( c ) & & c ( ) ) } ) } ) } ) } ) } , this . addControlChangePriority = function ( ) { var c = " control_adapter_priority " , d = c + " _ " , e = ( b . getPrioList ( ) , " Group vertices " ) ; uiComponentsHelper . createButton ( a , e , c , function ( ) { modalDialogHelper . createModalChangeDialog ( e , d , [ { type : " extendable " , id : " attribute " , objects : b . getPrioList ( ) } ] , function ( ) { var a = $ ( " input [ id ^ = " + d + " attribute_ ] " ) , c = [ ] ; a . each ( function ( a , b ) { var d = $ ( b ) . val ( ) ; " " ! = = d & & c . push ( d ) } ) , b . changeTo ( { prioList : c } ) } ) } ) } , this . addAll = function ( ) { this . addControlChangeCollections ( ) , this . addControlChangePriority ( ) } } function ContextMenu ( a ) { " use strict " ; if ( void 0 = = = a ) throw " An id has to be given . " ; var b , c , d = " # " + a , e = function ( a , d ) { var e , f ; e = document . createElement ( " div " ) , e . className = " context - menu - item " , f = document . createElement ( " div " ) , f . className = " context - menu - item - inner " , f . appendChild ( document . createTextNode ( a ) ) , f . onclick = function ( ) { d ( d3 . select ( c . target ) . data ( ) [ 0 ] ) } , e . appendChild ( f ) , b . appendChild ( e ) } , f = function ( a ) { c = $ . contextMenu . create ( d , { shadow : ! 1 } ) , a . each ( function ( ) { $ ( this ) . bind ( " contextmenu " , function ( a ) { return c . show ( this , a ) , ! 1 } ) } ) } , g = function ( ) { return b = document . getElementById ( a ) , b & & b . parentElement . removeChild ( b ) , b = document . createElement ( " div " ) , b . className = " context - menu context - menu - theme - osx " , b . id = a , document . body . appendChild ( b ) , b } ; g ( ) , this . addEntry = e , this . bindMenu = f } function EdgeShaperControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The EdgeShaper has to be given . " ; var c = this ; this . addControlOpticShapeNone = function ( ) { var c = " control_edge_none " ; uiComponentsHelper . createButton ( a , " None " , c , function ( ) { b . changeTo ( { shape : { type : EdgeShaper . shapes . NONE } } ) } ) } , this . addControlOpticShapeArrow = function ( ) { var c = " control_edge_arrow " ; uiComponentsHelper . createButton ( a , " Arrow " , c , function ( ) { b . changeTo ( { shape : { type : EdgeShaper . shapes . ARROW } } ) } ) } , this . addControlOpticLabel = function ( ) { var c = " control_edge_label " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Label Attribute " , d , [ { type : " text " , id : " key " , text : " Edge label attribute " , value : b . getLabel ( ) } ] , function ( ) { var a = $ ( " # " + d + " key " ) . attr ( " value " ) ; b . changeTo ( { label : a } ) } ) } ) } , this . addControlOpticLabelList = function ( ) { var d = " control_edge_label " , e = d + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , d , function ( ) { modalDialogHelper . createModalDialog ( " Change Label Attribute " , e , [ { type : " extendable " , id : " label " , text : " Edge label attribute " , objects : b . getLabel ( ) } ] , function ( ) { var a = $ ( " input [ id ^ = " + e + " label_ ] " ) , d = [ ] ; a . each ( function ( a , b ) { var c = $ ( b ) . val ( ) ; " " ! = = c & & d . push ( c ) } ) ; var f = { label : d } ; c . applyLocalStorage ( f ) , b . changeTo ( f ) } ) } ) } , this . applyLocalStorage = function ( a ) { if ( " undefined " ! = = Storage ) try { var b = JSON . parse ( localStorage . getItem ( " graphSettings " ) ) , c = window . location . hash . split ( " / " ) [ 1 ] , d = window . location . pathname . split ( " / " ) [ 2 ] , e = c + d ; _ . each ( a , function ( a , c ) { void 0 ! = = c & & ( b [ e ] . viewer . hasOwnProperty ( " edgeShaper " ) | | ( b [ e ] . viewer . edgeShaper = { } ) , b [ e ] . viewer . edgeShaper [ c ] = a ) } ) , localStorage . setItem ( " graphSettings " , JSON . stringify ( b ) ) } catch ( f ) { console . log ( f ) } } , this . addControlOpticSingleColour = function ( ) { var c = " control_edge_singlecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Single Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Colour " , d , [ { type : " text " , id : " stroke " } ] , function ( ) { var a = $ ( " # " + d + " stroke " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " single " , stroke : a } } ) } ) } ) } , this . addControlOpticAttributeColour = function ( ) { var c = " control_edge_attributecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Colour by Attribute " , c , function ( ) { modalDialogHelper . createModalDialog ( " Display colour by attribute " , d , [ { type : " text " , id : " key " } ] , function ( ) { var a = $ ( " # " + d + " key " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " attribute " , key : a } } ) } ) } ) } , this . addControlOpticGradientColour = function ( ) { var c = " control_edge_gradientcolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Gradient Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Change colours for gradient " , d , [ { type : " text " , id : " source " } , { type : " text " , id : " target " } ] , function ( ) { var a = $ ( " # " + d + " source " ) . attr ( " value " ) , c = $ ( " # " + d + " target " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " gradient " , source : a , target : c } } ) } ) } ) } , this . addAllOptics = function ( ) { c . addControlOpticShapeNone ( ) , c . addControlOpticShapeArrow ( ) , c . addControlOpticLabel ( ) , c . addControlOpticSingleColour ( ) , c . addControlOpticAttributeColour ( ) , c . addControlOpticGradientColour ( ) } , this . addAllActions = function ( ) { } , this . addAll = function ( ) { c . addAllOptics ( ) , c . addAllActions ( ) } } function EventDispatcherControls ( a , b , c , d , e ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The NodeShaper has to be given . " ; if ( void 0 = = = c ) throw " The EdgeShaper has to be given . " ; if ( void 0 = = = d ) throw " The Start callback has to be given . " ; var f = this , g = { expand : { icon : " hand - pointer - o " , title : " Expand a node . " } , add : { icon : " plus - square " , title : " Add a node . " } , trash : { icon : " minus - square " , title : " Remove a node / edge . " } , drag : { icon : " hand - rock - o " , title : " Drag a node . " } , edge : { icon : " external - link - square " , title : " Create an edge between two nodes . " } , edit : { icon : " pencil - square " , title : " Edit attributes of a node . " } , view : { icon : " search " , title : " View attributes of a node . " } } , h = new EventDispatcher ( b , c , e ) , i = e . edgeEditor . adapter , j = ! ! i & & _ . isFunction ( i . useNodeCollection ) & & _ . isFunction ( i . useEdgeCollection ) , k = function ( b ) { a . appendChild ( b ) } , l = function ( a , b , c ) { var d = uiComponentsHelper . createIconButton ( a , " control_event_ " + b , c ) ; k ( d ) } , m = function ( a ) { h . rebind ( " nodes " , a ) } , n = function ( a ) { h . rebind ( " edges " , a ) } , o = function ( a ) { h . rebind ( " svg " , a ) } , p = function ( a ) { var b = a | | window . event , c = { } ; return c . x = b . clientX , c . y = b . clientY , c . x + = document . body . scrollLeft , c . y + = document . body . scrollTop , c } , q = function ( a ) { var b , c , d , e = p ( a ) , f = $ ( " svg # graphViewerSVG " ) . offset ( ) ; return b = d3 . select ( " svg # graphViewerSVG " ) . node ( ) , d = b . getBoundingClientRect ( ) , $ ( " svg # graphViewerSVG " ) . height ( ) < = d . height ? { x : e . x - f . left , y : e . y - f . top } : ( c = b . getBBox ( ) , { x : e . x - ( d . left - c . x ) , y : e . y - ( d . top - c . y ) } ) } , r = { nodes : { } , edges : { } , svg : { } } , s = function ( ) { var a = " control_event_new_node " , c = a + " _ " , e = function ( a ) { var e = q ( a ) ; modalDialogHelper . createModalCreateDialog ( " Create New Node " , c , { } , function ( a ) { h . events . CREATENODE ( a , function ( a ) { $ ( " # " + c + " modal " ) . modal ( " hide " ) , b . reshapeNodes ( ) , d ( ) } , e . x , e . y ) ( ) } ) } ; r . nodes . newNode = e } , t = function ( ) { var a = function ( a ) { modalDialogHelper . createModalViewDialog ( " View Node " + a . _id , " control_event_node_view_ " , a . _data , function ( ) { modalDialogHelper . createModalEditDialog ( " Edit Node " + a . _id , " control_event_node_edit_ " , a . _data , function ( b ) { h . events . PATCHNODE ( a , b , function ( ) { $ ( " # control_event_node_edit_modal " ) . modal ( " hide " ) } ) ( ) } ) } ) } , b = function ( a ) { modalDialogHelper . createModalViewDialog ( " View Edge " + a . _id , " control_event_edge_view_ " , a . _data , function ( ) { modalDialogHelper . createModalEditDialog ( " Edit Edge " + a . _id , " control_event_edge_edit_ " , a . _data , function ( b ) { h . events . PATCHEDGE ( a , b , function ( ) { $ ( " # control_event_edge_edit_modal " ) . modal ( " hide " ) } ) ( ) } ) } ) } ; r . nodes . view = a , r . edges . view = b } , u = function ( ) { var a = h . events . STARTCREATEEDGE ( function ( a , b ) { var d = q ( b ) , e = c . addAnEdgeFollowingTheCursor ( d . x , d . y ) ; h . bind ( " svg " , " mousemove " , function ( a ) { var b = q ( a ) ; e ( b . x , b . y ) } ) } ) , b = h . events . FINISHCREATEEDGE ( function ( a ) { c . removeCursorFollowingEdge ( ) , h . bind ( " svg " , " mousemove " , function ( ) { return void 0 } ) , d ( ) } ) , e = function ( ) { h . events . CANCELCREATEEDGE ( ) , c . removeCursorFollowingEdge ( ) , h . bind ( " svg " , " mousemove " , function ( ) { return void 0 } ) } ; r . nodes . startEdge = a , r . nodes . endEdge = b , r . svg . cancelEdge = e } , v = function ( ) { var a = function ( a ) { arangoHelper . openDocEditor ( a . _id , " document " ) } , b = function ( a ) { arangoHelper . openDocEditor ( a . _id , " edge " ) } ; r . nodes . edit = a , r . edges . edit = b } , w = function ( ) { var a = function ( a ) { modalDialogHelper . createModalDeleteDialog ( " Delete Node " + a . _id , " control_event_node_delete_ " , a , function ( a ) { h . events . DELETENODE ( function ( ) { $ ( " # control_event_node_delete_modal " ) . modal ( " hide " ) , b . reshapeNodes ( ) , c . reshapeEdges ( ) , d ( ) } ) ( a ) } ) } , e = function ( a ) { modalDialogHelper . createModalDeleteDialog ( " Delete Edge " + a . _id , " control_event_edge_delete_ " , a , function ( a ) { h . events . DELETEEDGE ( function ( ) { $ ( " # control_event_edge_delete_modal " ) . modal ( " hide " ) , b . reshapeNodes ( ) , c . reshapeEdges ( ) , d ( ) } ) ( a ) } ) } ; r . nodes . del = a , r . edges . del = e } , x = function ( ) { r . nodes . spot = h . events . EXPAND } ; s ( ) , t ( ) , u ( ) , v ( ) , w ( ) , x ( ) , this . dragRebinds = function ( ) { return { nodes : { drag : h . events . DRAG } } } , this . newNodeRebinds = function ( ) { return { svg : { click : r . nodes . newNode } } } , this . viewRebinds = function ( ) { return { nodes : { click : r . nodes . view } , edges : { click : r . edges . view } } } , this . connectNodesRebinds = function ( ) { return { nodes : { mousedown : r . nodes . startEdge , mouseup : r . nodes . endEdge } , svg : { mouseup : r . svg . cancelEdge } } } , this . editRebinds = function ( ) { return { nodes : { click : r . nodes . edit } , edges : { click : r . edges . edit } } } , this . expandRebinds = function ( ) { return { nodes : { click : r . nodes . spot } } } , this . deleteRebinds = function ( ) { return { nodes : { click : r . nodes . del } , edges : { click : r . edges . del } } } , this . rebindAll = function ( a ) { m ( a . nodes ) , n ( a . edges ) , o ( a . svg ) } , b . addMenuEntry ( " Edit " , r . nodes . edit ) , b . addMenuEntry ( " Spot " , r . nodes . spot ) , b . addMenuEntry ( " Trash " , r . nodes . del ) , c . addMenuEntry ( " Edit " , r . edges . edit ) , c . addMenuEntry ( " Trash " , r . edges . del ) , this . addControlNewNode = function ( ) { var a = g . add , b = " select_node_collection " , c = function ( ) { j & & i . getNodeCollections ( ) . length > 1 & & modalDialogHelper . createModalDialog ( " Select Vertex Collection " , b , [ { type : " list " , id : " vertex " , objects : i . getNodeCollections ( ) , text : " Select collection " , selected : i . getSelectedNodeCollection ( ) } ] , function ( ) { var a = $ ( " # " + b + " vertex " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) ; i . useNodeCollection ( a ) } , " Select " ) , f . rebindAll ( f . newNodeRebinds ( ) ) } ; l ( a , " new_node " , c ) } , this . addControlView = function ( ) { var a = g . view , b = function ( ) { f . rebindAll ( f . viewRebinds ( ) ) } ; l ( a , " view " , b ) } , this . addControlDrag = function ( ) { var a = g . drag , b = function ( ) { f . rebindAll ( f . dragRebinds ( ) ) } ; l ( a , " drag " , b ) } , this . addControlEdit = function ( ) { var a = g . edit , b = function ( ) { f . rebindAll ( f . editRebinds ( ) ) } ; l ( a , " edit " , b ) } , this . addControlExpand = function ( ) { var a = g . expand , b = function ( ) { f . rebindAll ( f . expandRebinds ( ) ) } ; l ( a , " expand " , b ) } , this . addControlDelete = function ( ) { var a = g . trash , b = function ( ) { f . rebindAll ( f . deleteRebinds ( ) ) } ; l ( a , " delete " , b ) } , this . addControlConnect = function ( ) { var a = g . edge , b = " select_edge_collection " , c = function ( ) { j & & i . getEdgeCollections ( ) . length > 1 & & modalDialogHelper . createModalDialog ( " Select Edge Collection " , b , [ { type : " list " , id : " edge " , objects : i . getEdgeCollections ( ) , text : " Select collection " , selected : i . getSelectedEdgeCollection ( ) } ] , function ( ) { var a = $ ( " # " + b + " edge " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) ; i . useEdgeCollection ( a ) } , " Select " ) , f . rebindAll ( f . connectNodesRebinds ( ) ) } ; l ( a , " connect " , c ) } , this . addAll = function ( ) { f . addControlExpand ( ) , f . addControlDrag ( ) , f . addControlEdit ( ) , f . addControlConnect ( ) , f . addControlNewNode ( ) , f . addControlDelete ( ) } } function GharialAdapterControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The GharialAdapter has to be given . " ; this . addControlChangeGraph = function ( c ) { var d = " control_adapter_graph " , e = d + " _ " ; b . getGraphs ( function ( f ) { uiComponentsHelper . createButton ( a , " Switch Graph " , d , function ( ) { modalDialogHelper . createModalDialog ( " Switch Graph " , e , [ { type : " list " , id : " graph " , objects : f , text : " Select graph " , selected : b . getGraphName ( ) } , { type : " checkbox " , text : " Start with random vertex " , id : " random " , selected : ! 0 } ] , function ( ) { var a = $ ( " # " + e + " graph " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , d = ! ! $ ( " # " + e + " undirected " ) . prop ( " checked " ) , f = ! ! $ ( " # " + e + " random " ) . prop ( " checked " ) ; return b . changeToGraph ( a , d ) , f ? void b . loadRandomNode ( c ) : void ( _ . isFunction ( c ) & & c ( ) ) } ) } ) } ) } , this . addControlChangePriority = function ( ) { var c = " control_adapter_priority " , d = c + " _ " , e = " Group vertices " ; uiComponentsHelper . createButton ( a , e , c , function ( ) { modalDialogHelper . createModalChangeDialog ( e + " by attribute " , d , [ { type : " extendable " , id : " attribute " , objects : b . getPrioList ( ) } ] , function ( ) { var a = $ ( " input [ id ^ = " + d + " attribute_ ] " ) , c = [ ] ; _ . each ( a , function ( a ) { var b = $ ( a ) . val ( ) ; " " ! = = b & & c . push ( b ) } ) , b . changeTo ( { prioList : c } ) } ) } ) } , this . addAll = function ( ) { this . addControlChangeGraph ( ) , this . addControlChangePriority ( ) } } function GraphViewerPreview ( a , b ) { " use strict " ; var c , d , e , f , g , h , i , j = function ( ) { return d3 . select ( a ) . append ( " svg " ) . attr ( " id " , " graphViewerSVG " ) . attr ( " width " , d ) . attr ( " height " , e ) . attr ( " class " , " graph - viewer " ) . attr ( " style " , " width : " + d + " px ; height : " + e + " ; " ) } , k = function ( a ) { var b = 0 ; return _ . each ( a , function ( c , d ) { c = = = ! 1 ? delete a [ d ] : b + + } ) , b > 0 } , l = function ( a , b ) { _ . each ( b , function ( b , c ) { a [ c ] = a [ c ] | | { } , _ . each ( b , function ( b , d ) { a [ c ] [ d ] = b } ) } ) } , m = function ( a ) { if ( a ) { var b = { } ; a . drag & & l ( b , i . dragRebinds ( ) ) , a . create & & ( l ( b , i . newNodeRebinds ( ) ) , l ( b , i . connectNodesRebinds ( ) ) ) , a . remove & & l ( b , i . deleteRebinds ( ) ) , a . expand & & l ( b , i . expandRebinds ( ) ) , a . edit & & l ( b , i . editRebinds ( ) ) , i . rebindAll ( b ) } } , n = function ( b ) { var c = document . createElement ( " div " ) ; i = new EventDispatcherControls ( c , f . nodeShaper , f . edgeShaper , f . start , f . dispatcherConfig ) , c . id = " toolbox " , c . className = " btn - group btn - group - vertical pull - left toolbox " , a . appendChild ( c ) , _ . each ( b , function ( a , b ) { switch ( b ) { case " expand " : i . addControlExpand ( ) ; break ; case " create " : i . addControlNewNode ( ) , i . addControlConnect ( ) ; break ; case " drag " : i . addControlDrag ( ) ; break ; case " edit " : i . addControlEdit ( ) ; break ; case " remove " : i . addControlDelete ( ) } } ) } , o = function ( a ) { var b = document . createElement ( " div " ) ; i = new EventDispatcherControls ( b , f . nodeShaper , f . edgeShaper , f . start , f . dispatcherConfig ) } , p = function ( ) { b & & ( b . nodeShaper & & ( b . nodeShaper . label & & ( b . nodeShaper . label = " label " ) , b . nodeShaper . shape & & b . nodeShaper . shape . type = = = NodeShaper . shapes . IMAGE & & b . nodeShaper . shape . source & & ( b . nodeShaper . shape . source = " image " ) ) , b . edgeShaper & & b . edgeShaper . label & & ( b . edgeShaper . label = " label " ) ) } , q = function ( ) { return p ( ) , new GraphViewer ( c , d , e , h , b ) } ; d = a . getBoundingClientRect ( ) . width , e = a . getBoundingClientRect ( ) . height , h = { type : " preview " } , b = b | | { } , g = k ( b . toolbox ) , g & & ( d - = 43 ) , c = j ( ) , f = q ( ) , g ? n ( b . toolbox ) : o ( ) , f . loadGraph ( " 1 " ) , m ( b . actions ) } function GraphViewerUI ( a , b , c , d , e , f ) { " use strict " ; if ( void 0 = = = a ) throw " A parent element has to be given . " ; if ( ! a . id ) throw " The parent element needs an unique id . " ; if ( void 0 = = = b ) throw " An adapter configuration has to be given " ; var g , h , i , j , k , l , m , n , o , p = c + 20 | | a . getBoundingClientRect ( ) . width - 81 + 20 , q = d | | a . getBoundingClientRect ( ) . height , r = document . createElement ( " ul " ) , s = document . createElement ( " div " ) , t = function ( ) { g . adapter . NODES_TO_DISPLAY < g . adapter . TOTAL_NODES & & ( $ ( " . headerBar " ) . append ( ' < div class = " infoField " > Graph too big . A random section is rendered . < div class = " fa fa - info - circle " > < / div > < / div > ' ) , $ ( " . infoField . fa - info - circle " ) . attr ( " title " , " You can display additional / other vertices by using the toolbar buttons . " ) . tooltip ( ) ) } , u = function ( ) { var a , b = document . createElement ( " div " ) , c = document . createElement ( " div " ) , d = document . createElement ( " div " ) , e = document . createElement ( " div " ) , f = document . createElement ( " button " ) , h = document . createElement ( " span " ) , i = document . createElement ( " input " ) , j = document . createElement ( " i " ) , k = document . createElement ( " span " ) , l = function ( ) { $ ( s ) . css ( " cursor " , " progress " ) } , n = function ( ) { $ ( s ) . css ( " cursor " , " " ) } , o = function ( a ) { return n ( ) , a & & a . errorCode & & 404 = = = a . errorCode ? void arangoHelper . arangoError ( " Graph error " , " could not find a matching node . " ) : void 0 } , p = function ( ) { l ( ) , " " = = = a . value | | void 0 = = = a . value ? g . loadGraph ( i . value , o ) : g . loadGraphWithAttributeValue ( a . value , i . value , o ) } ; b . id = " filterDropdown " , b . className = " headerDropdown smallDropdown " , c . className = " dropdownInner " , d . className = " queryline " , a = document . createElement ( " input " ) , m = document . createElement ( " ul " ) , e . className = " pull - left input - append searchByAttribute " , a . id = " attribute " , a . type = " text " , a . placeholder = " Attribute name " , f . id = " attribute_example_toggle " , f . className = " button - neutral gv_example_toggle " , h . className = " caret gv_caret " , m . className = " gv - dropdown - menu " , i . id = " value " , i . className = " searchInput gv_searchInput " , i . type = " text " , i . placeholder = " Attribute value " , j . id = " loadnode " , j . className = " fa fa - search " , k . className = " searchEqualsLabel " , k . appendChild ( document . createTextNode ( " = = " ) ) , c . appendChild ( d ) , d . appendChild ( e ) , e . appendChild ( a ) , e . appendChild ( f ) , e . appendChild ( m ) , f . appendChild ( h ) , d . appendChild ( k ) , d . appendChild ( i ) , d . appendChild ( j ) , j . onclick = p , $ ( i ) . keypress ( function ( a ) { return 13 = = = a . keyCode | | 13 = = = a . which ? ( p ( ) , ! 1 ) : void 0 } ) , f . onclick = function ( ) { $ ( m ) . slideToggle ( 200 ) } ; var q = document . createElement ( " p " ) ; return q . className = " dropdown - title " , q . innerHTML = " Filter graph by attribute : " , b . appendChild ( q ) , b . appendChild ( c ) , b } , v = function ( ) { var a , b = document . createElement ( " div " ) , c = document . createElement ( " div " ) , d = document . createElement ( " div " ) , e = document . createElement ( " div " ) , f = document . createElement ( " button " ) , h = document . createElement ( " span " ) , i = document . createElement ( " input " ) , j = document . createElement ( " i " ) , k = document . createElement ( " span " ) , l = function ( ) { $ ( s ) . css ( " cursor " , " progress " ) } , m = function ( ) { $ ( s ) . css ( " cursor " , " " ) } , o = function ( a ) { return m ( ) , a & & a . errorCode & & 404 = = = a . errorCode ? void arangoHelper . arangoError ( " Graph error " , " could not find a matching node . " ) : void 0 } , p = function ( ) { l ( ) , " " ! = = a . value & & g . loadGraphWithAdditionalNode ( a . value , i . value , o ) } ; b . id = " nodeDropdown " , b . className = " headerDropdown smallDropdown " , c . className = " dropdownInner " , d . className = " queryline " , a = document . createElement ( " input " ) , n = document . createElement ( " ul " ) , e . className = " pull - left input - append searchByAttribute " , a . id = " attribute " , a . type = " text " , a . placeholder = " Attribute name " , f . id = " attribute_example_toggle2 " , f . className = " button - neutral gv_example_toggle " , h . className = " caret gv_caret " , n . className = " gv - dropdown - menu " , i . id = " value " , i . className = " searchInput gv_searchInput " , i . type = " text " , i . placeholder = " Attribute value " , j . id = " loadnode " , j . className = " fa fa - search " , k . className = " searchEqualsLabel " , k . appendChild ( document . createTextNode ( " = = " ) ) , c . appendChild ( d ) , d . appendChild ( e ) , e . appendChild ( a ) , e . appendChild ( f ) , e . appendChild ( n ) , f . appendChild ( h ) , d . appendChild ( k ) , d . appendChild ( i ) , d . appendChild ( j ) , C ( n ) , j . onclick = p , $ ( i ) . keypress ( function ( a ) { return 13 = = = a . keyCode | | 13 = = = a . which ? ( p ( ) , ! 1 ) : void 0 } ) , f . onclick = function ( ) { $ ( n ) . slideToggle ( 200 ) } ; var q = document . createElement ( " p " ) ; return q . className = " dropdown - title " , q . innerHTML = " Add specific node by attribute : " , b . appendChild ( q ) , b . appendChild ( c ) , b } , w = function ( ) { var a , b , c , d , e , f , g , h ; return a = document . createElement ( " div " ) , a . id = " configureDropdown " , a . className = " headerDropdown " , b = document . createElement ( " div " ) , b . className = " dropdownInner " , c = document . createElement ( " ul " ) , d = document . createElement ( " li " ) , d . className = " nav - header " , d . appendChild ( document . createTextNode ( " Vertices " ) ) , g = document . createElement ( " ul " ) , h = document . createElement ( " li " ) , h . className = " nav - header " , h . appendChild ( document . createTextNode ( " Edges " ) ) , e = document . createElement ( " ul " ) , f = document . createElement ( " li " ) , f . className = " nav - header " , f . appendChild ( document . createTextNode ( " Connection " ) ) , c . appendChild ( d ) , g . appendChild ( h ) , e . appendChild ( f ) , b . appendChild ( c ) , b . appendChild ( g ) , b . appendChild ( e ) , a . appendChild ( b ) , { configure : a , nodes : c , edges : g , col : e } } , x = function ( a , b , c , d ) { var e , f , g , h , i , j , k , l , m , n , o ; return a . className = " headerButtonBar " , e = document . createElement ( " ul " ) , e . className = " headerButtonList " , a . appendChild ( e ) , g = document . createElement ( " li " ) , g . className = " enabled " , h = document . createElement ( " a " ) , h . id = b , h . className = " headerButton " , i = document . createElement ( " span " ) , i . className = " icon_arangodb_settings2 " , $ ( i ) . attr ( " title " , " Configure " ) , e . appendChild ( g ) , g . appendChild ( h ) , h . appendChild ( i ) , j = document . createElement ( " li " ) , j . className = " enabled " , k = document . createElement ( " a " ) , k . id = d , k . className = " headerButton " , l = document . createElement ( " span " ) , l . className = " fa fa - search - plus " , $ ( l ) . attr ( " title " , " Show additional vertices " ) , e . appendChild ( j ) , j . appendChild ( k ) , k . appendChild ( l ) , m = document . createElement ( " li " ) , m . className = " enabled " , n = document . createElement ( " a " ) , n . id = c , n . className = " headerButton " , o = document . createElement ( " span " ) , o . className = " icon_arangodb_filter " , $ ( o ) . attr ( " title " , " Filter " ) , e . appendChild ( m ) , m . appendChild ( n ) , n . appendChild ( o ) , f = w ( ) , f . filter = u ( ) , f . node = v ( ) , h . onclick = function ( ) { $ ( " # filterdropdown " ) . removeClass ( " activated " ) , $ ( " # nodedropdown " ) . removeClass ( " activated " ) , $ ( " # configuredropdown " ) . toggleClass ( " activated " ) , $ ( f . configure ) . slideToggle ( 200 ) , $ ( f . filter ) . hide ( ) , $ ( f . node ) . hide ( ) } , k . onclick = function ( ) { $ ( " # filterdropdown " ) . removeClass ( " activated " ) , $ ( " # configuredropdown " ) . removeClass ( " activated " ) , $ ( " # nodedropdown " ) . toggleClass ( " activated " ) , $ ( f . node ) . slideToggle ( 200 ) , $ ( f . filter ) . hide ( ) , $ ( f . configure ) . hide ( ) } , n . onclick = function ( ) { $ ( " # configuredropdown " ) . removeClass ( " activated " ) , $ ( " # nodedropdown " ) . removeClass ( " activated " ) , $ ( " # filterdropdown " ) . toggleClass ( " activated " ) , $ ( f . filter ) . slideToggle ( 200 ) , $ ( f . node ) . hide ( ) , $ ( f . configure ) . hide ( ) } , f } , y = function ( ) { return console . log ( q ) , d3 . select ( " # " + a . id + " # background " ) . append ( " svg " ) . attr ( " id " , " graphViewerSVG " ) . attr ( " width " , p ) . attr ( " height " , q ) . attr ( " class " , " graph - viewer " ) . style ( " width " , p + " px " ) . style ( " height " , q + " px " ) } , z = function ( ) { var a = document . createElement ( " div " ) , b = document . createElement ( " div " ) , c = document . createElement ( " button " ) , d = document . createElement ( " button " ) , e = document . createElement ( " button " ) , f = document . createElement ( " button " ) ; a . className = " gv_zoom_widget " , b . className = " gv_zoom_buttons_bg " , c . className = " btn btn - icon btn - zoom btn - zoom - top gv - zoom - btn pan - top " , d . className = " btn btn - icon btn - zoom btn - zoom - left gv - zoom - btn pan - left " , e . className = " btn btn - icon btn - zoom btn - zoom - right gv - zoom - btn pan - right " , f . className = " btn btn - icon btn - zoom btn - zoom - bottom gv - zoom - btn pan - bottom " , c . onclick = function ( ) { g . zoomManager . triggerTranslation ( 0 , - 10 ) } , d . onclick = function ( ) { g . zoomManager . triggerTranslation ( - 10 , 0 ) } , e . onclick = function ( ) { g . zoomManager . triggerTranslation ( 10 , 0 ) } , f . onclick = function ( ) { g . zoomManager . triggerTranslation ( 0 , 10 ) } , b . appendChild ( c ) , b . appendChild ( d ) , b . appendChild ( e ) , b . appendChild ( f ) , l = document . createElement ( " div " ) , l . id = " gv_zoom_slider " , l . className = " gv_zoom_slider " , s . appendChild ( a ) , s . insertBefore ( a , o [ 0 ] [ 0 ] ) , a . appendChild ( b ) , a . appendChild ( l ) , $ ( " # gv_zoom_slider " ) . slider ( { orientation : " vertical " , min : g . zoomManager . getMinimalZoomFactor ( ) , max : 1 , value : 1 , step : . 01 , slide : function ( a , b ) { g . zoomManager . triggerScale ( b . value ) } } ) , g . zoomManager . registerSlider ( $ ( " # gv_zoom_slider " ) ) } , A = function ( ) { var a = document . createElement ( " div " ) , b = new EventDispatcherControls ( a , g . nodeShaper , g . edgeShaper , g . start , g . dispatcherConfig ) ; a . id = " toolbox " , a . className = " btn - group btn - group - vertical toolbox " , s . insertBefore ( a , o [ 0 ] [ 0 ] ) , b . addAll ( ) , $ ( " # control_event_expand " ) . click ( ) } , B = function ( ) { var a = ' < li class = " enabled " style = " float : right " > < select id = " graphSize " class = " documents - size " > < optgroup label = " Starting points : " > < option value = " 5 " selected = " " > 5 vertices < / option > < option value = " 10 " > 10 vertices < / option > < option value = " 20 " > 20 vertices < / option > < option value = " 50 " > 50 vertices < / option > < option value = " 100 " > 100 vertices < / option > < option value = " 500 " > 500 vertices < / option > < option value = " 1000 " > 1000 vertices < / option > < option value = " 2500 " > 2500 vertices < / option > < option value = " 5000 " > 5000 vertices < / option > < option value = " all " > All vertices < / option > < / select > < / optgroup > < / li > ' ; $ ( " . headerBar . headerButtonList " ) . prepend ( a ) } , C = function ( a ) { var b ; b = a ? $ ( a ) : $ ( m ) , b . innerHTML = " " ; var c = document . createElement ( " li " ) , d = document . createElement ( " img " ) ; $ ( c ) . append ( d ) , d . className = " gv - throbber " , b . append ( c ) , g . adapter . getAttributeExamples ( function ( a ) { $ ( b ) . html ( " " ) , _ . each ( a , function ( a ) { var c = document . createElement ( " li " ) , d = document . createElement ( " a " ) , e = document . createElement ( " label " ) ; $ ( c ) . append ( d ) , $ ( d ) . append ( e ) , $ ( e ) . append ( document . createTextNode ( a ) ) , e . className = " gv_dropdown_label " , b . append ( c ) , c . onclick = function ( ) { b . value = a , $ ( b ) . parent ( ) . find ( " input " ) . val ( a ) , $ ( b ) . slideToggle ( 200 ) } } ) } ) } , D = function ( ) { var a = document . createElement ( " div " ) , b = document . createElement ( " div " ) , c = ( document . createElement ( " a " ) , x ( b , " configuredropdown " , " filterdropdown " , " nodedropdown " ) ) ; i = new NodeShaperControls ( c . nodes , g . nodeShaper ) , j = new EdgeShaperControls ( c . edges , g . edgeShaper ) , k = new GharialAdapterControls ( c . col , g . adapter ) , r . id = " menubar " , a . className = " headerBar " , b . id = " modifiers " , r . appendChild ( a ) , r . appendChild ( c . configure ) , r . appendChild ( c . filter ) , r . appendChild ( c . node ) , a . appendChild ( b ) , k . addControlChangeGraph ( function ( ) { C ( ) , g . start ( ! 0 ) } ) , k . addControlChangePriority ( ) , i . addControlOpticLabelAndColourList ( g . adapter ) , j . addControlOpticLabelList ( ) , C ( ) } , E = function ( ) { h = i . createColourMappingList ( ) , h . className = " gv - colour - list " , s . insertBefore ( h , o [ 0 ] [ 0 ] ) } ; a . appendChild ( r ) , a . appendChild ( s ) , s . className = " contentDiv gv - background " , s . id = " background " , e = e | | { } , e . zoom = ! 0 , o = y ( ) , " undefined " ! = = Storage & & ( this . graphSettings = { } , this . loadLocalStorage = function ( ) { var a = b . baseUrl . split ( " / " ) [ 2 ] , c = b . graphName + a ; if ( null = = = localStorage . getItem ( " graphSettings " ) | | " null " = = = localStorage . getItem ( " graphSettings " ) ) { var d = { } ; d [ c ] = { viewer : e , adapter : b } , localStorage . setItem ( " graphSettings " , JSON . stringify ( d ) ) } else try { var f = JSON . parse ( localStorage . getItem ( " graphSettings " ) ) ; this . graphSettings = f , void 0 ! = = f [ c ] . viewer & & ( e = f [ c ] . viewer ) , void 0 ! = = f [ c ] . adapter & & ( b = f [ c ] . adapter ) } catch ( g ) { console . log ( " Could not load graph settings , resetting graph settings . " ) , this . graphSettings [ c ] = { viewer : e , adapter : b } , localStorage . setItem ( " graphSettings " , JSON . stringify ( this . graphSettings ) ) } } , this . loadLocalStorage ( ) , this . writeLocalStorage = function ( ) { } ) , g = new GraphViewer ( o , p , q , b , e ) , A ( ) , z ( ) , D ( ) , E ( ) , t ( ) , B ( ) , $ ( " # graphSize " ) . on ( " change " , function ( ) { var a = $ ( " # graphSize " ) . find ( " : selected " ) . val ( ) ; g . loadGraphWithRandomStart ( function ( a ) { a & & a . errorCode & & arangoHelper . arangoError ( " Graph " , " Sorry your graph seems to be empty " ) } , a ) } ) , f & & ( " string " = = typeof f ? g . loadGraph ( f ) : g . loadGraphWithRandomStart ( function ( a ) { a & & a . errorCode & & arangoHelper . arangoError ( " Graph " , " Sorry your graph seems to be empty " ) } ) ) , this . changeWidth = function ( a ) { g . changeWidth ( a ) ; var b = a - 55 ; o . attr ( " width " , b ) . style ( " width " , b + " px " ) } } function GraphViewerWidget ( a , b ) { " use strict " ; var c , d , e , f , g , h , i , j , k = function ( ) { return d3 . select ( d ) . append ( " svg " ) . attr ( " id " , " graphViewerSVG " ) . attr ( " width " , e ) . attr ( " height " , f ) . attr ( " class " , " graph - viewer " ) . attr ( " style " , " width : " + e + " px ; height : " + f + " px ; " ) } , l = function ( a ) { var b = 0 ; return _ . each ( a , function ( c , d ) { c = = = ! 1 ? delete a [ d ] : b + + } ) , b > 0 } , m = function ( a , b ) { _ . each ( b , function ( b , c ) { a [ c ] = a [ c ] | | { } , _ . each ( b , function ( b , d ) { a [ c ] [ d ] = b } ) } ) } , n = function ( a ) { if ( a ) { var b = { } ; a . drag & & m ( b , j . dragRebinds ( ) ) , a . create & & ( m ( b , j . newNodeRebinds ( ) ) , m ( b , j . connectNodesRebinds ( ) ) ) , a . remove & & m ( b , j . deleteRebinds ( ) ) , a . expand & & m ( b , j . expandRebinds ( ) ) , a . edit & & m ( b , j . editRebinds ( ) ) , j . rebindAll ( b ) } } , o = function ( a ) { var b = document . createElement ( " div " ) ; j = new EventDispatcherControls ( b , g . nodeShaper , g . edgeShaper , g . start , g . dispatcherConfig ) , b . id = " toolbox " , b . className = " btn - group btn - group - vertical pull - left toolbox " , d . appendChild ( b ) , _ . each ( a , function ( a , b ) { switch ( b ) { case " expand " : j . addControlExpand ( ) ; break ; case " create " : j . addControlNewNode ( ) , j . addControlConnect ( ) ; break ; case " drag " : j . addControlDrag ( ) ; break ; case " edit " : j . addControlEdit ( ) ; break ; case " remove " : j . addControlDelete ( ) } } ) } , p = function ( a ) { var b = document . createElement ( " div " ) ; j = new EventDispatcherControls ( b , g . nodeShaper , g . edgeShaper , g . start , g . dispatcherConfig ) } , q = function ( ) { return new GraphViewer ( c , e , f , i , a ) } ; d = document . body , e = d . getBoundingClientRect ( ) . width , f = d . getBoundingClientRect ( ) . height , i = { type : " foxx " , route : " . " } , a = a | | { } , h = l ( a . toolbox ) , h & & ( e - = 43 ) , c = k ( ) , g = q ( ) , h ? o ( a . toolbox ) : p ( ) , b & & g . loadGraph ( b ) , n ( a . actions ) } function LayouterControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The Layouter has to be given . " ; var c = this ; this . addControlGravity = function ( ) { var c = " control_layout_gravity " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Gravity " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Gravity Strength " , d , [ { type : " text " , id : " value " } ] , function ( ) { var a = $ ( " # " + d + " value " ) . attr ( " value " ) ; b . changeTo ( { gravity : a } ) } ) } ) } , this . addControlCharge = function ( ) { var c = " control_layout_charge " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Charge " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Charge Strength " , d , [ { type : " text " , id : " value " } ] , function ( ) { var a = $ ( " # " + d + " value " ) . attr ( " value " ) ; b . changeTo ( { charge : a } ) } ) } ) } , this . addControlDistance = function ( ) { var c = " control_layout_distance " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Distance " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Distance Strength " , d , [ { type : " text " , id : " value " } ] , function ( ) { var a = $ ( " # " + d + " value " ) . attr ( " value " ) ; b . changeTo ( { distance : a } ) } ) } ) } , this . addAll = function ( ) { c . addControlDistance ( ) , c . addControlGravity ( ) , c . addControlCharge ( ) } } function NodeShaperControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The NodeShaper has to be given . " ; var c , d = this , e = function ( a ) { for ( ; c . hasChildNodes ( ) ; ) c . removeChild ( c . lastChild ) ; var b = document . createElement ( " ul " ) ; c . appendChild ( b ) , _ . each ( a , function ( a , c ) { var d = document . createElement ( " ul " ) , e = a . list , f = a . front ; d . style . backgroundColor = c , d . style . color = f , _ . each ( e , function ( a ) { var b = document . createElement ( " li " ) ; b . appendChild ( document . createTextNode ( a ) ) , d . appendChild ( b ) } ) , b . appendChild ( d ) } ) } ; this . addControlOpticShapeNone = function ( ) { uiComponentsHelper . createButton ( a , " None " , " control_node_none " , function ( ) { b . changeTo ( { shape : { type : NodeShaper . shapes . NONE } } ) } ) } , this . applyLocalStorage = function ( a ) { if ( " undefined " ! = = Storage ) try { var b = JSON . parse ( localStorage . getItem ( " graphSettings " ) ) , c = window . location . hash . split ( " / " ) [ 1 ] , d = window . location . pathname . split ( " / " ) [ 2 ] , e = c + d ; _ . each ( a , function ( a , c ) { void 0 ! = = c & & ( b [ e ] . viewer . nodeShaper [ c ] = a ) } ) , localStorage . setItem ( " graphSettings " , JSON . stringify ( b ) ) } catch ( f ) { console . log ( f ) } } , this . addControlOpticShapeCircle = function ( ) { var c = " control_node_circle " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Circle " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Circle " , d , [ { type : " text " , id : " radius " } ] , function ( ) { var a = $ ( " # " + d + " radius " ) . attr ( " value " ) ; b . changeTo ( { shape : { type : NodeShaper . shapes . CIRCLE , radius : a } } ) } ) } ) } , this . addControlOpticShapeRect = function ( ) { var c = " control_node_rect " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Rectangle " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Rectangle " , " control_node_rect_ " , [ { type : " text " , id : " width " } , { type : " text " , id : " height " } ] , function ( ) { var a = $ ( " # " + d + " width " ) . attr ( " value " ) , c = $ ( " # " + d + " height " ) . attr ( " value " ) ; b . changeTo ( { shape : { type : NodeShaper . shapes . RECT , width : a , height : c } } ) } ) } ) } , this . addControlOpticLabel = function ( ) { var c = " control_node_label " , e = c + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , c , function ( ) { modalDialogHelper . createModalChangeDialog ( " Change label attribute " , e , [ { type : " text " , id : " key " } ] , function ( ) { var a = $ ( " # " + e + " key " ) . attr ( " value " ) , c = { label : a } ; d . applyLocalStorage ( c ) , b . changeTo ( c ) } ) } ) } , this . addControlOpticSingleColour = function ( ) { var c = " control_node_singlecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Single Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Colour " , d , [ { type : " text " , id : " fill " } , { type : " text " , id : " stroke " } ] , function ( ) { var a = $ ( " # " + d + " fill " ) . attr ( " value " ) , c = $ ( " # " + d + " stroke " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " single " , fill : a , stroke : c } } ) } ) } ) } , this . addControlOpticAttributeColour = function ( ) { var c = " control_node_attributecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Colour by Attribute " , c , function ( ) { modalDialogHelper . createModalDialog ( " Display colour by attribute " , d , [ { type : " text " , id : " key " } ] , function ( ) { var a = $ ( " # " + d + " key " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " attribute " , key : a } } ) } ) } ) } , this . addControlOpticExpandColour = function ( ) { var c = " control_node_expandcolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Expansion Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Display colours for expansion " , d , [ { type : " text " , id : " expanded " } , { <nl> - type : " text " , id : " collapsed " } ] , function ( ) { var a = $ ( " # " + d + " expanded " ) . attr ( " value " ) , c = $ ( " # " + d + " collapsed " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " expand " , expanded : a , collapsed : c } } ) } ) } ) } , this . addControlOpticLabelAndColour = function ( e ) { var f = " control_node_labelandcolour " , g = f + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , f , function ( ) { modalDialogHelper . createModalChangeDialog ( " Change label attribute " , g , [ { type : " text " , id : " label - attribute " , text : " Vertex label attribute " , value : b . getLabel ( ) | | " " } , { type : " decission " , id : " samecolour " , group : " colour " , text : " Use this attribute for coloring , too " , isDefault : b . getLabel ( ) = = = b . getColor ( ) } , { type : " decission " , id : " othercolour " , group : " colour " , text : " Use different attribute for coloring " , isDefault : b . getLabel ( ) ! = = b . getColor ( ) , interior : [ { type : " text " , id : " colour - attribute " , text : " Color attribute " , value : b . getColor ( ) | | " " } ] } ] , function ( ) { var a = $ ( " # " + g + " label - attribute " ) . attr ( " value " ) , e = $ ( " # " + g + " colour - attribute " ) . attr ( " value " ) , f = $ ( " input [ type = ' radio ' ] [ name = ' colour ' ] : checked " ) . attr ( " id " ) ; f = = = g + " samecolour " & & ( e = a ) ; var h = { label : a , color : { type : " attribute " , key : e } } ; d . applyLocalStorage ( h ) , b . changeTo ( h ) , void 0 = = = c & & ( c = d . createColourMappingList ( ) ) } ) } ) } , this . addControlOpticLabelAndColourList = function ( e ) { var f = " control_node_labelandcolourlist " , g = f + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , f , function ( ) { modalDialogHelper . createModalChangeDialog ( " Change label attribute " , g , [ { type : " extendable " , id : " label " , text : " Vertex label attribute " , objects : b . getLabel ( ) } , { type : " decission " , id : " samecolour " , group : " colour " , text : " Use this attribute for coloring , too " , isDefault : b . getLabel ( ) = = = b . getColor ( ) } , { type : " decission " , id : " othercolour " , group : " colour " , text : " Use different attribute for coloring " , isDefault : b . getLabel ( ) ! = = b . getColor ( ) , interior : [ { type : " extendable " , id : " colour " , text : " Color attribute " , objects : b . getColor ( ) | | " " } ] } ] , function ( ) { var a = $ ( " input [ id ^ = " + g + " label_ ] " ) , e = $ ( " input [ id ^ = " + g + " colour_ ] " ) , f = $ ( " input [ type = ' radio ' ] [ name = ' colour ' ] : checked " ) . attr ( " id " ) , h = [ ] , i = [ ] ; a . each ( function ( a , b ) { var c = $ ( b ) . val ( ) ; " " ! = = c & & h . push ( c ) } ) , e . each ( function ( a , b ) { var c = $ ( b ) . val ( ) ; " " ! = = c & & i . push ( c ) } ) , f = = = g + " samecolour " & & ( i = h ) ; var j = { label : h , color : { type : " attribute " , key : i } } ; d . applyLocalStorage ( j ) , b . changeTo ( j ) , void 0 = = = c & & ( c = d . createColourMappingList ( ) ) } ) } ) } , this . addAllOptics = function ( ) { d . addControlOpticShapeNone ( ) , d . addControlOpticShapeCircle ( ) , d . addControlOpticShapeRect ( ) , d . addControlOpticLabel ( ) , d . addControlOpticSingleColour ( ) , d . addControlOpticAttributeColour ( ) , d . addControlOpticExpandColour ( ) } , this . addAllActions = function ( ) { } , this . addAll = function ( ) { d . addAllOptics ( ) , d . addAllActions ( ) } , this . createColourMappingList = function ( ) { return void 0 ! = = c ? c : ( c = document . createElement ( " div " ) , c . id = " node_colour_list " , e ( b . getColourMapping ( ) ) , b . setColourMappingListener ( e ) , c ) } } function GraphViewer ( a , b , c , d , e ) { " use strict " ; if ( $ ( " html " ) . attr ( " xmlns : xlink " , " http : / / www . w3 . org / 1999 / xlink " ) , void 0 = = = a | | void 0 = = = a . append ) throw " SVG has to be given and has to be selected using d3 . select " ; if ( void 0 = = = b | | 0 > = b ) throw " A width greater 0 has to be given " ; if ( void 0 = = = c | | 0 > = c ) throw " A height greater 0 has to be given " ; if ( void 0 = = = d | | void 0 = = = d . type ) throw " An adapter configuration has to be given " ; var f , g , h , i , j , k , l , m , n = this , o = [ ] , p = [ ] , q = function ( a ) { if ( ! a ) return a = { } , a . nodes = p , a . links = o , a . width = b , a . height = c , void ( i = new ForceLayouter ( a ) ) ; switch ( a . type . toLowerCase ( ) ) { case " force " : a . nodes = p , a . links = o , a . width = b , a . height = c , i = new ForceLayouter ( a ) ; break ; default : throw " Sorry unknown layout type . " } } , r = function ( a ) { f . setNodeLimit ( a , n . start ) } , s = function ( d ) { d & & ( j = new ZoomManager ( b , c , a , k , g , h , { } , r ) ) } , t = function ( a ) { var b = a . edgeShaper | | { } , c = a . nodeShaper | | { } , d = c . idfunc | | void 0 , e = a . zoom | | ! 1 ; b . shape = b . shape | | { type : EdgeShaper . shapes . ARROW } , q ( a . layouter ) , m = k . append ( " g " ) , h = new EdgeShaper ( m , b ) , l = k . append ( " g " ) , g = new NodeShaper ( l , c , d ) , i . setCombinedUpdateFunction ( g , h ) , s ( e ) } ; switch ( d . type . toLowerCase ( ) ) { case " arango " : d . width = b , d . height = c , f = new ArangoAdapter ( p , o , this , d ) , f . setChildLimit ( 10 ) ; break ; case " gharial " : d . width = b , d . height = c , f = new GharialAdapter ( p , o , this , d ) , f . setChildLimit ( 10 ) ; break ; case " foxx " : d . width = b , d . height = c , f = new FoxxAdapter ( p , o , d . route , this , d ) ; break ; case " json " : f = new JSONAdapter ( d . path , p , o , this , b , c ) ; break ; case " preview " : d . width = b , d . height = c , f = new PreviewAdapter ( p , o , this , d ) ; break ; default : throw " Sorry unknown adapter type . " } k = a . append ( " g " ) , t ( e | | { } ) , this . start = function ( a ) { i . stop ( ) , a & & ( " " ! = = $ ( " . infoField " ) . text ( ) ? _ . each ( p , function ( a ) { _ . each ( f . randomNodes , function ( b ) { a . _id = = = b . _id & & ( a . _expanded = ! 0 ) } ) } ) : _ . each ( p , function ( a ) { a . _expanded = ! 0 } ) ) , g . drawNodes ( p ) , h . drawEdges ( o ) , i . start ( ) } , this . loadGraph = function ( a , b ) { f . loadInitialNode ( a , function ( a ) { return a . errorCode ? void b ( a ) : ( a . _expanded = ! 0 , n . start ( ) , void ( _ . isFunction ( b ) & & b ( ) ) ) } ) } , this . loadGraphWithRandomStart = function ( a , b ) { f . loadRandomNode ( function ( b ) { return b . errorCode & & 404 = = = b . errorCode ? void a ( b ) : ( b . _expanded = ! 0 , n . start ( ! 0 ) , void ( _ . isFunction ( a ) & & a ( ) ) ) } , b ) } , this . loadGraphWithAdditionalNode = function ( a , b , c ) { f . loadAdditionalNodeByAttributeValue ( a , b , function ( a ) { return a . errorCode ? void c ( a ) : ( a . _expanded = ! 0 , n . start ( ) , void ( _ . isFunction ( c ) & & c ( ) ) ) } ) } , this . loadGraphWithAttributeValue = function ( a , b , c ) { f . randomNodes = [ ] , f . definedNodes = [ ] , f . loadInitialNodeByAttributeValue ( a , b , function ( a ) { return a . errorCode ? void c ( a ) : ( a . _expanded = ! 0 , n . start ( ) , void ( _ . isFunction ( c ) & & c ( ) ) ) } ) } , this . cleanUp = function ( ) { g . resetColourMap ( ) , h . resetColourMap ( ) } , this . changeWidth = function ( a ) { i . changeWidth ( a ) , j . changeWidth ( a ) , f . setWidth ( a ) } , this . dispatcherConfig = { expand : { edges : o , nodes : p , startCallback : n . start , adapter : f , reshapeNodes : g . reshapeNodes } , drag : { layouter : i } , nodeEditor : { nodes : p , adapter : f } , edgeEditor : { edges : o , adapter : f } } , this . adapter = f , this . nodeShaper = g , this . edgeShaper = h , this . layouter = i , this . zoomManager = j } EdgeShaper . shapes = Object . freeze ( { NONE : 0 , ARROW : 1 } ) , NodeShaper . shapes = Object . freeze ( { NONE : 0 , CIRCLE : 1 , RECT : 2 , IMAGE : 3 } ) ; var modalDialogHelper = modalDialogHelper | | { } ; ! function ( ) { " use strict " ; var a , b = function ( a ) { $ ( document ) . bind ( " keypress . key13 " , function ( b ) { b . which & & 13 = = = b . which & & $ ( a ) . click ( ) } ) } , c = function ( ) { $ ( document ) . unbind ( " keypress . key13 " ) } , d = function ( a , b , c , d , e ) { var f , g , h = function ( ) { e ( f ) } , i = modalDialogHelper . modalDivTemplate ( a , b , c , h ) , j = document . createElement ( " tr " ) , k = document . createElement ( " th " ) , l = document . createElement ( " th " ) , m = document . createElement ( " th " ) , n = document . createElement ( " button " ) , o = 1 ; f = function ( ) { var a = { } ; return _ . each ( $ ( " # " + c + " table tr : not ( # first_row ) " ) , function ( b ) { var c = $ ( " . keyCell input " , b ) . val ( ) , d = $ ( " . valueCell input " , b ) . val ( ) ; a [ c ] = d } ) , a } , i . appendChild ( j ) , j . id = " first_row " , j . appendChild ( k ) , k . className = " keyCell " , j . appendChild ( l ) , l . className = " valueCell " , j . appendChild ( m ) , m . className = " actionCell " , m . appendChild ( n ) , n . id = c + " new " , n . className = " graphViewer - icon - button gv - icon - small add " , g = function ( a , b ) { var d , e , f , g = / ^ _ ( id | rev | key | from | to ) / , h = document . createElement ( " tr " ) , j = document . createElement ( " th " ) , k = document . createElement ( " th " ) , l = document . createElement ( " th " ) ; g . test ( b ) | | ( i . appendChild ( h ) , h . appendChild ( k ) , k . className = " keyCell " , e = document . createElement ( " input " ) , e . type = " text " , e . id = c + b + " _key " , e . value = b , k . appendChild ( e ) , h . appendChild ( l ) , l . className = " valueCell " , f = document . createElement ( " input " ) , f . type = " text " , f . id = c + b + " _value " , " object " = = typeof a ? f . value = JSON . stringify ( a ) : f . value = a , l . appendChild ( f ) , h . appendChild ( j ) , j . className = " actionCell " , d = document . createElement ( " button " ) , d . id = c + b + " _delete " , d . className = " graphViewer - icon - button gv - icon - small delete " , j . appendChild ( d ) , d . onclick = function ( ) { i . removeChild ( h ) } ) } , n . onclick = function ( ) { g ( " " , " new_ " + o ) , o + + } , _ . each ( d , g ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , e = function ( a , b , c , d , e ) { var f = modalDialogHelper . modalDivTemplate ( a , b , c , e ) , g = document . createElement ( " tr " ) , h = document . createElement ( " th " ) , i = document . createElement ( " pre " ) ; f . appendChild ( g ) , g . appendChild ( h ) , h . appendChild ( i ) , i . className = " gv - object - view " , i . innerHTML = JSON . stringify ( d , null , 2 ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , f = function ( a , b ) { var c = document . createElement ( " input " ) ; return c . type = " text " , c . id = a , c . value = b , c } , g = function ( a , b ) { var c = document . createElement ( " input " ) ; return c . type = " checkbox " , c . id = a , c . checked = b , c } , h = function ( a , b , c ) { var d = document . createElement ( " select " ) ; return d . id = a , _ . each ( _ . sortBy ( b , function ( a ) { return a . toLowerCase ( ) } ) , function ( a ) { var b = document . createElement ( " option " ) ; b . value = a , b . selected = a = = = c , b . appendChild ( document . createTextNode ( a ) ) , d . appendChild ( b ) } ) , d } , i = function ( a ) { var b = $ ( " . decission_ " + a ) , c = $ ( " input [ type = ' radio ' ] [ name = ' " + a + " ' ] : checked " ) . attr ( " id " ) ; b . each ( function ( ) { $ ( this ) . attr ( " decider " ) = = = c ? $ ( this ) . css ( " display " , " " ) : $ ( this ) . css ( " display " , " none " ) } ) } , j = function ( b , c , d , e , f , g , h , j ) { var k = document . createElement ( " input " ) , l = b + c , m = document . createElement ( " label " ) , n = document . createElement ( " tbody " ) ; k . id = l , k . type = " radio " , k . name = d , k . className = " gv - radio - button " , m . className = " radio " , h . appendChild ( m ) , m . appendChild ( k ) , m . appendChild ( document . createTextNode ( e ) ) , j . appendChild ( n ) , $ ( n ) . toggleClass ( " decission_ " + d , ! 0 ) , $ ( n ) . attr ( " decider " , l ) , _ . each ( g , function ( c ) { a ( n , b , c ) } ) , f ? k . checked = ! 0 : k . checked = ! 1 , m . onclick = function ( a ) { i ( d ) , a . stopPropagation ( ) } , i ( d ) } , k = function ( a , b , c , d , e , f ) { var g , h = [ ] , i = a + b , j = 1 , k = document . createElement ( " th " ) , l = document . createElement ( " button " ) , m = document . createElement ( " input " ) , n = function ( a ) { j + + ; var c , d = document . createElement ( " tr " ) , g = document . createElement ( " th " ) , k = document . createElement ( " th " ) , l = document . createElement ( " th " ) , m = document . createElement ( " input " ) , n = document . createElement ( " button " ) ; m . type = " text " , m . id = i + " _ " + j , m . value = a | | " " , c = 0 = = = h . length ? $ ( f ) : $ ( h [ h . length - 1 ] ) , c . after ( d ) , d . appendChild ( g ) , g . className = " collectionTh capitalize " , g . appendChild ( document . createTextNode ( b + " " + j + " : " ) ) , d . appendChild ( k ) , k . className = " collectionTh " , k . appendChild ( m ) , n . id = i + " _ " + j + " _remove " , n . className = " graphViewer - icon - button gv - icon - small delete " , n . onclick = function ( ) { e . removeChild ( d ) , h . splice ( h . indexOf ( d ) , 1 ) } , l . appendChild ( n ) , d . appendChild ( l ) , h . push ( d ) } ; for ( m . type = " text " , m . id = i + " _1 " , d . appendChild ( m ) , k . appendChild ( l ) , f . appendChild ( k ) , l . onclick = function ( ) { n ( ) } , l . id = i + " _addLine " , l . className = " graphViewer - icon - button gv - icon - small add " , " string " = = typeof c & & c . length > 0 & & ( c = [ c ] ) , c . length > 0 & & ( m . value = c [ 0 ] ) , g = 1 ; g < c . length ; g + + ) n ( c [ g ] ) } , l = function ( a , b ) { var d = document . createElement ( " div " ) , e = document . createElement ( " div " ) , f = document . createElement ( " button " ) , g = document . createElement ( " a " ) , h = document . createElement ( " div " ) , i = document . createElement ( " table " ) ; return d . id = b + " modal " , d . className = " modal hide fade createModalDialog " , d . setAttribute ( " tabindex " , " - 1 " ) , d . setAttribute ( " role " , " dialog " ) , d . setAttribute ( " aria - labelledby " , " myModalLabel " ) , d . setAttribute ( " aria - hidden " , ! 0 ) , d . style . display = " none " , d . onhidden = function ( ) { c ( ) , document . body . removeChild ( d ) } , e . className = " modal - header " , g . className = " arangoHeader " , f . id = b + " modal_dismiss " , f . className = " close " , f . dataDismiss = " modal " , f . ariaHidden = " true " , f . appendChild ( document . createTextNode ( " × " ) ) , g . appendChild ( document . createTextNode ( a ) ) , h . className = " modal - body " , i . id = b + " table " , d . appendChild ( e ) , d . appendChild ( h ) , e . appendChild ( f ) , e . appendChild ( g ) , h . appendChild ( i ) , document . body . appendChild ( d ) , f . onclick = function ( ) { c ( ) , $ ( " # " + b + " modal " ) . modal ( " hide " ) } , { div : d , bodyTable : i } } ; a = function ( a , b , c ) { var d = document . createElement ( " tr " ) , e = document . createElement ( " th " ) , i = document . createElement ( " th " ) ; switch ( a . appendChild ( d ) , d . appendChild ( e ) , e . className = " collectionTh " , c . text ? e . appendChild ( document . createTextNode ( c . text + " : " ) ) : ( e . className + = " capitalize " , c . type & & " extenadable " = = = c . type ? e . appendChild ( document . createTextNode ( c . id + " : " ) ) : e . appendChild ( document . createTextNode ( c . id + " : " ) ) ) , d . appendChild ( i ) , i . className = " collectionTh " , c . type ) { case " text " : i . appendChild ( f ( b + c . id , c . value | | " " ) ) ; break ; case " checkbox " : i . appendChild ( g ( b + c . id , c . selected | | ! 1 ) ) ; break ; case " list " : i . appendChild ( h ( b + c . id , c . objects , c . selected | | void 0 ) ) ; break ; case " extendable " : k ( b , c . id , c . objects , i , a , d ) ; break ; case " decission " : j ( b , c . id , c . group , c . text , c . isDefault , c . interior , i , a ) , e . innerHTML = " " ; break ; default : a . removeChild ( d ) } return d } , modalDialogHelper . modalDivTemplate = function ( a , d , e , f ) { d = d | | " Switch " ; var g = document . createElement ( " div " ) , h = document . createElement ( " button " ) , i = document . createElement ( " button " ) , j = l ( a , e ) ; return g . className = " modal - footer " , h . id = e + " cancel " , h . className = " button - close btn - margin " , h . appendChild ( document . createTextNode ( " Close " ) ) , i . id = e + " submit " , i . className = " button - success " , i . style . marginRight = " 8px " , i . appendChild ( document . createTextNode ( d ) ) , j . div . appendChild ( g ) , g . appendChild ( i ) , g . appendChild ( h ) , h . onclick = function ( ) { c ( ) , $ ( " # " + e + " modal " ) . modal ( " hide " ) } , i . onclick = function ( ) { c ( ) , f ( ) , $ ( " # " + e + " modal " ) . modal ( " hide " ) } , b ( i ) , j . bodyTable } , modalDialogHelper . createModalDialog = function ( b , c , d , e , f ) { var g = modalDialogHelper . modalDivTemplate ( b , f , c , e ) ; _ . each ( d , function ( b ) { a ( g , c , b ) } ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , modalDialogHelper . createModalChangeDialog = function ( b , c , d , e ) { var f = modalDialogHelper . modalDivTemplate ( b , " Change " , c , e ) ; _ . each ( d , function ( b ) { a ( f , c , b ) } ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , modalDialogHelper . createModalEditDialog = function ( a , b , c , e ) { d ( a , " Save " , b , c , e ) } , modalDialogHelper . createModalCreateDialog = function ( a , b , c , e ) { d ( a , " Create " , b , c , e ) } , modalDialogHelper . createModalViewDialog = function ( a , b , c , d ) { e ( a , " Edit " , b , c , d ) } , modalDialogHelper . createModalDeleteDialog = function ( a , d , e , f ) { var g = document . createElement ( " div " ) , h = document . createElement ( " button " ) , i = document . createElement ( " button " ) , j = l ( a , d ) ; g . className = " modal - footer " , h . id = d + " cancel " , h . className = " button - close btn - margin " , h . appendChild ( document . createTextNode ( " Close " ) ) , i . id = d + " submit " , i . className = " button - danger " , i . style . marginRight = " 8px " , i . appendChild ( document . createTextNode ( " Delete " ) ) , j . div . appendChild ( g ) , g . appendChild ( i ) , g . appendChild ( h ) , h . onclick = function ( ) { c ( ) , $ ( " # " + d + " modal " ) . modal ( " hide " ) } , i . onclick = function ( ) { c ( ) , f ( e ) , $ ( " # " + d + " modal " ) . modal ( " hide " ) } , b ( i ) , $ ( " # " + d + " modal " ) . modal ( " show " ) } } ( ) ; var uiComponentsHelper = uiComponentsHelper | | { } ; ! function ( ) { " use strict " ; uiComponentsHelper . createButton = function ( a , b , c , d ) { var e = document . createElement ( " li " ) , f = document . createElement ( " button " ) ; e . className = " graph_control " + c , e . id = c , e . appendChild ( f ) , f . className = " button - primary gv_dropdown_entry " , f . appendChild ( document . createTextNode ( b ) ) , a . appendChild ( e ) , f . id = c + " _button " , f . onclick = d } , uiComponentsHelper . createIconButton = function ( a , b , c ) { var d = document . createElement ( " div " ) , e = document . createElement ( " h6 " ) , f = document . createElement ( " h6 " ) ; return d . className = " gv_action_button " , d . id = b , d . onclick = function ( ) { $ ( " . gv_action_button " ) . each ( function ( a , b ) { $ ( b ) . toggleClass ( " active " , ! 1 ) } ) , " control_event_new_node " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " pointer " ) , $ ( " . gv - background " ) . css ( " cursor " , " copy " ) ) : " control_event_drag " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " - webkit - grabbing " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_expand " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " grabbing " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_view " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " - webkit - zoom - in " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_edit " = = = d . id ? ( $ ( " . gv - background . node " ) . css ( " cursor " , " context - menu " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_connect " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " ne - resize " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_delete " = = = d . id & & ( $ ( " . node " ) . css ( " cursor " , " pointer " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) , $ ( d ) . toggleClass ( " active " , ! 0 ) , c ( ) } , e . className = " fa gv_icon_icon fa - " + a . icon , e . title = a . title , f . className = " gv_button_title " , d . appendChild ( e ) , d . appendChild ( f ) , f . appendChild ( document . createTextNode ( a . title ) ) , d } } ( ) , function ( ) { " use strict " ; var a = null ; window . isCoordinator = function ( b ) { null = = = a ? $ . ajax ( " cluster / amICoordinator " , { async : ! 0 , success : function ( c ) { a = c , b ( ! 1 , c ) } , error : function ( c ) { a = c , b ( ! 0 , c ) } } ) : b ( ! 1 , a ) } , window . versionHelper = { fromString : function ( a ) { var b = a . replace ( / - [ a - zA - Z0 - 9_ \ - ] * $ / g , " " ) . split ( " . " ) ; return { major : parseInt ( b [ 0 ] , 10 ) | | 0 , minor : parseInt ( b [ 1 ] , 10 ) | | 0 , patch : parseInt ( b [ 2 ] , 10 ) | | 0 , toString : function ( ) { return this . major + " . " + this . minor + " . " + this . patch } } } , toString : function ( a ) { return a . major + " . " + a . minor + " . " + a . patch } } , window . arangoHelper = { lastNotificationMessage : null , CollectionTypes : { } , systemAttributes : function ( ) { return { _id : ! 0 , _rev : ! 0 , _key : ! 0 , _bidirectional : ! 0 , _vertices : ! 0 , _from : ! 0 , _to : ! 0 , $ id : ! 0 } } , getCurrentSub : function ( ) { return window . App . naviView . activeSubMenu } , parseError : function ( a , b ) { var c ; try { c = JSON . parse ( b . responseText ) . errorMessage } catch ( d ) { c = d } this . arangoError ( a , c ) } , setCheckboxStatus : function ( a ) { _ . each ( $ ( a ) . find ( " ul " ) . find ( " li " ) , function ( a ) { $ ( a ) . hasClass ( " nav - header " ) | | ( $ ( a ) . find ( " input " ) . attr ( " checked " ) ? $ ( a ) . find ( " i " ) . hasClass ( " css - round - label " ) ? $ ( a ) . find ( " i " ) . addClass ( " fa - dot - circle - o " ) : $ ( a ) . find ( " i " ) . addClass ( " fa - check - square - o " ) : $ ( a ) . find ( " i " ) . hasClass ( " css - round - label " ) ? $ ( a ) . find ( " i " ) . addClass ( " fa - circle - o " ) : $ ( a ) . find ( " i " ) . addClass ( " fa - square - o " ) ) } ) } , parseInput : function ( a ) { var b , c = $ ( a ) . val ( ) ; try { b = JSON . parse ( c ) } catch ( d ) { b = c } return b } , calculateCenterDivHeight : function ( ) { var a = $ ( " . navbar " ) . height ( ) , b = $ ( " . footer " ) . height ( ) , c = $ ( window ) . height ( ) ; return c - b - a - 110 } , fixTooltips : function ( a , b ) { $ ( a ) . tooltip ( { placement : b , hide : ! 1 , show : ! 1 } ) } , currentDatabase : function ( a ) { return frontendConfig . db ? a ( ! 1 , frontendConfig . db ) : a ( ! 0 , void 0 ) , frontendConfig . db } , allHotkeys : { jsoneditor : { name : " AQL editor " , content : [ { label : " Execute Query " , letter : " Ctrl / Cmd + Return " } , { label : " Explain Query " , letter : " Ctrl / Cmd + Shift + Return " } , { label : " Save Query " , letter : " Ctrl / Cmd + Shift + S " } , { label : " Open search " , letter : " Ctrl + Space " } , { label : " Toggle comments " , letter : " Ctrl / Cmd + Shift + C " } , { label : " Undo " , letter : " Ctrl / Cmd + Z " } , { label : " Redo " , letter : " Ctrl / Cmd + Shift + Z " } ] } , doceditor : { name : " Document editor " , content : [ { label : " Insert " , letter : " Ctrl + Insert " } , { label : " Save " , letter : " Ctrl + Return , Cmd + Return " } , { label : " Append " , letter : " Ctrl + Shift + Insert " } , { label : " Duplicate " , letter : " Ctrl + D " } , { label : " Remove " , letter : " Ctrl + Delete " } ] } , modals : { name : " Modal " , content : [ { label : " Submit " , letter : " Return " } , { label : " Close " , letter : " Esc " } , { label : " Navigate buttons " , letter : " Arrow keys " } , { label : " Navigate content " , letter : " Tab " } ] } } , hotkeysFunctions : { scrollDown : function ( ) { window . scrollBy ( 0 , 180 ) } , scrollUp : function ( ) { window . scrollBy ( 0 , - 180 ) } , showHotkeysModal : function ( ) { var a = [ ] , b = window . arangoHelper . allHotkeys ; window . modalView . show ( " modalHotkeys . ejs " , " Keyboard Shortcuts " , a , b ) } } , buildSubNavBar : function ( a ) { $ ( " # subNavigationBar . bottom " ) . html ( " " ) ; var b ; _ . each ( a , function ( a , c ) { b = " " , a . active & & ( b + = " active " ) , a . disabled & & ( b + = " disabled " ) , $ ( " # subNavigationBar . bottom " ) . append ( ' < li class = " subMenuEntry ' + b + ' " > < a > ' + c + " < / a > < / li > " ) , a . disabled | | $ ( " # subNavigationBar . bottom " ) . children ( ) . last ( ) . bind ( " click " , function ( ) { window . App . navigate ( a . route , { trigger : ! 0 } ) } ) } ) } , buildNodeSubNav : function ( a , b , c ) { var d = { Dashboard : { route : " # node / " + encodeURIComponent ( a ) } , Logs : { route : " # nLogs / " + encodeURIComponent ( a ) , disabled : ! 0 } } ; d [ b ] . active = ! 0 , d [ c ] . disabled = ! 0 , this . buildSubNavBar ( d ) } , scaleability : void 0 , buildNodesSubNav : function ( a ) { if ( void 0 = = = this . scaleability ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { null ! = = a . numberOfCoordinators & & null ! = = a . numberOfDBServers ? ( b . scaleability = ! 0 , b . buildNodesSubNav ( ) ) : b . scaleability = ! 1 } } ) } var c = { Coordinators : { route : " # cNodes " } , DBServers : { route : " # dNodes " } } ; c . Scale = { route : " # sNodes " , disabled : ! 0 } , " coordinator " = = = a ? c . Coordinators . active = ! 0 : " scale " = = = a ? this . scaleability = = = ! 0 ? c . Scale . active = ! 0 : window . App . navigate ( " # nodes " , { trigger : ! 0 } ) : c . DBServers . active = ! 0 , this . scaleability = = = ! 0 & & ( c . Scale . disabled = ! 1 ) , this . buildSubNavBar ( c ) } , buildCollectionSubNav : function ( a , b ) { var c = " # collection / " + encodeURIComponent ( a ) , d = { Content : { route : c + " / documents / 1 " } , Indices : { route : " # cIndices / " + encodeURIComponent ( a ) } , Info : { route : " # cInfo / " + encodeURIComponent ( a ) } , Settings : { route : " # cSettings / " + encodeURIComponent ( a ) } } ; d [ b ] . active = ! 0 , this . buildSubNavBar ( d ) } , enableKeyboardHotkeys : function ( a ) { var b = window . arangoHelper . hotkeysFunctions ; a = = = ! 0 & & ( $ ( document ) . on ( " keydown " , null , " j " , b . scrollDown ) , $ ( document ) . on ( " keydown " , null , " k " , b . scrollUp ) ) } , databaseAllowed : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " " , " " ) : $ . ajax ( { type : " GET " , cache : ! 1 , url : this . databaseUrl ( " / _api / database / " , c ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { a ( ! 1 , ! 0 ) } , error : function ( ) { a ( ! 0 , ! 1 ) } } ) } . bind ( this ) ; this . currentDatabase ( b ) } , arangoNotification : function ( a , b , c ) { window . App . notificationList . add ( { title : a , content : b , info : c , type : " success " } ) } , arangoError : function ( a , b , c ) { window . App . notificationList . add ( { title : a , content : b , info : c , type : " error " } ) } , arangoWarning : function ( a , b , c ) { window . App . notificationList . add ( { title : a , content : b , info : c , type : " warning " } ) } , hideArangoNotifications : function ( ) { $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) } , openDocEditor : function ( a , b , c ) { var d = a . split ( " / " ) , e = this , f = new window . DocumentView ( { collection : window . App . arangoDocumentStore } ) ; f . breadcrumb = function ( ) { } , f . colid = d [ 0 ] , f . docid = d [ 1 ] , f . el = " . arangoFrame . innerDiv " , f . render ( ) , f . setType ( b ) , $ ( " . arangoFrame . headerBar " ) . remove ( ) , $ ( " . arangoFrame . outerDiv " ) . prepend ( ' < i class = " fa fa - times " > < / i > ' ) , $ ( " . arangoFrame . outerDiv " ) . click ( function ( ) { e . closeDocEditor ( ) } ) , $ ( " . arangoFrame . innerDiv " ) . click ( function ( a ) { a . stopPropagation ( ) } ) , $ ( " . fa - times " ) . click ( function ( ) { e . closeDocEditor ( ) } ) , $ ( " . arangoFrame " ) . show ( ) , f . customView = ! 0 , f . customDeleteFunction = function ( ) { window . modalView . hide ( ) , $ ( " . arangoFrame " ) . hide ( ) } , $ ( " . arangoFrame # deleteDocumentButton " ) . click ( function ( ) { f . deleteDocumentModal ( ) } ) , $ ( " . arangoFrame # saveDocumentButton " ) . click ( function ( ) { f . saveDocument ( ) } ) , $ ( " . arangoFrame # deleteDocumentButton " ) . css ( " display " , " none " ) } , closeDocEditor : function ( ) { $ ( " . arangoFrame . outerDiv . fa - times " ) . remove ( ) , $ ( " . arangoFrame " ) . hide ( ) } , addAardvarkJob : function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : this . databaseUrl ( " / _admin / aardvark / job " ) , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b & & b ( ! 1 , a ) } , error : function ( a ) { b & & b ( ! 0 , a ) } } ) } , deleteAardvarkJob : function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : this . databaseUrl ( " / _admin / aardvark / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b & & b ( ! 1 , a ) } , error : function ( a ) { b & & b ( ! 0 , a ) } } ) } , deleteAllAardvarkJobs : function ( a ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : this . databaseUrl ( " / _admin / aardvark / job " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a & & a ( ! 1 , b ) } , error : function ( b ) { a & & a ( ! 0 , b ) } } ) } , getAardvarkJobs : function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , url : this . databaseUrl ( " / _admin / aardvark / job " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a & & a ( ! 1 , b ) } , error : function ( b ) { console . log ( " error " ) , a & & a ( ! 0 , b ) } } ) } , getPendingJobs : function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , url : this . databaseUrl ( " / _api / job / pending " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , syncAndReturnUninishedAardvarkJobs : function ( a , b ) { var c = function ( c , d ) { if ( c ) b ( ! 0 ) ; else { var e = function ( c , e ) { if ( c ) arangoHelper . arangoError ( " " , " " ) ; else { var f = [ ] ; e . length > 0 ? _ . each ( d , function ( b ) { if ( b . type = = = a | | void 0 = = = b . type ) { var c = ! 1 ; _ . each ( e , function ( a ) { b . id = = = a & & ( c = ! 0 ) } ) , c ? f . push ( { collection : b . collection , id : b . id , type : b . type , desc : b . desc } ) : window . arangoHelper . deleteAardvarkJob ( b . id ) } } ) : d . length > 0 & & this . deleteAllAardvarkJobs ( ) , b ( ! 1 , f ) } } . bind ( this ) ; this . getPendingJobs ( e ) } } . bind ( this ) ; this . getAardvarkJobs ( c ) } , getRandomToken : function ( ) { return Math . round ( ( new Date ) . getTime ( ) ) } , isSystemAttribute : function ( a ) { var b = this . systemAttributes ( ) ; return b [ a ] } , isSystemCollection : function ( a ) { return " _ " = = = a . name . substr ( 0 , 1 ) } , setDocumentStore : function ( a ) { this . arangoDocumentStore = a } , collectionApiType : function ( a , b , c ) { if ( b | | void 0 = = = this . CollectionTypes [ a ] ) { var d = function ( b , c , d ) { b ? arangoHelper . arangoError ( " Error " , " Could not detect collection type " ) : ( this . CollectionTypes [ a ] = c . type , 3 = = = this . CollectionTypes [ a ] ? d ( ! 1 , " edge " ) : d ( ! 1 , " document " ) ) } . bind ( this ) ; this . arangoDocumentStore . getCollectionInfo ( a , d , c ) } else c ( ! 1 , this . CollectionTypes [ a ] ) } , collectionType : function ( a ) { if ( ! a | | " " = = = a . name ) return " - " ; var b ; return b = 2 = = = a . type ? " document " : 3 = = = a . type ? " edge " : " unknown " , this . isSystemCollection ( a ) & & ( b + = " ( system ) " ) , b } , formatDT : function ( a ) { var b = function ( a ) { return 10 > a ? " 0 " + a : a } ; return a . getUTCFullYear ( ) + " - " + b ( a . getUTCMonth ( ) + 1 ) + " - " + b ( a . getUTCDate ( ) ) + " " + b ( a . getUTCHours ( ) ) + " : " + b ( a . getUTCMinutes ( ) ) + " : " + b ( a . getUTCSeconds ( ) ) } , escapeHtml : function ( a ) { return String ( a ) . replace ( / & / g , " & amp ; " ) . replace ( / < / g , " & lt ; " ) . replace ( / > / g , " & gt ; " ) . replace ( / " / g , " & quot ; " ) . replace ( / ' / g , " & # 39 ; " ) } , backendUrl : function ( a ) { return frontendConfig . basePath + a } , databaseUrl : function ( a , b ) { if ( " / _db / " = = = a . substr ( 0 , 5 ) ) throw new Error ( " Calling databaseUrl with a databased url ( " + a + " ) doesn ' t make any sense " ) ; return b | | ( b = " _system " , frontendConfig . db & & ( b = frontendConfig . db ) ) , this . backendUrl ( " / _db / " + encodeURIComponent ( b ) + a ) } } } ( ) , function ( ) { " use strict " ; if ( ! window . hasOwnProperty ( " TEST_BUILD " ) ) { var a = function ( ) { var a = { } ; return a . createTemplate = function ( a ) { var b = $ ( " # " + a . replace ( " . " , " \ \ . " ) ) . html ( ) ; return { render : function ( a ) { var c = _ . template ( b ) ; return c = c ( a ) } } } , a } ; window . templateEngine = new a } } ( ) , function ( ) { " use strict " ; window . dygraphConfig = { defaultFrame : 12e5 , zeropad : function ( a ) { return 10 > a ? " 0 " + a : a } , xAxisFormat : function ( a ) { if ( - 1 = = = a ) return " " ; var b = new Date ( a ) ; return this . zeropad ( b . getHours ( ) ) + " : " + this . zeropad ( b . getMinutes ( ) ) + " : " + this . zeropad ( b . getSeconds ( ) ) } , mergeObjects : function ( a , b , c ) { c | | ( c = [ ] ) ; var d , e = { } ; return c . forEach ( function ( c ) { var d = a [ c ] , f = b [ c ] ; void 0 = = = d & & ( d = { } ) , void 0 = = = f & & ( f = { } ) , e [ c ] = _ . extend ( d , f ) } ) , d = _ . extend ( a , b ) , Object . keys ( e ) . forEach ( function ( a ) { d [ a ] = e [ a ] } ) , d } , mapStatToFigure : { residentSize : [ " times " , " residentSizePercent " ] , pageFaults : [ " times " , " majorPageFaultsPerSecond " , " minorPageFaultsPerSecond " ] , systemUserTime : [ " times " , " systemTimePerSecond " , " userTimePerSecond " ] , totalTime : [ " times " , " avgQueueTime " , " avgRequestTime " , " avgIoTime " ] , dataTransfer : [ " times " , " bytesSentPerSecond " , " bytesReceivedPerSecond " ] , requests : [ " times " , " getsPerSecond " , " putsPerSecond " , " postsPerSecond " , " deletesPerSecond " , " patchesPerSecond " , " headsPerSecond " , " optionsPerSecond " , " othersPerSecond " ] } , colors : [ " rgb ( 95 , 194 , 135 ) " , " rgb ( 238 , 190 , 77 ) " , " # 81ccd8 " , " # 7ca530 " , " # 3c3c3c " , " # aa90bd " , " # e1811d " , " # c7d4b2 " , " # d0b2d4 " ] , figureDependedOptions : { clusterRequestsPerSecond : { showLabelsOnHighlight : ! 0 , title : " " , header : " Cluster Requests per Second " , stackedGraph : ! 0 , div : " lineGraphLegend " , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } , residentSize : { header : " Memory " , axes : { y : { labelsKMG2 : ! 1 , axisLabelFormatter : function ( a ) { return parseFloat ( 100 * a . toPrecision ( 3 ) ) + " % " } , valueFormatter : function ( a ) { return parseFloat ( 100 * a . toPrecision ( 3 ) ) + " % " } } } } , pageFaults : { header : " Page Faults " , visibility : [ ! 0 , ! 1 ] , labels : [ " datetime " , " Major Page " , " Minor Page " ] , div : " pageFaultsChart " , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } , systemUserTime : { div : " systemUserTimeChart " , header : " System and User Time " , labels : [ " datetime " , " System Time " , " User Time " ] , stackedGraph : ! 0 , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } , totalTime : { div : " totalTimeChart " , header : " Total Time " , labels : [ " datetime " , " Queue " , " Computation " , " I / O " ] , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } , stackedGraph : ! 0 } , dataTransfer : { header : " Data Transfer " , labels : [ " datetime " , " Bytes sent " , " Bytes received " ] , stackedGraph : ! 0 , div : " dataTransferChart " } , requests : { header : " Requests " , labels : [ " datetime " , " Reads " , " Writes " ] , stackedGraph : ! 0 , div : " requestsChart " , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } } , getDashBoardFigures : function ( a ) { var b = [ ] , c = this ; return Object . keys ( this . figureDependedOptions ) . forEach ( function ( d ) { " clusterRequestsPerSecond " ! = = d & & ( c . figureDependedOptions [ d ] . div | | a ) & & b . push ( d ) } ) , b } , getDefaultConfig : function ( a ) { var b = this , c = { digitsAfterDecimal : 1 , drawGapPoints : ! 0 , fillGraph : ! 0 , fillAlpha : . 85 , showLabelsOnHighlight : ! 1 , strokeWidth : 0 , lineWidth : 0 , strokeBorderWidth : 0 , includeZero : ! 0 , highlightCircleSize : 2 . 5 , labelsSeparateLines : ! 0 , strokeBorderColor : " rgba ( 0 , 0 , 0 , 0 ) " , interactionModel : { } , maxNumberWidth : 10 , colors : [ this . colors [ 0 ] ] , xAxisLabelWidth : " 50 " , rightGap : 15 , showRangeSelector : ! 1 , rangeSelectorHeight : 50 , rangeSelectorPlotStrokeColor : " # 365300 " , rangeSelectorPlotFillColor : " " , pixelsPerLabel : 50 , labelsKMG2 : ! 0 , dateWindow : [ ( new Date ) . getTime ( ) - this . defaultFrame , ( new Date ) . getTime ( ) ] , axes : { x : { valueFormatter : function ( a ) { return b . xAxisFormat ( a ) } } , y : { ticker : Dygraph . numericLinearTicks } } } ; return this . figureDependedOptions [ a ] & & ( c = this . mergeObjects ( c , this . figureDependedOptions [ a ] , [ " axes " ] ) , c . div & & c . labels & & ( c . colors = this . getColors ( c . labels ) , c . labelsDiv = document . getElementById ( c . div + " Legend " ) , c . legend = " always " , c . showLabelsOnHighlight = ! 0 ) ) , c } , getDetailChartConfig : function ( a ) { var b = _ . extend ( this . getDefaultConfig ( a ) , { showRangeSelector : ! 0 , interactionModel : null , showLabelsOnHighlight : ! 0 , highlightCircleSize : 2 . 5 , legend : " always " , labelsDiv : " div # detailLegend . dashboard - legend - inner " } ) ; return " pageFaults " = = = a & & ( b . visibility = [ ! 0 , ! 0 ] ) , b . labels | | ( b . labels = [ " datetime " , b . header ] , b . colors = this . getColors ( b . labels ) ) , b } , getColors : function ( a ) { var b ; return b = this . colors . concat ( [ ] ) , b . slice ( 0 , a . length - 1 ) } } } ( ) , function ( ) { " use strict " ; window . arangoCollectionModel = Backbone . Model . extend ( { idAttribute : " name " , urlRoot : arangoHelper . databaseUrl ( " / _api / collection " ) , defaults : { id : " " , name : " " , status : " " , type : " " , isSystem : ! 1 , picture : " " , locked : ! 1 , desc : void 0 } , getProperties : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + encodeURIComponent ( this . get ( " id " ) ) + " / properties " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , getFigures : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / figures " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( ) { a ( ! 0 ) } } ) } , getRevision : function ( a , b ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / revision " ) , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a ( ! 1 , c , b ) } , error : function ( ) { a ( ! 0 ) } } ) } , getIndex : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / index / ? collection = " + this . get ( " id " ) ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , createIndex : function ( a , b ) { var c = this ; $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / index ? collection = " + c . get ( " id " ) ) , headers : { " x - arango - async " : " store " } , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) ? ( window . arangoHelper . addAardvarkJob ( { id : e . getResponseHeader ( " x - arango - async - id " ) , type : " index " , desc : " Creating Index " , collection : c . get ( " id " ) } ) , b ( ! 1 , a ) ) : b ( ! 0 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } , deleteIndex : function ( a , b ) { var c = this ; $ . ajax ( { cache : ! 1 , type : " DELETE " , url : arangoHelper . databaseUrl ( " / _api / index / " + this . get ( " name " ) + " / " + encodeURIComponent ( a ) ) , headers : { " x - arango - async " : " store " } , success : function ( a , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) ? ( window . arangoHelper . addAardvarkJob ( { id : e . getResponseHeader ( " x - arango - async - id " ) , type : " index " , desc : " Removing Index " , collection : c . get ( " id " ) } ) , b ( ! 1 , a ) ) : b ( ! 0 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) , b ( ) } , truncateCollection : function ( ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / truncate " ) , success : function ( ) { arangoHelper . arangoNotification ( " Collection truncated . " ) } , error : function ( ) { arangoHelper . arangoError ( " Collection error . " ) } } ) } , loadCollection : function ( a ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / load " ) , success : function ( ) { a ( ! 1 ) } , error : function ( ) { <nl> - a ( ! 0 ) } } ) , a ( ) } , unloadCollection : function ( a ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / unload ? flush = true " ) , success : function ( ) { a ( ! 1 ) } , error : function ( ) { a ( ! 0 ) } } ) , a ( ) } , renameCollection : function ( a , b ) { var c = this ; $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / rename " ) , data : JSON . stringify ( { name : a } ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { c . set ( " name " , a ) , b ( ! 1 ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } , changeCollection : function ( a , b , c , d ) { var e = ! 1 ; " true " = = = a ? a = ! 0 : " false " = = = a & & ( a = ! 1 ) ; var f = { waitForSync : a , journalSize : parseInt ( b ) , indexBuckets : parseInt ( c ) } ; return $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / properties " ) , data : JSON . stringify ( f ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { d ( ! 1 ) } , error : function ( a ) { d ( ! 1 , a ) } } ) , e } } ) } ( ) , window . DatabaseModel = Backbone . Model . extend ( { idAttribute : " name " , initialize : function ( ) { " use strict " } , isNew : function ( ) { " use strict " ; return ! 1 } , sync : function ( a , b , c ) { " use strict " ; return " update " = = = a & & ( a = " create " ) , Backbone . sync ( a , b , c ) } , url : arangoHelper . databaseUrl ( " / _api / database " ) , defaults : { } } ) , window . arangoDocumentModel = Backbone . Model . extend ( { initialize : function ( ) { " use strict " } , urlRoot : arangoHelper . databaseUrl ( " / _api / document " ) , defaults : { _id : " " , _rev : " " , _key : " " } , getSorted : function ( ) { " use strict " ; var a = this , b = Object . keys ( a . attributes ) . sort ( function ( a , b ) { var c = arangoHelper . isSystemAttribute ( a ) , d = arangoHelper . isSystemAttribute ( b ) ; return c ! = = d ? c ? - 1 : 1 : b > a ? - 1 : 1 } ) , c = { } ; return _ . each ( b , function ( b ) { c [ b ] = a . attributes [ b ] } ) , c } } ) , function ( ) { " use strict " ; window . ArangoQuery = Backbone . Model . extend ( { urlRoot : arangoHelper . databaseUrl ( " / _api / user " ) , defaults : { name : " " , type : " custom " , value : " " } } ) } ( ) , window . Replication = Backbone . Model . extend ( { defaults : { state : { } , server : { } } , initialize : function ( ) { } } ) , window . Statistics = Backbone . Model . extend ( { defaults : { } , url : function ( ) { " use strict " ; return " / _admin / statistics " } } ) , window . StatisticsDescription = Backbone . Model . extend ( { defaults : { figures : " " , groups : " " } , url : function ( ) { " use strict " ; return " / _admin / statistics - description " } } ) , window . Users = Backbone . Model . extend ( { defaults : { user : " " , active : ! 1 , extra : { } } , idAttribute : " user " , parse : function ( a ) { return this . isNotNew = ! 0 , a } , isNew : function ( ) { return ! this . isNotNew } , url : function ( ) { return this . isNew ( ) ? arangoHelper . databaseUrl ( " / _api / user " ) : " " ! = = this . get ( " user " ) ? arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) : arangoHelper . databaseUrl ( " / _api / user " ) } , checkPassword : function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) , data : JSON . stringify ( { passwd : a } ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b ( ! 1 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } , setPassword : function ( a ) { $ . ajax ( { cache : ! 1 , type : " PATCH " , url : arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) , data : JSON . stringify ( { passwd : a } ) , contentType : " application / json " , processData : ! 1 } ) } , setExtras : function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PATCH " , url : arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) , data : JSON . stringify ( { extra : { name : a , img : b } } ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { c ( ! 1 ) } , error : function ( ) { c ( ! 0 ) } } ) } } ) , function ( ) { " use strict " ; window . ClusterCoordinator = Backbone . Model . extend ( { defaults : { name : " " , status : " ok " , address : " " , protocol : " " } , idAttribute : " name " , forList : function ( ) { return { name : this . get ( " name " ) , status : this . get ( " status " ) , url : this . get ( " url " ) } } } ) } ( ) , function ( ) { " use strict " ; window . ClusterServer = Backbone . Model . extend ( { defaults : { name : " " , address : " " , role : " " , status : " ok " } , idAttribute : " name " , forList : function ( ) { return { name : this . get ( " name " ) , address : this . get ( " address " ) , status : this . get ( " status " ) } } } ) } ( ) , function ( ) { " use strict " ; window . Coordinator = Backbone . Model . extend ( { defaults : { address : " " , protocol : " " , name : " " , status : " " } } ) } ( ) , function ( ) { " use strict " ; window . CurrentDatabase = Backbone . Model . extend ( { url : arangoHelper . databaseUrl ( " / _api / database / current " , frontendConfig . db ) , parse : function ( a ) { return a . result } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b , c , d , e , f ) { var g = { contentType : " application / json " , processData : ! 1 , type : c } ; b = b | | function ( ) { } , f = _ . extend ( { mount : a . encodedMount ( ) } , f ) ; var h = _ . reduce ( f , function ( a , b , c ) { return a + encodeURIComponent ( c ) + " = " + encodeURIComponent ( b ) + " & " } , " ? " ) ; g . url = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes " + ( d ? " / " + d : " " ) + h . slice ( 0 , h . length - 1 ) ) , void 0 ! = = e & & ( g . data = JSON . stringify ( e ) ) , $ . ajax ( g ) . then ( function ( a ) { b ( null , a ) } , function ( a ) { window . xhr = a , b ( _ . extend ( a . status ? new Error ( a . responseJSON ? a . responseJSON . errorMessage : a . responseText ) : new Error ( " Network Error " ) , { statusCode : a . status } ) ) } ) } ; window . Foxx = Backbone . Model . extend ( { idAttribute : " mount " , defaults : { author : " Unknown Author " , name : " " , version : " Unknown Version " , description : " No description " , license : " Unknown License " , contributors : [ ] , scripts : { } , config : { } , deps : { } , git : " " , system : ! 1 , development : ! 1 } , isNew : function ( ) { return ! 1 } , encodedMount : function ( ) { return encodeURIComponent ( this . get ( " mount " ) ) } , destroy : function ( b , c ) { a ( this , c , " DELETE " , void 0 , void 0 , b ) } , isBroken : function ( ) { return ! 1 } , needsAttention : function ( ) { return this . isBroken ( ) | | this . needsConfiguration ( ) | | this . hasUnconfiguredDependencies ( ) } , needsConfiguration : function ( ) { return _ . any ( this . get ( " config " ) , function ( a ) { return void 0 = = = a . current & & a . required ! = = ! 1 } ) } , hasUnconfiguredDependencies : function ( ) { return _ . any ( this . get ( " deps " ) , function ( a ) { return void 0 = = = a . current & & a . definition . required ! = = ! 1 } ) } , getConfiguration : function ( b ) { a ( this , function ( a , c ) { a | | this . set ( " config " , c ) , " function " = = typeof b & & b ( a , c ) } . bind ( this ) , " GET " , " config " ) } , setConfiguration : function ( b , c ) { a ( this , c , " PATCH " , " config " , b ) } , getDependencies : function ( b ) { a ( this , function ( a , c ) { a | | this . set ( " deps " , c ) , " function " = = typeof b & & b ( a , c ) } . bind ( this ) , " GET " , " deps " ) } , setDependencies : function ( b , c ) { a ( this , c , " PATCH " , " deps " , b ) } , toggleDevelopment : function ( b , c ) { a ( this , function ( a , d ) { a | | this . set ( " development " , b ) , " function " = = typeof c & & c ( a , d ) } . bind ( this ) , " PATCH " , " devel " , b ) } , runScript : function ( b , c , d ) { a ( this , d , " POST " , " scripts / " + b , c ) } , runTests : function ( b , c ) { a ( this , function ( a , b ) { " function " = = typeof c & & c ( a ? a . responseJSON : a , b ) } . bind ( this ) , " POST " , " tests " , b ) } , isSystem : function ( ) { return this . get ( " system " ) } , isDevelopment : function ( ) { return this . get ( " development " ) } , download : function ( ) { window . open ( arangoHelper . databaseUrl ( " / _db / " + arango . getDatabaseName ( ) + " / _admin / aardvark / foxxes / download / zip ? mount = " + this . encodedMount ( ) ) ) } } ) } ( ) , function ( ) { " use strict " ; window . Graph = Backbone . Model . extend ( { idAttribute : " _key " , urlRoot : arangoHelper . databaseUrl ( " / _api / gharial " ) , isNew : function ( ) { return ! this . get ( " _id " ) } , parse : function ( a ) { return a . graph | | a } , addEdgeDefinition : function ( a ) { $ . ajax ( { async : ! 1 , type : " POST " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / edge " , data : JSON . stringify ( a ) } ) } , deleteEdgeDefinition : function ( a ) { $ . ajax ( { async : ! 1 , type : " DELETE " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / edge / " + a } ) } , modifyEdgeDefinition : function ( a ) { $ . ajax ( { async : ! 1 , type : " PUT " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / edge / " + a . collection , data : JSON . stringify ( a ) } ) } , addVertexCollection : function ( a ) { $ . ajax ( { async : ! 1 , type : " POST " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / vertex " , data : JSON . stringify ( { collection : a } ) } ) } , deleteVertexCollection : function ( a ) { $ . ajax ( { async : ! 1 , type : " DELETE " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / vertex / " + a } ) } , defaults : { name : " " , edgeDefinitions : [ ] , orphanCollections : [ ] } } ) } ( ) , function ( ) { " use strict " ; window . newArangoLog = Backbone . Model . extend ( { defaults : { lid : " " , level : " " , timestamp : " " , text : " " , totalAmount : " " } , getLogStatus : function ( ) { switch ( this . get ( " level " ) ) { case 1 : return " Error " ; case 2 : return " Warning " ; case 3 : return " Info " ; case 4 : return " Debug " ; default : return " Unknown " } } } ) } ( ) , function ( ) { " use strict " ; window . Notification = Backbone . Model . extend ( { defaults : { title : " " , date : 0 , content : " " , priority : " " , tags : " " , seen : ! 1 } } ) } ( ) , function ( ) { " use strict " ; window . queryManagementModel = Backbone . Model . extend ( { defaults : { id : " " , query : " " , started : " " , runTime : " " } } ) } ( ) , function ( ) { " use strict " ; window . workMonitorModel = Backbone . Model . extend ( { defaults : { name : " " , number : " " , status : " " , type : " " } } ) } ( ) , function ( ) { " use strict " ; window . AutomaticRetryCollection = Backbone . Collection . extend ( { _retryCount : 0 , checkRetries : function ( ) { var a = this ; return this . updateUrl ( ) , this . _retryCount > 10 ? ( window . setTimeout ( function ( ) { a . _retryCount = 0 } , 1e4 ) , window . App . clusterUnreachable ( ) , ! 1 ) : ! 0 } , successFullTry : function ( ) { this . _retryCount = 0 } , failureTry : function ( a , b , c ) { 401 = = = c . status ? window . App . requestAuth ( ) : ( window . App . clusterPlan . rotateCoordinator ( ) , this . _retryCount + + , a ( ) ) } } ) } ( ) , function ( ) { " use strict " ; window . PaginatedCollection = Backbone . Collection . extend ( { page : 0 , pagesize : 10 , totalAmount : 0 , getPage : function ( ) { return this . page + 1 } , setPage : function ( a ) { return a > = this . getLastPageNumber ( ) ? void ( this . page = this . getLastPageNumber ( ) - 1 ) : 1 > a ? void ( this . page = 0 ) : void ( this . page = a - 1 ) } , getLastPageNumber : function ( ) { return Math . max ( Math . ceil ( this . totalAmount / this . pagesize ) , 1 ) } , getOffset : function ( ) { return this . page * this . pagesize } , getPageSize : function ( ) { return this . pagesize } , setPageSize : function ( a ) { if ( " all " = = = a ) this . pagesize = " all " ; else try { a = parseInt ( a , 10 ) , this . pagesize = a } catch ( b ) { } } , setToFirst : function ( ) { this . page = 0 } , setToLast : function ( ) { this . setPage ( this . getLastPageNumber ( ) ) } , setToPrev : function ( ) { this . setPage ( this . getPage ( ) - 1 ) } , setToNext : function ( ) { this . setPage ( this . getPage ( ) + 1 ) } , setTotal : function ( a ) { this . totalAmount = a } , getTotal : function ( ) { return this . totalAmount } , setTotalMinusOne : function ( ) { this . totalAmount - - } } ) } ( ) , window . ClusterStatisticsCollection = Backbone . Collection . extend ( { model : window . Statistics , url : " / _admin / statistics " , updateUrl : function ( ) { this . url = window . App . getNewRoute ( this . host ) + this . url } , initialize : function ( a , b ) { this . host = b . host , window . App . registerForUpdate ( this ) } } ) , function ( ) { " use strict " ; window . arangoCollections = Backbone . Collection . extend ( { url : arangoHelper . databaseUrl ( " / _api / collection " ) , model : arangoCollectionModel , searchOptions : { searchPhrase : null , includeSystem : ! 1 , includeDocument : ! 0 , includeEdge : ! 0 , includeLoaded : ! 0 , includeUnloaded : ! 0 , sortBy : " name " , sortOrder : 1 } , translateStatus : function ( a ) { switch ( a ) { case 0 : return " corrupted " ; case 1 : return " new born collection " ; case 2 : return " unloaded " ; case 3 : return " loaded " ; case 4 : return " unloading " ; case 5 : return " deleted " ; case 6 : return " loading " ; default : return } } , translateTypePicture : function ( a ) { var b = " " ; switch ( a ) { case " document " : b + = " fa - file - text - o " ; break ; case " edge " : b + = " fa - share - alt " ; break ; case " unknown " : b + = " fa - question " ; break ; default : b + = " fa - cogs " } return b } , parse : function ( a ) { var b = this ; return _ . each ( a . result , function ( a ) { a . isSystem = arangoHelper . isSystemCollection ( a ) , a . type = arangoHelper . collectionType ( a ) , a . status = b . translateStatus ( a . status ) , a . picture = b . translateTypePicture ( a . type ) } ) , a . result } , getPosition : function ( a ) { var b , c = this . getFiltered ( this . searchOptions ) , d = null , e = null ; for ( b = 0 ; b < c . length ; + + b ) c [ b ] . get ( " name " ) = = = a & & ( b > 0 & & ( d = c [ b - 1 ] ) , b < c . length - 1 & & ( e = c [ b + 1 ] ) ) ; return { prev : d , next : e } } , getFiltered : function ( a ) { var b = [ ] , c = [ ] ; if ( null ! = = a . searchPhrase ) { var d = a . searchPhrase . toLowerCase ( ) ; d = d . replace ( / \ s + / g , " " ) . replace ( / ( ^ \ s + | \ s + $ ) / g , " " ) , c = d . split ( " " ) } return this . models . forEach ( function ( d ) { if ( c . length > 0 ) { var e , f = d . get ( " name " ) . toLowerCase ( ) ; for ( e = 0 ; e < c . length ; + + e ) if ( - 1 = = = f . indexOf ( c [ e ] ) ) return } a . includeSystem = = = ! 1 & & d . get ( " isSystem " ) | | ( a . includeEdge ! = = ! 1 | | " edge " ! = = d . get ( " type " ) ) & & ( a . includeDocument ! = = ! 1 | | " document " ! = = d . get ( " type " ) ) & & ( a . includeLoaded ! = = ! 1 | | " loaded " ! = = d . get ( " status " ) ) & & ( a . includeUnloaded ! = = ! 1 | | " unloaded " ! = = d . get ( " status " ) ) & & b . push ( d ) } ) , b . sort ( function ( b , c ) { var d , e ; return " type " = = = a . sortBy ? ( d = b . get ( " type " ) + " " + b . get ( " name " ) . toLowerCase ( ) , e = c . get ( " type " ) + " " + c . get ( " name " ) . toLowerCase ( ) ) : ( d = b . get ( " name " ) . toLowerCase ( ) , e = c . get ( " name " ) . toLowerCase ( ) ) , d ! = = e ? a . sortOrder * ( e > d ? - 1 : 1 ) : 0 } ) , b } , newCollection : function ( a , b ) { var c = { } ; c . name = a . collName , c . waitForSync = a . wfs , a . journalSize > 0 & & ( c . journalSize = a . journalSize ) , c . isSystem = a . isSystem , c . type = parseInt ( a . collType , 10 ) , a . shards & & ( c . numberOfShards = a . shards , c . shardKeys = a . keys ) , a . replicationFactor & & ( c . replicationFactor = JSON . parse ( a . replicationFactor ) ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / collection " ) , data : JSON . stringify ( c ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b ( ! 1 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ArangoDatabase = Backbone . Collection . extend ( { model : window . DatabaseModel , sortOptions : { desc : ! 1 } , url : arangoHelper . databaseUrl ( " / _api / database " ) , comparator : function ( a , b ) { var c = a . get ( " name " ) . toLowerCase ( ) , d = b . get ( " name " ) . toLowerCase ( ) ; return this . sortOptions . desc = = = ! 0 ? d > c ? 1 : c > d ? - 1 : 0 : c > d ? 1 : d > c ? - 1 : 0 } , parse : function ( a ) { return a ? _ . map ( a . result , function ( a ) { return { name : a } } ) : void 0 } , initialize : function ( ) { var a = this ; this . fetch ( ) . done ( function ( ) { a . sort ( ) } ) } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , getDatabases : function ( ) { var a = this ; return this . fetch ( ) . done ( function ( ) { a . sort ( ) } ) , this . models } , getDatabasesForUser : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : this . url + " / user " , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b . result . sort ( ) ) } , error : function ( ) { a ( ! 0 , [ ] ) } } ) } , createDatabaseURL : function ( a , b , c ) { var d = window . location , e = window . location . hash ; b = b ? " SSL " = = = b | | " https : " = = = b ? " https : " : " http : " : d . protocol , c = c | | d . port ; var f = b + " / / " + window . location . hostname + " : " + c + " / _db / " + encodeURIComponent ( a ) + " / _admin / aardvark / standalone . html " ; if ( e ) { var g = e . split ( " / " ) [ 0 ] ; 0 = = = g . indexOf ( " # collection " ) & & ( g = " # collections " ) , 0 = = = g . indexOf ( " # service " ) & & ( g = " # services " ) , f + = g } return f } , getCurrentDatabase : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : this . url + " / current " , contentType : " application / json " , processData : ! 1 , success : function ( b ) { 200 = = = b . code ? a ( ! 1 , b . result . name ) : a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , hasSystemAccess : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " DB " , " Could not fetch databases " ) : a ( ! 1 , _ . contains ( c , " _system " ) ) } . bind ( this ) ; this . getDatabasesForUser ( b ) } } ) } ( ) , window . arangoDocument = Backbone . Collection . extend ( { url : " / _api / document / " , model : arangoDocumentModel , collectionInfo : { } , deleteEdge : function ( a , b , c ) { this . deleteDocument ( a , b , c ) } , deleteDocument : function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , contentType : " application / json " , url : arangoHelper . databaseUrl ( " / _api / document / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , success : function ( ) { c ( ! 1 ) } , error : function ( ) { c ( ! 0 ) } } ) } , addDocument : function ( a , b ) { var c = this ; c . createTypeDocument ( a , b ) } , createTypeEdge : function ( a , b , c , d , e ) { var f ; f = d ? JSON . stringify ( { _key : d , _from : b , _to : c } ) : JSON . stringify ( { _from : b , _to : c } ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / document ? collection = " + encodeURIComponent ( a ) ) , data : f , contentType : " application / json " , processData : ! 1 , success : function ( a ) { e ( ! 1 , a ) } , error : function ( a ) { e ( ! 0 , a ) } } ) } , createTypeDocument : function ( a , b , c ) { var d ; d = b ? JSON . stringify ( { _key : b } ) : JSON . stringify ( { } ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / document ? collection = " + encodeURIComponent ( a ) ) , data : d , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( ! 1 , a . _id ) } , error : function ( a ) { c ( ! 0 , a . _id ) } } ) } , getCollectionInfo : function ( a , b , c ) { var d = this ; $ . ajax ( { cache : ! 1 , type : " GET " , url : arangoHelper . databaseUrl ( " / _api / collection / " + a + " ? " + arangoHelper . getRandomToken ( ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d . collectionInfo = a , b ( ! 1 , a , c ) } , error : function ( a ) { b ( ! 0 , a , c ) } } ) } , getEdge : function ( a , b , c ) { this . getDocument ( a , b , c ) } , getDocument : function ( a , b , c ) { var d = this ; this . clearDocument ( ) , $ . ajax ( { cache : ! 1 , type : " GET " , url : arangoHelper . databaseUrl ( " / _api / document / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d . add ( a ) , c ( ! 1 , a , " document " ) } , error : function ( a ) { d . add ( ! 0 , a ) } } ) } , saveEdge : function ( a , b , c , d ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / edge / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , data : c , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d ( ! 1 , a ) } , error : function ( a ) { d ( ! 0 , a ) } } ) } , saveDocument : function ( a , b , c , d ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / document / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , data : c , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d ( ! 1 , a ) } , error : function ( a ) { d ( ! 0 , a ) } } ) } , updateLocalDocument : function ( a ) { this . clearDocument ( ) , this . add ( a ) } , clearDocument : function ( ) { this . reset ( ) } } ) , function ( ) { " use strict " ; window . arangoDocuments = window . PaginatedCollection . extend ( { collectionID : 1 , filters : [ ] , checkCursorTimer : void 0 , MAX_SORT : 12e3 , lastQuery : { } , sortAttribute : " " , url : arangoHelper . databaseUrl ( " / _api / documents " ) , model : window . arangoDocumentModel , loadTotal : function ( a ) { var b = this ; $ . ajax ( { cache : ! 1 , type : " GET " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . collectionID + " / count " ) , contentType : " application / json " , processData : ! 1 , success : function ( c ) { b . setTotal ( c . count ) , a ( ! 1 ) } , error : function ( ) { a ( ! 0 ) } } ) } , setCollection : function ( a ) { var b = function ( a ) { a & & arangoHelper . arangoError ( " Documents " , " Could not fetch documents count " ) } . bind ( this ) ; this . resetFilter ( ) , this . collectionID = a , this . setPage ( 1 ) , this . loadTotal ( b ) } , setSort : function ( a ) { this . sortAttribute = a } , getSort : function ( ) { return this . sortAttribute } , addFilter : function ( a , b , c ) { this . filters . push ( { attr : a , op : b , val : c } ) } , setFiltersForQuery : function ( a ) { if ( 0 = = = this . filters . length ) return " " ; var b = " FILTER " , c = " " , d = _ . map ( this . filters , function ( b , d ) { return " LIKE " = = = b . op ? ( c = " " + b . op + " ( x . ` " + b . attr + " ` , @ param " , c + = d , c + = " ) " ) : ( c = " IN " = = = b . op | | " NOT IN " = = = b . op ? " " : " x . ` " , c + = b . attr , c + = " IN " = = = b . op | | " NOT IN " = = = b . op ? " " : " ` " , c + = b . op , c + = " IN " = = = b . op | | " NOT IN " = = = b . op ? " x . @ param " : " @ param " , c + = d ) , a [ " param " + d ] = b . val , c } ) ; return b + d . join ( " & & " ) } , setPagesize : function ( a ) { this . setPageSize ( a ) } , resetFilter : function ( ) { this . filters = [ ] } , moveDocument : function ( a , b , c , d ) { var e , f , g , h , i = { " @ collection " : b , filterid : a } ; e = " FOR x IN @ @ collection " , e + = " FILTER x . _key = = @ filterid " , e + = " INSERT x IN " , e + = c , f = " FOR x in @ @ collection " , f + = " FILTER x . _key = = @ filterid " , f + = " REMOVE x IN @ @ collection " , g = { query : e , bindVars : i } , h = { query : f , bindVars : i } , window . progressView . show ( ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , data : JSON . stringify ( g ) , contentType : " application / json " , success : function ( ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , data : JSON . stringify ( h ) , contentType : " application / json " , success : function ( ) { d & & d ( ) , window . progressView . hide ( ) } , error : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Documents inserted , but could not be removed . " ) } } ) } , error : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Could not move selected documents . " ) } } ) } , getDocuments : function ( a ) { var b , c , d , e , f = this ; c = { " @ collection " : this . collectionID , offset : this . getOffset ( ) , count : this . getPageSize ( ) } , b = " FOR x IN @ @ collection LET att = SLICE ( ATTRIBUTES ( x ) , 0 , 25 ) " , b + = this . setFiltersForQuery ( c ) , this . getTotal ( ) < this . MAX_SORT & & ( " _key " = = = this . getSort ( ) ? b + = " SORT TO_NUMBER ( x . " + this . getSort ( ) + " ) = = 0 ? x . " + this . getSort ( ) + " : TO_NUMBER ( x . " + this . getSort ( ) + " ) " : " " ! = = this . getSort ( ) & & ( b + = " SORT x . " + this . getSort ( ) ) ) , " all " ! = = c . count ? b + = " LIMIT @ offset , @ count RETURN KEEP ( x , att ) " : ( d = { " @ collection " : this . collectionID } , c = d , b + = " RETURN KEEP ( x , att ) " ) , e = { query : b , bindVars : c } ; var g = function ( b ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( b ) ) , contentType : " application / json " , success : function ( c , d , h ) { 201 = = = h . status ? ( window . progressView . toShow = ! 1 , f . clearDocuments ( ) , c . extra & & void 0 ! = = c . extra . stats . fullCount & & f . setTotal ( c . extra . stats . fullCount ) , 0 ! = = f . getTotal ( ) & & _ . each ( c . result , function ( a ) { f . add ( { id : a . _id , rev : a . _rev , key : a . _key , content : a } ) } ) , f . lastQuery = e , a ( ! 1 , c ) ) : 204 = = = h . status & & ( f . checkCursorTimer = window . setTimeout ( function ( ) { g ( b ) } , 500 ) ) } , error : function ( b ) { a ( ! 1 , b ) } } ) } ; $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , data : JSON . stringify ( e ) , headers : { " x - arango - async " : " store " } , contentType : " application / json " , success : function ( b , c , d ) { if ( d . getResponseHeader ( " x - arango - async - id " ) ) { var e = d . getResponseHeader ( " x - arango - async - id " ) , h = function ( ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( e ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( f . checkCursorTimer ) , arangoHelper . arangoNotification ( " Documents " , " Canceled operation . " ) , $ ( " . dataTables_empty " ) . text ( " Canceled . " ) , window . progressView . hide ( ) } } ) } ; window . progressView . showWithDelay ( 300 , " Fetching documents . . . " , h ) , g ( e ) } else a ( ! 0 , b ) } , error : function ( b ) { a ( ! 1 , b ) } } ) } , clearDocuments : function ( ) { this . reset ( ) } , buildDownloadDocumentQuery : function ( ) { var a , b , c ; return c = { " @ collection " : this . collectionID } , a = " FOR x in @ @ collection " , a + = this . setFiltersForQuery ( c ) , this . getTotal ( ) < this . MAX_SORT & & this . getSort ( ) . length > 0 & & ( a + = " SORT x . " + this . getSort ( ) ) , a + = " RETURN x " , b = { query : a , bindVars : c } } , uploadDocuments : function ( a , b ) { $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / import ? type = auto & collection = " + encodeURIComponent ( this . collectionID ) + " & createCollection = false " ) , data : a , processData : ! 1 , contentType : " json " , dataType : " json " , complete : function ( a ) { if ( 4 = = = a . readyState & & 201 = = = a . status ) b ( ! 1 ) ; else try { var c = JSON . parse ( a . responseText ) ; if ( c . errors > 0 ) { var d = " At least one error occurred during upload " ; b ( ! 1 , d ) } } catch ( e ) { console . log ( e ) } } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ArangoLogs = window . PaginatedCollection . extend ( { upto : ! 1 , loglevel : 0 , totalPages : 0 , parse : function ( a ) { var b = [ ] ; return _ . each ( a . lid , function ( c , d ) { b . push ( { level : a . level [ d ] , lid : c , text : a . text [ d ] , timestamp : a . timestamp [ d ] , totalAmount : a . totalAmount } ) } ) , this . totalAmount = a . totalAmount , this . totalPages = Math . ceil ( this . totalAmount / this . pagesize ) , b } , initialize : function ( a ) { a . upto = = = ! 0 & & ( this . upto = ! 0 ) , this . loglevel = a . loglevel } , model : window . newArangoLog , url : function ( ) { var a , b , c , d ; c = this . page * this . pagesize ; var e = this . totalAmount - ( this . page + 1 ) * this . pagesize ; return 0 > e & & this . page = = = this . totalPages - 1 ? ( e = 0 , d = this . totalAmount % this . pagesize ) : d = this . pagesize , 0 = = = this . totalAmount & & ( d = 1 ) , a = this . upto ? " upto " : " level " , b = " / _admin / log ? " + a + " = " + this . loglevel + " & size = " + d + " & offset = " + e , arangoHelper . databaseUrl ( b ) } } ) } ( ) , function ( ) { " use strict " ; window . ArangoQueries = Backbone . Collection . extend ( { initialize : function ( a , b ) { var c = this ; $ . ajax ( " whoAmI ? _ = " + Date . now ( ) , { async : ! 0 } ) . done ( function ( a ) { this . activeUser = = = ! 1 ? c . activeUser = " root " : c . activeUser = a . user } ) } , url : arangoHelper . databaseUrl ( " / _api / user / " ) , model : ArangoQuery , activeUser : null , parse : function ( a ) { var b , c = this ; return this . activeUser = = = ! 1 & & ( this . activeUser = " root " ) , _ . each ( a . result , function ( a ) { if ( a . user = = = c . activeUser ) try { a . extra . queries & & ( b = a . extra . queries ) } catch ( d ) { } } ) , b } , saveCollectionQueries : function ( a ) { if ( 0 = = = this . activeUser ) return ! 1 ; this . activeUser = = = ! 1 & & ( this . activeUser = " root " ) ; var b = [ ] ; this . each ( function ( a ) { b . push ( { value : a . attributes . value , parameter : a . attributes . parameter , name : a . attributes . name } ) } ) , $ . ajax ( { cache : ! 1 , type : " PATCH " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( this . activeUser ) ) , data : JSON . stringify ( { extra : { queries : b } } ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( ) { a ( ! 0 ) } } ) } , saveImportQueries : function ( a , b ) { return 0 = = = this . activeUser ? ! 1 : ( window . progressView . show ( " Fetching documents . . . " ) , void $ . ajax ( { cache : ! 1 , type : " POST " , url : " query / upload / " + encodeURIComponent ( this . activeUser ) , data : a , contentType : " application / json " , processData : ! 1 , success : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoNotification ( " Queries successfully imported . " ) , b ( ) } , error : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoError ( " Query error " , " queries could not be imported " ) } } ) ) } } ) } ( ) , window . ArangoReplication = Backbone . Collection . extend ( { model : window . Replication , url : " . . / api / user " , getLogState : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / replication / logger - state " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , getApplyState : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / replication / applier - state " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } } ) , window . StatisticsCollection = Backbone . Collection . extend ( { model : window . Statistics , url : " / _admin / statistics " } ) , window . StatisticsDescriptionCollection = Backbone . Collection . extend ( { model : window . StatisticsDescription , url : " / _admin / statistics - description " , parse : function ( a ) { return a } } ) , window . ArangoUsers = Backbone . Collection . extend ( { model : window . Users , activeUser : null , activeUserSettings : { query : { } , shell : { } , testing : ! 0 } , sortOptions : { desc : ! 1 } , url : frontendConfig . basePath + " / _api / user " , comparator : function ( a , b ) { var c = a . get ( " user " ) . toLowerCase ( ) , d = b . get ( " user " ) . toLowerCase ( ) ; return this . sortOptions . desc = = = ! 0 ? d > c ? 1 : c > d ? - 1 : 0 : c > d ? 1 : d > c ? - 1 : 0 } , login : function ( a , b , c ) { var d = this ; $ . ajax ( " login " , { method : " POST " , data : JSON . stringify ( { username : a , password : b } ) , dataType : " json " } ) . success ( function ( a ) { d . activeUser = a . user , c ( ! 1 , d . activeUser ) } ) . error ( function ( ) { d . activeUser = null , c ( ! 0 , null ) } ) } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , logout : function ( ) { $ . ajax ( " logout " , { method : " POST " } ) , this . activeUser = null , this . reset ( ) , window . App . navigate ( " " ) , window . location . reload ( ) } , setUserSettings : function ( a , b ) { this . activeUserSettings . identifier = b } , loadUserSettings : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : frontendConfig . basePath + " / _api / user / " + encodeURIComponent ( b . activeUser ) , contentType : " application / json " , processData : ! 1 , success : function ( c ) { b . activeUserSettings = c . extra , a ( ! 1 , c ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , saveUserSettings : function ( a ) { var b = this ; $ . ajax ( { cache : ! 1 , type : " PUT " , url : frontendConfig . basePath + " / _api / user / " + encodeURIComponent ( b . activeUser ) , data : JSON . stringify ( { extra : b . activeUserSettings } ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , parse : function ( a ) { var b = [ ] ; return _ . each ( a . result , function ( a ) { b . push ( a ) } ) , b } , whoAmI : function ( a ) { return this . activeUser ? void a ( ! 1 , this . activeUser ) : void $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a ( ! 1 , b . user ) } ) . error ( function ( b ) { a ( ! 0 , null ) } ) } } ) , function ( ) { " use strict " ; window . ClusterCoordinators = window . AutomaticRetryCollection . extend ( { model : window . ClusterCoordinator , url : arangoHelper . databaseUrl ( " / _admin / aardvark / cluster / Coordinators " ) , updateUrl : function ( ) { this . url = window . App . getNewRoute ( " Coordinators " ) } , initialize : function ( ) { } , statusClass : function ( a ) { switch ( a ) { case " ok " : return " success " ; case " warning " : return " warning " ; case " critical " : return " danger " ; case " missing " : return " inactive " ; default : return " danger " } } , getStatuses : function ( a , b ) { if ( this . checkRetries ( ) ) { var c = this ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : c . failureTry . bind ( c , c . getStatuses . bind ( c , a , b ) ) } ) . done ( function ( ) { c . successFullTry ( ) , c . forEach ( function ( b ) { a ( c . statusClass ( b . get ( " status " ) ) , b . get ( " address " ) ) } ) , b ( ) } ) } } , byAddress : function ( a , b ) { if ( this . checkRetries ( ) ) { var c = this ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : c . failureTry . bind ( c , c . byAddress . bind ( c , a , b ) ) } ) . done ( function ( ) { c . successFullTry ( ) , a = a | | { } , c . forEach ( function ( b ) { var c = b . get ( " address " ) ; c = c . split ( " : " ) [ 0 ] , a [ c ] = a [ c ] | | { } , a [ c ] . coords = a [ c ] . coords | | [ ] , a [ c ] . coords . push ( b ) } ) , b ( a ) } ) } } , checkConnection : function ( a ) { var b = this ; this . checkRetries ( ) & & this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : b . failureTry . bind ( b , b . checkConnection . bind ( b , a ) ) } ) . done ( function ( ) { b . successFullTry ( ) , a ( ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . ClusterServers = window . AutomaticRetryCollection . extend ( { model : window . ClusterServer , host : " " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / cluster / DBServers " ) , updateUrl : function ( ) { this . url = window . App . getNewRoute ( this . host ) + this . url } , initialize : function ( a , b ) { this . host = b . host } , statusClass : function ( a ) { switch ( a ) { case " ok " : return " success " ; case " warning " : return " warning " ; case " critical " : return " danger " ; case " missing " : return " inactive " ; default : return " danger " } } , getStatuses : function ( a ) { if ( this . checkRetries ( ) ) { var b = this , c = function ( ) { b . successFullTry ( ) , b . _retryCount = 0 , b . forEach ( function ( c ) { a ( b . statusClass ( c . get ( " status " ) ) , c . get ( " address " ) ) } ) } ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : b . failureTry . bind ( b , b . getStatuses . bind ( b , a ) ) } ) . done ( c ) } } , byAddress : function ( a , b ) { if ( this . checkRetries ( ) ) { var c = this ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : c . failureTry . bind ( c , c . byAddress . bind ( c , a , b ) ) } ) . done ( function ( ) { c . successFullTry ( ) , a = a | | { } , c . forEach ( function ( b ) { var c = b . get ( " address " ) ; c = c . split ( " : " ) [ 0 ] , a [ c ] = a [ c ] | | { } , a [ c ] . dbs = a [ c ] . dbs | | [ ] , a [ c ] . dbs . push ( b ) } ) , b ( a ) } ) . error ( function ( a ) { console . log ( " error " ) , console . log ( a ) } ) } } , getList : function ( ) { throw " Do not use " } , getOverview : function ( ) { throw " Do not use DbServer . getOverview " } } ) } ( ) , function ( ) { " use strict " ; window . CoordinatorCollection = Backbone . Collection . extend ( { model : window . Coordinator , url : arangoHelper . databaseUrl ( " / _admin / aardvark / cluster / Coordinators " ) } ) } ( ) , function ( ) { " use strict " ; window . FoxxCollection = Backbone . Collection . extend ( { model : window . Foxx , sortOptions : { desc : ! 1 } , url : arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes " ) , comparator : function ( a , b ) { var c , d ; return this . sortOptions . desc = = = ! 0 ? ( c = a . get ( " mount " ) , d = b . get ( " mount " ) , d > c ? 1 : c > d ? - 1 : 0 ) : ( c = a . get ( " mount " ) , d = b . get ( " mount " ) , c > d ? 1 : d > c ? - 1 : 0 ) } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , installFromGithub : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / git ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } , installFromStore : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / store ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } , installFromZip : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / zip ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( { zipFile : a } ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } , generate : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / generate ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . GraphCollection = Backbone . Collection . extend ( { model : window . Graph , sortOptions : { desc : ! 1 } , url : frontendConfig . basePath + " / _api / gharial " , dropAndDeleteGraph : function ( a , b ) { $ . ajax ( { type : " DELETE " , url : frontendConfig . basePath + " / _api / gharial / " + encodeURIComponent ( a ) + " ? dropCollections = true " , contentType : " application / json " , processData : ! 0 , success : function ( ) { b ( ! 0 ) } , error : function ( ) { b ( ! 1 ) } } ) } , comparator : function ( a , b ) { var c = a . get ( " _key " ) | | " " , d = b . get ( " _key " ) | | " " ; return c = c . toLowerCase ( ) , d = d . toLowerCase ( ) , this . sortOptions . desc = = = ! 0 ? d > c ? 1 : c > d ? - 1 : 0 : c > d ? 1 : d > c ? - 1 : 0 } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , parse : function ( a ) { return a . error ? void 0 : a . graphs } } ) } ( ) , function ( ) { " use strict " ; window . NotificationCollection = Backbone . Collection . extend ( { model : window . Notification , url : " " } ) } ( ) , function ( ) { " use strict " ; window . QueryManagementActive = Backbone . Collection . extend ( { model : window . queryManagementModel , url : function ( ) { return frontendConfig . basePath + " / _api / query / current " } , killRunningQuery : function ( a , b ) { $ . ajax ( { url : frontendConfig . basePath + " / _api / query / " + encodeURIComponent ( a ) , type : " DELETE " , success : function ( a ) { b ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . QueryManagementSlow = Backbone . Collection . extend ( { model : window . queryManagementModel , url : " / _api / query / slow " , deleteSlowQueryHistory : function ( a ) { var b = this ; $ . ajax ( { url : b . url , type : " DELETE " , success : function ( b ) { a ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . WorkMonitorCollection = Backbone . Collection . extend ( { model : window . workMonitorModel , url : " / _admin / work - monitor " , parse : function ( a ) { return a . work } } ) } ( ) , function ( ) { " use strict " ; <nl> - window . PaginationView = Backbone . View . extend ( { collection : null , paginationDiv : " " , idPrefix : " " , rerender : function ( ) { } , jumpTo : function ( a ) { this . collection . setPage ( a ) , this . rerender ( ) } , firstPage : function ( ) { this . jumpTo ( 1 ) } , lastPage : function ( ) { this . jumpTo ( this . collection . getLastPageNumber ( ) ) } , firstDocuments : function ( ) { this . jumpTo ( 1 ) } , lastDocuments : function ( ) { this . jumpTo ( this . collection . getLastPageNumber ( ) ) } , prevDocuments : function ( ) { this . jumpTo ( this . collection . getPage ( ) - 1 ) } , nextDocuments : function ( ) { this . jumpTo ( this . collection . getPage ( ) + 1 ) } , renderPagination : function ( ) { $ ( this . paginationDiv ) . html ( " " ) ; var a = this , b = this . collection . getPage ( ) , c = this . collection . getLastPageNumber ( ) , d = $ ( this . paginationDiv ) , e = { page : b , lastPage : c , click : function ( b ) { var c = window . location . hash . split ( " / " ) ; " documents " = = = c [ 2 ] ? ( e . page = b , window . location . hash = c [ 0 ] + " / " + c [ 1 ] + " / " + c [ 2 ] + " / " + b ) : ( a . jumpTo ( b ) , e . page = b ) } } ; d . html ( " " ) , d . pagination ( e ) , $ ( this . paginationDiv ) . prepend ( ' < ul class = " pre - pagi " > < li > < a id = " ' + this . idPrefix + ' _first " class = " pagination - button " > < span > < i class = " fa fa - angle - double - left " / > < / span > < / a > < / li > < / ul > ' ) , $ ( this . paginationDiv ) . append ( ' < ul class = " las - pagi " > < li > < a id = " ' + this . idPrefix + ' _last " class = " pagination - button " > < span > < i class = " fa fa - angle - double - right " / > < / span > < / a > < / li > < / ul > ' ) } } ) } ( ) , function ( ) { " use strict " ; window . ApplicationDetailView = Backbone . View . extend ( { el : " # content " , divs : [ " # readme " , " # swagger " , " # app - info " , " # sideinformation " , " # information " , " # settings " ] , navs : [ " # service - info " , " # service - api " , " # service - readme " , " # service - settings " ] , template : templateEngine . createTemplate ( " applicationDetailView . ejs " ) , events : { " click . open " : " openApp " , " click . delete " : " deleteApp " , " click # app - deps " : " showDepsDialog " , " click # app - switch - mode " : " toggleDevelopment " , " click # app - scripts [ data - script ] " : " runScript " , " click # app - tests " : " runTests " , " click # app - replace " : " replaceApp " , " click # download - app " : " downloadApp " , " click . subMenuEntries li " : " changeSubview " , " mouseenter # app - scripts " : " showDropdown " , " mouseleave # app - scripts " : " hideDropdown " } , changeSubview : function ( a ) { _ . each ( this . navs , function ( a ) { $ ( a ) . removeClass ( " active " ) } ) , $ ( a . currentTarget ) . addClass ( " active " ) , _ . each ( this . divs , function ( a ) { $ ( " . headerButtonBar " ) . hide ( ) , $ ( a ) . hide ( ) } ) , " service - readme " = = = a . currentTarget . id ? $ ( " # readme " ) . show ( ) : " service - api " = = = a . currentTarget . id ? $ ( " # swagger " ) . show ( ) : " service - info " = = = a . currentTarget . id ? ( this . render ( ) , $ ( " # information " ) . show ( ) , $ ( " # sideinformation " ) . show ( ) ) : " service - settings " = = = a . currentTarget . id & & ( this . showConfigDialog ( ) , $ ( " . headerButtonBar " ) . show ( ) , $ ( " # settings " ) . show ( ) ) } , downloadApp : function ( ) { this . model . isSystem ( ) | | this . model . download ( ) } , replaceApp : function ( ) { var a = this . model . get ( " mount " ) ; window . foxxInstallView . upgrade ( a , function ( ) { window . App . applicationDetail ( encodeURIComponent ( a ) ) } ) , $ ( " . createModalDialog . arangoHeader " ) . html ( " Replace Service " ) , $ ( " # infoTab " ) . click ( ) } , updateConfig : function ( ) { this . model . getConfiguration ( function ( ) { $ ( " # app - warning " ) [ this . model . needsAttention ( ) ? " show " : " hide " ] ( ) , $ ( " # app - warning - config " ) [ this . model . needsConfiguration ( ) ? " show " : " hide " ] ( ) , this . model . needsConfiguration ( ) ? $ ( " # app - config " ) . addClass ( " error " ) : $ ( " # app - config " ) . removeClass ( " error " ) } . bind ( this ) ) } , updateDeps : function ( ) { this . model . getDependencies ( function ( ) { $ ( " # app - warning " ) [ this . model . needsAttention ( ) ? " show " : " hide " ] ( ) , $ ( " # app - warning - deps " ) [ this . model . hasUnconfiguredDependencies ( ) ? " show " : " hide " ] ( ) , this . model . hasUnconfiguredDependencies ( ) ? $ ( " # app - deps " ) . addClass ( " error " ) : $ ( " # app - deps " ) . removeClass ( " error " ) } . bind ( this ) ) } , toggleDevelopment : function ( ) { this . model . toggleDevelopment ( ! this . model . isDevelopment ( ) , function ( ) { this . model . isDevelopment ( ) ? ( $ ( " . app - switch - mode " ) . text ( " Set Production " ) , $ ( " # app - development - indicator " ) . css ( " display " , " inline " ) , $ ( " # app - development - path " ) . css ( " display " , " inline " ) ) : ( $ ( " . app - switch - mode " ) . text ( " Set Development " ) , $ ( " # app - development - indicator " ) . css ( " display " , " none " ) , $ ( " # app - development - path " ) . css ( " display " , " none " ) ) } . bind ( this ) ) } , runScript : function ( a ) { a . preventDefault ( ) ; var b = $ ( a . currentTarget ) . attr ( " data - script " ) , c = [ window . modalView . createBlobEntry ( " app_script_arguments " , " Script arguments " , " " , null , " optional " , ! 1 , [ { rule : function ( a ) { return a & & JSON . parse ( a ) } , msg : " Must be well - formed JSON or empty " } ] ) ] , d = [ window . modalView . createSuccessButton ( " Run script " , function ( ) { var a = $ ( " # app_script_arguments " ) . val ( ) ; a = a & & JSON . parse ( a ) , window . modalView . hide ( ) , this . model . runScript ( b , a , function ( a , c ) { var d ; d = a ? " < p > The script failed with an error " + ( a . statusCode ? " ( HTTP " + a . statusCode + " ) " : " " ) + " : < / p > < pre > " + a . message + " < / pre > " : c ? " < p > Script results : < / p > < pre > " + JSON . stringify ( c , null , 2 ) + " < / pre > " : " < p > The script ran successfully . < / p > " , window . modalView . show ( " modalTable . ejs " , ' Result of script " ' + b + ' " ' , void 0 , void 0 , void 0 , d ) } ) } . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , ' Run script " ' + b + ' " on " ' + this . model . get ( " mount " ) + ' " ' , d , c ) } , showSwagger : function ( a ) { a . preventDefault ( ) , this . render ( " swagger " ) } , showReadme : function ( a ) { a . preventDefault ( ) , this . render ( " readme " ) } , runTests : function ( a ) { a . preventDefault ( ) ; var b = " < p > < strong > WARNING : < / strong > Running tests may result in destructive side - effects including data loss . Please make sure not to run tests on a production database . < / p > " ; this . model . isDevelopment ( ) & & ( b + = " < p > < strong > WARNING : < / strong > This app is running in < strong > development mode < / strong > . If any of the tests access the app ' s HTTP API they may become non - deterministic . < / p > " ) ; var c = [ window . modalView . createSuccessButton ( " Run tests " , function ( ) { window . modalView . hide ( ) , this . model . runTests ( { reporter : " suite " } , function ( a , b ) { window . modalView . show ( " modalTestResults . ejs " , " Test results " , void 0 , void 0 , void 0 , a | | b ) } ) } . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , ' Run tests for app " ' + this . model . get ( " mount " ) + ' " ' , c , void 0 , void 0 , b ) } , render : function ( a ) { var b = function ( b , c ) { var d = this ; b ? arangoHelper . arangoError ( " DB " , " Could not get current database " ) : ( $ ( this . el ) . html ( this . template . render ( { app : this . model , db : c , mode : a } ) ) , $ . get ( this . appUrl ( c ) ) . success ( function ( ) { $ ( " . open " , this . el ) . prop ( " disabled " , ! 1 ) } . bind ( this ) ) , this . updateConfig ( ) , this . updateDeps ( ) , " swagger " = = = a & & $ . get ( " . / foxxes / docs / swagger . json ? mount = " + encodeURIComponent ( this . model . get ( " mount " ) ) , function ( a ) { Object . keys ( a . paths ) . length < 1 & & ( d . render ( " readme " ) , $ ( " # app - show - swagger " ) . attr ( " disabled " , " true " ) ) } ) ) , this . breadcrumb ( ) } . bind ( this ) ; return arangoHelper . currentDatabase ( b ) , _ . isEmpty ( this . model . get ( " config " ) ) & & $ ( " # service - settings " ) . attr ( " disabled " , ! 0 ) , $ ( this . el ) } , breadcrumb : function ( ) { var a = " Service : " + this . model . get ( " name " ) + ' < i class = " fa fa - ellipsis - v " aria - hidden = " true " > < / i > ' , b = ' < p class = " mount " > < span > Contributors : < / span > ' ; this . model . get ( " contributors " ) & & this . model . get ( " contributors " ) . length > 0 ? _ . each ( this . model . get ( " contributors " ) , function ( a ) { b + = ' < a href = " mailto : ' + a . email + ' " > ' + a . name + " < / a > " } ) : b + = " No contributors " , b + = " < / p > " , $ ( " . information " ) . append ( b ) , this . model . get ( " author " ) & & $ ( " . information " ) . append ( ' < p class = " mount " > < span > Author : < / span > ' + this . model . get ( " author " ) + " < / p > " ) , this . model . get ( " mount " ) & & $ ( " . information " ) . append ( ' < p class = " mount " > < span > Mount : < / span > ' + this . model . get ( " mount " ) + " < / p > " ) , this . model . get ( " development " ) & & this . model . get ( " path " ) & & $ ( " . information " ) . append ( ' < p class = " path " > < span > Path : < / span > ' + this . model . get ( " path " ) + " < / p > " ) , $ ( " # subNavigationBar . breadcrumb " ) . html ( a ) } , openApp : function ( ) { var a = function ( a , b ) { a ? arangoHelper . arangoError ( " DB " , " Could not get current database " ) : window . open ( this . appUrl ( b ) , this . model . get ( " title " ) ) . focus ( ) } . bind ( this ) ; arangoHelper . currentDatabase ( a ) } , deleteApp : function ( ) { var a = [ window . modalView . createDeleteButton ( " Delete " , function ( ) { var a = { teardown : $ ( " # app_delete_run_teardown " ) . is ( " : checked " ) } ; this . model . destroy ( a , function ( a , b ) { a | | b . error ! = = ! 1 | | ( window . modalView . hide ( ) , window . App . navigate ( " services " , { trigger : ! 0 } ) ) } ) } . bind ( this ) ) ] , b = [ window . modalView . createCheckboxEntry ( " app_delete_run_teardown " , " Run teardown ? " , ! 0 , " Should this app ' s teardown script be executed before removing the app ? " , ! 0 ) ] ; window . modalView . show ( " modalTable . ejs " , ' Delete Foxx App mounted at " ' + this . model . get ( " mount " ) + ' " ' , a , b , void 0 , " < p > Are you sure ? There is no way back . . . < / p > " , ! 0 ) } , appUrl : function ( a ) { return window . location . origin + " / _db / " + encodeURIComponent ( a ) + this . model . get ( " mount " ) } , applyConfig : function ( ) { var a = { } ; _ . each ( this . model . get ( " config " ) , function ( b , c ) { var d = $ ( " # app_config_ " + c ) , e = d . val ( ) ; if ( " boolean " = = = b . type | | " bool " = = = b . type ) return void ( a [ c ] = d . is ( " : checked " ) ) ; if ( " " = = = e & & b . hasOwnProperty ( " default " ) ) return a [ c ] = b [ " default " ] , void ( " json " = = = b . type & & ( a [ c ] = JSON . stringify ( b [ " default " ] ) ) ) ; if ( " number " = = = b . type ) a [ c ] = parseFloat ( e ) ; else if ( " integer " = = = b . type | | " int " = = = b . type ) a [ c ] = parseInt ( e , 10 ) ; else { if ( " json " ! = = b . type ) return void ( a [ c ] = window . arangoHelper . escapeHtml ( e ) ) ; a [ c ] = e & & JSON . stringify ( JSON . parse ( e ) ) } } ) , this . model . setConfiguration ( a , function ( ) { this . updateConfig ( ) , arangoHelper . arangoNotification ( this . model . get ( " name " ) , " Settings applied . " ) } . bind ( this ) ) } , showConfigDialog : function ( ) { if ( _ . isEmpty ( this . model . get ( " config " ) ) ) return void $ ( " # settings . buttons " ) . html ( $ ( " # hidden_buttons " ) . html ( ) ) ; var a = _ . map ( this . model . get ( " config " ) , function ( a , b ) { var c = void 0 = = = a [ " default " ] ? " " : String ( a [ " default " ] ) , d = void 0 = = = a . current ? " " : String ( a . current ) , e = " createTextEntry " , f = ! 1 , g = [ ] ; return " boolean " = = = a . type | | " bool " = = = a . type ? ( e = " createCheckboxEntry " , a [ " default " ] = a [ " default " ] | | ! 1 , c = a [ " default " ] | | ! 1 , d = a . current | | ! 1 ) : " json " = = = a . type ? ( e = " createBlobEntry " , c = void 0 = = = a [ " default " ] ? " " : JSON . stringify ( a [ " default " ] ) , d = void 0 = = = a . current ? " " : a . current , g . push ( { rule : function ( a ) { return a & & JSON . parse ( a ) } , msg : " Must be well - formed JSON or empty . " } ) ) : " integer " = = = a . type | | " int " = = = a . type ? g . push ( { rule : Joi . number ( ) . integer ( ) . optional ( ) . allow ( " " ) , msg : " Has to be an integer . " } ) : " number " = = = a . type ? g . push ( { rule : Joi . number ( ) . optional ( ) . allow ( " " ) , msg : " Has to be a number . " } ) : ( " password " = = = a . type & & ( e = " createPasswordEntry " ) , g . push ( { rule : Joi . string ( ) . optional ( ) . allow ( " " ) , msg : " Has to be a string . " } ) ) , void 0 = = = a [ " default " ] & & a . required ! = = ! 1 & & ( f = ! 0 , g . unshift ( { rule : Joi . any ( ) . required ( ) , msg : " This field is required . " } ) ) , window . modalView [ e ] ( " app_config_ " + b , b , d , a . description , c , f , g ) } ) , b = [ window . modalView . createSuccessButton ( " Apply " , this . applyConfig . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , " Configuration " , b , a , null , null , null , null , null , " settings " ) , $ ( " . modal - footer " ) . prepend ( $ ( " # hidden_buttons " ) . html ( ) ) } , applyDeps : function ( ) { var a = { } ; _ . each ( this . model . get ( " deps " ) , function ( b , c ) { var d = $ ( " # app_deps_ " + c ) ; a [ c ] = window . arangoHelper . escapeHtml ( d . val ( ) ) } ) , this . model . setDependencies ( a , function ( ) { window . modalView . hide ( ) , this . updateDeps ( ) } . bind ( this ) ) } , showDepsDialog : function ( ) { if ( ! _ . isEmpty ( this . model . get ( " deps " ) ) ) { var a = _ . map ( this . model . get ( " deps " ) , function ( a , b ) { var c = void 0 = = = a . current ? " " : String ( a . current ) , d = " " , e = a . definition . name ; " * " ! = = a . definition . version & & ( e + = " @ " + a . definition . version ) ; var f = [ { rule : Joi . string ( ) . optional ( ) . allow ( " " ) , msg : " Has to be a string . " } ] ; return a . definition . required & & f . push ( { rule : Joi . string ( ) . required ( ) , msg : " This value is required . " } ) , window . modalView . createTextEntry ( " app_deps_ " + b , a . title , c , e , d , a . definition . required , f ) } ) , b = [ window . modalView . createSuccessButton ( " Apply " , this . applyDeps . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , " Dependencies " , b , a ) } } , showDropdown : function ( ) { _ . isEmpty ( this . model . get ( " scripts " ) ) | | $ ( " # scripts_dropdown " ) . show ( 200 ) } , hideDropdown : function ( ) { $ ( " # scripts_dropdown " ) . hide ( ) } } ) } ( ) , function ( ) { " use strict " ; window . ApplicationsView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " applicationsView . ejs " ) , events : { " click # addApp " : " createInstallModal " , " click # foxxToggle " : " slideToggle " , " click # checkDevel " : " toggleDevel " , " click # checkProduction " : " toggleProduction " , " click # checkSystem " : " toggleSystem " } , fixCheckboxes : function ( ) { this . _showDevel ? $ ( " # checkDevel " ) . attr ( " checked " , " checked " ) : $ ( " # checkDevel " ) . removeAttr ( " checked " ) , this . _showSystem ? $ ( " # checkSystem " ) . attr ( " checked " , " checked " ) : $ ( " # checkSystem " ) . removeAttr ( " checked " ) , this . _showProd ? $ ( " # checkProduction " ) . attr ( " checked " , " checked " ) : $ ( " # checkProduction " ) . removeAttr ( " checked " ) , $ ( " # checkDevel " ) . next ( ) . removeClass ( " fa fa - check - square - o fa - square - o " ) . addClass ( " fa " ) , $ ( " # checkSystem " ) . next ( ) . removeClass ( " fa fa - check - square - o fa - square - o " ) . addClass ( " fa " ) , $ ( " # checkProduction " ) . next ( ) . removeClass ( " fa fa - check - square - o fa - square - o " ) . addClass ( " fa " ) , arangoHelper . setCheckboxStatus ( " # foxxDropdown " ) } , toggleDevel : function ( ) { var a = this ; this . _showDevel = ! this . _showDevel , _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " devel " , a . _showDevel ) } ) , this . fixCheckboxes ( ) } , toggleProduction : function ( ) { var a = this ; this . _showProd = ! this . _showProd , _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " production " , a . _showProd ) } ) , this . fixCheckboxes ( ) } , toggleSystem : function ( ) { this . _showSystem = ! this . _showSystem ; var a = this ; _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " system " , a . _showSystem ) } ) , this . fixCheckboxes ( ) } , reload : function ( ) { var a = this ; _ . each ( this . _installedSubViews , function ( a ) { a . undelegateEvents ( ) } ) , this . collection . fetch ( { success : function ( ) { a . createSubViews ( ) , a . render ( ) } } ) } , createSubViews : function ( ) { var a = this ; this . _installedSubViews = { } , a . collection . each ( function ( b ) { var c = new window . FoxxActiveView ( { model : b , appsView : a } ) ; a . _installedSubViews [ b . get ( " mount " ) ] = c } ) } , initialize : function ( ) { this . _installedSubViews = { } , this . _showDevel = ! 0 , this . _showProd = ! 0 , this . _showSystem = ! 1 } , slideToggle : function ( ) { $ ( " # foxxToggle " ) . toggleClass ( " activated " ) , $ ( " # foxxDropdownOut " ) . slideToggle ( 200 ) } , createInstallModal : function ( a ) { a . preventDefault ( ) , window . foxxInstallView . install ( this . reload . bind ( this ) ) } , render : function ( ) { this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { } ) ) , _ . each ( this . _installedSubViews , function ( a ) { $ ( " # installedList " ) . append ( a . render ( ) ) } ) , this . delegateEvents ( ) , $ ( " # checkDevel " ) . attr ( " checked " , this . _showDevel ) , $ ( " # checkProduction " ) . attr ( " checked " , this . _showProd ) , $ ( " # checkSystem " ) . attr ( " checked " , this . _showSystem ) , arangoHelper . setCheckboxStatus ( " # foxxDropdown " ) ; var a = this ; return _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " devel " , a . _showDevel ) , b . toggle ( " system " , a . _showSystem ) } ) , arangoHelper . fixTooltips ( " icon_arangodb " , " left " ) , this } } ) } ( ) , function ( ) { " use strict " ; window . ClusterView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " clusterView . ejs " ) , events : { } , statsEnabled : ! 1 , historyInit : ! 1 , initDone : ! 1 , interval : 5e3 , maxValues : 100 , knownServers : [ ] , chartData : { } , charts : { } , nvcharts : [ ] , startHistory : { } , startHistoryAccumulated : { } , initialize : function ( a ) { var b = this ; window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , window . setInterval ( function ( ) { if ( " # cluster " = = = window . location . hash | | " " = = = window . location . hash | | " # " = = = window . location . hash ) { var a = function ( a ) { b . rerenderValues ( a ) , b . rerenderGraphs ( a ) } ; b . getCoordStatHistory ( a ) } } , this . interval ) ) } , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) , this . initDone | | ( void 0 ! = = this . coordinators . first ( ) ? this . getServerStatistics ( ) : this . waitForCoordinators ( ) , this . initDone = ! 0 ) , this . initGraphs ( ) } , waitForCoordinators : function ( ) { var a = this ; window . setTimeout ( function ( ) { a . coordinators ? a . getServerStatistics ( ) : a . waitForCoordinators ( ) } , 500 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } , getServerStatistics : function ( ) { var a = this ; this . data = void 0 ; var b = this . coordinators . first ( ) ; this . statCollectCoord = new window . ClusterStatisticsCollection ( [ ] , { host : b . get ( " address " ) } ) , this . statCollectDBS = new window . ClusterStatisticsCollection ( [ ] , { host : b . get ( " address " ) } ) ; var c = [ ] ; _ . each ( this . dbServers , function ( a ) { a . each ( function ( a ) { c . push ( a ) } ) } ) , _ . each ( c , function ( c ) { if ( " ok " = = = c . get ( " status " ) ) { - 1 = = = a . knownServers . indexOf ( c . id ) & & a . knownServers . push ( c . id ) ; var d = new window . Statistics ( { name : c . id } ) ; d . url = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) + " / _admin / clusterStatistics ? DBserver = " + c . get ( " name " ) , a . statCollectDBS . add ( d ) } } ) , this . coordinators . forEach ( function ( b ) { if ( " ok " = = = b . get ( " status " ) ) { - 1 = = = a . knownServers . indexOf ( b . id ) & & a . knownServers . push ( b . id ) ; var c = new window . Statistics ( { name : b . id } ) ; c . url = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) + " / _admin / statistics " , a . statCollectCoord . add ( c ) } } ) ; var d = function ( b ) { a . rerenderValues ( b ) , a . rerenderGraphs ( b ) } . bind ( this ) ; a . getCoordStatHistory ( d ) , a . coordinators . fetch ( { success : function ( ) { a . renderNode ( ! 0 ) } , error : function ( ) { a . renderNode ( ! 1 ) } } ) } , rerenderValues : function ( a ) { var b = this ; this . coordinators . fetch ( { success : function ( ) { b . renderNode ( ! 0 ) } , error : function ( ) { b . renderNode ( ! 1 ) } } ) , this . renderValue ( " # clusterConnections " , Math . round ( a . clientConnectionsCurrent ) ) , this . renderValue ( " # clusterConnectionsAvg " , Math . round ( a . clientConnections15M ) ) ; var c = a . physicalMemory , d = a . residentSizeCurrent ; this . renderValue ( " # clusterRam " , [ d , c ] ) } , renderValue : function ( a , b , c ) { if ( " number " = = typeof b ) $ ( a ) . html ( b ) ; else if ( $ . isArray ( b ) ) { var d = b [ 0 ] , e = b [ 1 ] , f = 1 / ( e / d ) * 100 ; $ ( a ) . html ( f . toFixed ( 1 ) + " % " ) } else " string " = = typeof b & & $ ( a ) . html ( b ) ; c ? ( $ ( a ) . addClass ( " negative " ) , $ ( a ) . removeClass ( " positive " ) ) : ( $ ( a ) . addClass ( " positive " ) , $ ( a ) . removeClass ( " negative " ) ) } , renderNode : function ( a ) { var b = 0 , c = 0 ; if ( a ) if ( this . coordinators . each ( function ( a ) { " ok " = = = a . toJSON ( ) . status ? b + + : c + + } ) , c > 0 ) { var d = c + b ; this . renderValue ( " # clusterNodes " , b + " / " + d , ! 0 ) } else this . renderValue ( " # clusterNodes " , b ) ; else this . renderValue ( " # clusterNodes " , " OFFLINE " , ! 0 ) } , initValues : function ( ) { var a = [ " # clusterNodes " , " # clusterRam " , " # clusterConnections " , " # clusterConnectionsAvg " ] ; _ . each ( a , function ( a ) { $ ( a ) . html ( ' < i class = " fa fa - spin fa - circle - o - notch " style = " color : rgba ( 0 , 0 , 0 , 0 . 64 ) ; " > < / i > ' ) } ) } , graphData : { data : { sent : [ ] , received : [ ] } , http : [ ] , average : [ ] } , checkArraySizes : function ( ) { var a = this ; _ . each ( a . chartsOptions , function ( b , c ) { _ . each ( b . options , function ( b , d ) { b . values . length > a . maxValues - 1 & & a . chartsOptions [ c ] . options [ d ] . values . shift ( ) } ) } ) } , formatDataForGraph : function ( a ) { var b = this ; b . historyInit ? ( b . checkArraySizes ( ) , b . chartsOptions [ 0 ] . options [ 0 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : a . bytesSentPerSecond [ a . bytesSentPerSecond . length - 1 ] } ) , b . chartsOptions [ 0 ] . options [ 1 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : a . bytesReceivedPerSecond [ a . bytesReceivedPerSecond . length - 1 ] } ) , b . chartsOptions [ 1 ] . options [ 0 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : b . calcTotalHttp ( a . http , a . bytesSentPerSecond . length - 1 ) } ) , b . chartsOptions [ 2 ] . options [ 0 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : a . avgRequestTime [ a . bytesSentPerSecond . length - 1 ] / b . coordinators . length } ) ) : ( _ . each ( a . times , function ( c , d ) { b . chartsOptions [ 0 ] . options [ 0 ] . values . push ( { x : c , y : a . bytesSentPerSecond [ d ] } ) , b . chartsOptions [ 0 ] . options [ 1 ] . values . push ( { x : c , y : a . bytesReceivedPerSecond [ d ] } ) , b . chartsOptions [ 1 ] . options [ 0 ] . values . push ( { x : c , y : b . calcTotalHttp ( a . http , d ) } ) , b . chartsOptions [ 2 ] . options [ 0 ] . values . push ( { x : c , y : a . avgRequestTime [ d ] / b . coordinators . length } ) } ) , b . historyInit = ! 0 ) } , chartsOptions : [ { id : " # clusterData " , type : " bytes " , count : 2 , options : [ { area : ! 0 , values : [ ] , key : " Bytes out " , color : " rgb ( 23 , 190 , 207 ) " , strokeWidth : 2 , fillOpacity : . 1 } , { area : ! 0 , values : [ ] , key : " Bytes in " , color : " rgb ( 188 , 189 , 34 ) " , strokeWidth : 2 , fillOpacity : . 1 } ] } , { id : " # clusterHttp " , type : " bytes " , options : [ { area : ! 0 , values : [ ] , key : " Bytes " , color : " rgb ( 0 , 166 , 90 ) " , fillOpacity : . 1 } ] } , { id : " # clusterAverage " , data : [ ] , type : " seconds " , options : [ { area : ! 0 , values : [ ] , key : " Seconds " , color : " rgb ( 243 , 156 , 18 ) " , fillOpacity : . 1 } ] } ] , initGraphs : function ( ) { var a = this , b = " Fetching data . . . " ; a . statsEnabled = = = ! 1 & & ( b = " Statistics disabled . " ) , _ . each ( a . chartsOptions , function ( c ) { nv . addGraph ( function ( ) { a . charts [ c . id ] = nv . models . stackedAreaChart ( ) . options ( { useInteractiveGuideline : ! 0 , showControls : ! 1 , noData : b , duration : 0 } ) , a . charts [ c . id ] . xAxis . axisLabel ( " " ) . tickFormat ( function ( a ) { var b = new Date ( 1e3 * a ) ; return ( b . getHours ( ) < 10 ? " 0 " : " " ) + b . getHours ( ) + " : " + ( b . getMinutes ( ) < 10 ? " 0 " : " " ) + b . getMinutes ( ) + " : " + ( b . getSeconds ( ) < 10 ? " 0 " : " " ) + b . getSeconds ( ) } ) . staggerLabels ( ! 1 ) , a . charts [ c . id ] . yAxis . axisLabel ( " " ) . tickFormat ( function ( a ) { var b ; return " bytes " = = = c . type ? null = = = a ? " N / A " : ( b = parseFloat ( d3 . format ( " . 2f " ) ( a ) ) , prettyBytes ( b ) ) : " seconds " = = = c . type ? null = = = a ? " N / A " : b = parseFloat ( d3 . format ( " . 3f " ) ( a ) ) : void 0 } ) ; var d , e = a . returnGraphOptions ( c . id ) ; return e . length > 0 ? _ . each ( e , function ( a , b ) { c . options [ b ] . values = a } ) : c . options [ 0 ] . values = [ ] , d = c . options , a . chartData [ c . id ] = d3 . select ( c . id ) . append ( " svg " ) . datum ( d ) . transition ( ) . duration ( 300 ) . call ( a . charts [ c . id ] ) . each ( " start " , function ( ) { window . setTimeout ( function ( ) { d3 . selectAll ( c . id + " * " ) . each ( function ( ) { this . __transition__ & & ( this . __transition__ . duration = 0 ) } ) } , 0 ) } ) , nv . utils . windowResize ( a . charts [ c . id ] . update ) , a . nvcharts . push ( a . charts [ c . id ] ) , a . charts [ c . id ] } ) } ) } , returnGraphOptions : function ( a ) { var b = [ ] ; return b = " # clusterData " = = = a ? [ this . chartsOptions [ 0 ] . options [ 0 ] . values , this . chartsOptions [ 0 ] . options [ 1 ] . values ] : " # clusterHttp " = = = a ? [ this . chartsOptions [ 1 ] . options [ 0 ] . values ] : " # clusterAverage " = = = a ? [ this . chartsOptions [ 2 ] . options [ 0 ] . values ] : [ ] } , rerenderGraphs : function ( a ) { if ( this . statsEnabled ) { var b , c , d = this ; this . formatDataForGraph ( a ) , _ . each ( d . chartsOptions , function ( a ) { c = d . returnGraphOptions ( a . id ) , c . length > 0 ? _ . each ( c , function ( b , c ) { a . options [ c ] . values = b } ) : a . options [ 0 ] . values = [ ] , b = a . options , b [ 0 ] . values . length > 0 & & d . historyInit & & d . charts [ a . id ] & & d . charts [ a . id ] . update ( ) } ) } } , calcTotalHttp : function ( a , b ) { var c = 0 ; return _ . each ( a , function ( a ) { c + = a [ b ] } ) , c } , getCoordStatHistory : function ( a ) { var b , c = this , d = [ ] , e = { http : { } } , f = function ( a ) { return $ . get ( a , { count : c . statCollectCoord . size ( ) } , null , " json " ) } , g = function ( a ) { var b , d = [ " times " ] , f = [ " physicalMemory " , " residentSizeCurrent " , " clientConnections15M " , " clientConnectionsCurrent " ] , g = [ " optionsPerSecond " , " putsPerSecond " , " headsPerSecond " , " postsPerSecond " , " getsPerSecond " , " deletesPerSecond " , " othersPerSecond " , " patchesPerSecond " ] , h = [ " bytesSentPerSecond " , " bytesReceivedPerSecond " , " avgRequestTime " ] , i = 0 ; _ . each ( a , function ( a ) { a . enabled ? c . statsEnabled = ! 0 : c . statsEnabled = ! 1 , " object " = = typeof a & & ( 0 = = = i ? ( _ . each ( d , function ( b ) { e [ b ] = a [ b ] } ) , _ . each ( f , function ( b ) { e [ b ] = a [ b ] } ) , _ . each ( g , function ( b ) { e . http [ b ] = a [ b ] } ) , _ . each ( h , function ( b ) { e [ b ] = a [ b ] } ) ) : ( _ . each ( f , function ( b ) { e [ b ] = e [ b ] + a [ b ] } ) , _ . each ( g , function ( c ) { b = 0 , _ . each ( a [ c ] , function ( a ) { e . http [ c ] [ i ] = e . http [ c ] [ i ] + a , b + + } ) } ) , _ . each ( h , function ( c ) { b = 0 , _ . each ( a [ c ] , function ( a ) { e [ c ] [ i ] = e [ c ] [ i ] + a , b + + } ) } ) ) , i + + ) } ) } ; this . statCollectCoord . each ( function ( a ) { b = a . url + " / short " , d . push ( f ( b ) ) } ) , $ . when . apply ( $ , d ) . done ( function ( ) { var b = [ ] ; _ . each ( d , function ( a ) { b . push ( a . responseJSON ) } ) , g ( b ) , a ( e ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . CollectionListItemView = Backbone . View . extend ( { tagName : " div " , className : " tile pure - u - 1 - 1 pure - u - sm - 1 - 2 pure - u - md - 1 - 3 pure - u - lg - 1 - 4 pure - u - xl - 1 - 6 " , template : templateEngine . createTemplate ( " collectionsItemView . ejs " ) , initialize : function ( a ) { this . collectionsView = a . collectionsView } , events : { " click . iconSet . icon_arangodb_settings2 " : " createEditPropertiesModal " , " click . pull - left " : " noop " , " click . icon_arangodb_settings2 " : " editProperties " , " click . spanInfo " : " showProperties " , click : " selectCollection " } , render : function ( ) { return this . model . get ( " locked " ) ? ( $ ( this . el ) . addClass ( " locked " ) , $ ( this . el ) . addClass ( this . model . get ( " lockType " ) ) ) : $ ( this . el ) . removeClass ( " locked " ) , ( " loading " = = = this . model . get ( " status " ) | | " unloading " = = = this . model . get ( " status " ) ) & & $ ( this . el ) . addClass ( " locked " ) , $ ( this . el ) . html ( this . template . render ( { model : this . model } ) ) , $ ( this . el ) . attr ( " id " , " collection_ " + this . model . get ( " name " ) ) , this } , editProperties : function ( a ) { return this . model . get ( " locked " ) ? 0 : ( a . stopPropagation ( ) , void this . createEditPropertiesModal ( ) ) } , showProperties : function ( a ) { return this . model . get ( " locked " ) ? 0 : ( a . stopPropagation ( ) , void this . createInfoModal ( ) ) } , selectCollection : function ( a ) { return $ ( a . target ) . hasClass ( " disabled " ) ? 0 : this . model . get ( " locked " ) ? 0 : " loading " = = = this . model . get ( " status " ) ? 0 : void ( " unloaded " = = = this . model . get ( " status " ) ? this . loadCollection ( ) : window . App . navigate ( " collection / " + encodeURIComponent ( this . model . get ( " name " ) ) + " / documents / 1 " , { trigger : ! 0 } ) ) } , noop : function ( a ) { a . stopPropagation ( ) } , unloadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be unloaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " unloading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " unloaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " unloaded . " ) } . bind ( this ) ; this . model . unloadCollection ( a ) , window . modalView . hide ( ) } , loadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be loaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " loading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " loaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " loaded . " ) } . bind ( this ) ; this . model . loadCollection ( a ) , window . modalView . hide ( ) } , truncateCollection : function ( ) { this . model . truncateCollection ( ) , window . modalView . hide ( ) } , deleteCollection : function ( ) { this . model . destroy ( { error : function ( ) { arangoHelper . arangoError ( " Could not delete collection . " ) } , success : function ( ) { window . modalView . hide ( ) } } ) , this . collectionsView . render ( ) } , saveModifiedCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c ; c = b ? this . model . get ( " name " ) : $ ( " # change - collection - name " ) . val ( ) ; var d = this . model . get ( " status " ) ; if ( " loaded " = = = d ) { var e ; try { e = JSON . parse ( 1024 * $ ( " # change - collection - size " ) . val ( ) * 1024 ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } var g ; try { if ( g = JSON . parse ( $ ( " # change - index - buckets " ) . val ( ) ) , 1 > g | | parseInt ( g ) ! = = Math . pow ( 2 , Math . log2 ( g ) ) ) throw " invalid indexBuckets value " } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number of index buckets " ) , 0 } var h = function ( a ) { a ? arangoHelper . arangoError ( " Collection error : " + a . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) , i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Collection error : " + a . responseText ) ; else { var b = $ ( " # change - collection - sync " ) . val ( ) ; this . model . changeCollection ( b , e , g , h ) } } . bind ( this ) ; this . model . renameCollection ( c , i ) } else if ( " unloaded " = = = d ) if ( this . model . get ( " name " ) ! = = c ) { var j = function ( a , b ) { a ? arangoHelper . arangoError ( " Collection error : " + b . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) ; this . model . renameCollection ( c , j ) } else window . modalView . hide ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , createEditPropertiesModal : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c = ! 1 ; " loaded " = = = this . model . get ( " status " ) & & ( c = ! 0 ) ; var d = [ ] , e = [ ] ; b | | e . push ( window . modalView . createTextEntry ( " change - collection - name " , " Name " , this . model . get ( " name " ) , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) ; var f = function ( ) { e . push ( window . modalView . createReadOnlyEntry ( " change - collection - id " , " ID " , this . model . get ( " id " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - type " , " Type " , this . model . get ( " type " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - status " , " Status " , this . model . get ( " status " ) , " " ) ) , d . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteCollection . bind ( this ) ) ) , d . push ( window . modalView . createDeleteButton ( " Truncate " , this . truncateCollection . bind ( this ) ) ) , c ? d . push ( window . modalView . createNotificationButton ( " Unload " , this . unloadCollection . bind ( this ) ) ) : d . push ( window . modalView . createNotificationButton ( " Load " , this . loadCollection . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . saveModifiedCollection . bind ( this ) ) ) ; var a = [ " General " , " Indices " ] , b = [ " modalTable . ejs " , " indicesView . ejs " ] ; window . modalView . show ( b , " Modify Collection " , d , e , null , null , this . events , null , a ) , " loaded " = = = this . model . get ( " status " ) ? this . getIndex ( ) : $ ( $ ( " # infoTab " ) . children ( ) [ 1 ] ) . remove ( ) } . bind ( this ) ; if ( c ) { var g = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Collection " , " Could not fetch properties " ) ; else { var c = b . journalSize / 1048576 , d = b . indexBuckets , g = b . waitForSync ; e . push ( window . modalView . createTextEntry ( " change - collection - size " , " Journal size " , c , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , e . push ( window . modalView . createTextEntry ( " change - index - buckets " , " Index buckets " , d , " The number of index buckets for this collection . Must be at least 1 and a power of 2 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 1 - 9 ] [ 0 - 9 ] * $ / ) , msg : " Must be a number greater than 1 and a power of 2 . " } ] ) ) , e . push ( window . modalView . createSelectEntry ( " change - collection - sync " , " Wait for sync " , g , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) } f ( ) } . bind ( this ) ; this . model . getProperties ( g ) } else f ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , bindIndexEvents : function ( ) { this . unbindIndexEvents ( ) ; var a = this ; $ ( " # indexEditView # addIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) , $ ( " # cancelIndex " ) . unbind ( " click " ) , $ ( " # cancelIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) } ) , $ ( " # createIndex " ) . unbind ( " click " ) , $ ( " # createIndex " ) . bind ( " click " , function ( ) { a . createIndex ( ) } ) } ) , $ ( " # newIndexType " ) . bind ( " change " , function ( ) { a . selectIndexType ( ) } ) , $ ( " . deleteIndex " ) . bind ( " click " , function ( b ) { a . prepDeleteIndex ( b ) } ) , $ ( " # infoTab a " ) . bind ( " click " , function ( a ) { if ( $ ( " # indexDeleteModal " ) . remove ( ) , " Indices " ! = = $ ( a . currentTarget ) . html ( ) | | $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) | | ( $ ( " # newIndexView " ) . hide ( ) , $ ( " # indexEditView " ) . show ( ) , $ ( " # modal - dialog . modal - footer . button - danger " ) . hide ( ) , $ ( " # modal - dialog . modal - footer . button - success " ) . hide ( ) , $ ( " # modal - dialog . modal - footer . button - notification " ) . hide ( ) ) , " General " = = = $ ( a . currentTarget ) . html ( ) & & ! $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) ) { $ ( " # modal - dialog . modal - footer . button - danger " ) . show ( ) , $ ( " # modal - dialog . modal - footer . button - success " ) . show ( ) , $ ( " # modal - dialog . modal - footer . button - notification " ) . show ( ) ; var b = ( $ ( " . index - button - bar " ) [ 0 ] , $ ( " . index - button - bar2 " ) [ 0 ] ) ; $ ( " # cancelIndex " ) . is ( " : visible " ) & & ( $ ( " # cancelIndex " ) . detach ( ) . appendTo ( b ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( b ) ) } } ) } , unbindIndexEvents : function ( ) { $ ( " # indexEditView # addIndex " ) . unbind ( " click " ) , $ ( " # newIndexType " ) . unbind ( " change " ) , $ ( " # infoTab a " ) . unbind ( " click " ) , $ ( " . deleteIndex " ) . unbind ( " click " ) } , createInfoModal : function ( ) { var a = function ( a , b , c ) { if ( a ) arangoHelper . arangoError ( " Figures " , " Could not get revision . " ) ; else { var d = [ ] , e = { figures : c , revision : b , model : this . model } ; window . modalView . show ( " modalCollectionInfo . ejs " , " Collection : " + this . model . get ( " name " ) , d , e ) } } . bind ( this ) , b = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Figures " , " Could not get figures . " ) ; else { var d = c ; this . model . getRevision ( a , d ) } } . bind ( this ) ; this . model . getFigures ( b ) } , resetIndexForms : function ( ) { $ ( " # indexHeader input " ) . val ( " " ) . prop ( " checked " , ! 1 ) , $ ( " # newIndexType " ) . val ( " Geo " ) . prop ( " selected " , ! 0 ) , this . selectIndexType ( ) } , createIndex : function ( ) { var a , b , c , d = this , e = $ ( " # newIndexType " ) . val ( ) , f = { } ; switch ( e ) { case " Geo " : a = $ ( " # newGeoFields " ) . val ( ) ; var g = d . checkboxToValue ( " # newGeoJson " ) , h = d . checkboxToValue ( " # newGeoConstraint " ) , i = d . checkboxToValue ( " # newGeoIgnoreNull " ) ; f = { type : " geo " , fields : d . stringToArray ( a ) , geoJson : g , constraint : h , ignoreNull : i } ; break ; case " Hash " : a = $ ( " # newHashFields " ) . val ( ) , b = d . checkboxToValue ( " # newHashUnique " ) , c = d . checkboxToValue ( " # newHashSparse " ) , f = { type : " hash " , fields : d . stringToArray ( a ) , unique : b , sparse : c } ; break ; case " Fulltext " : a = $ ( " # newFulltextFields " ) . val ( ) ; var j = parseInt ( $ ( " # newFulltextMinLength " ) . val ( ) , 10 ) | | 0 ; f = { type : " fulltext " , fields : d . stringToArray ( a ) , minLength : j } ; break ; case " Skiplist " : a = $ ( " # newSkiplistFields " ) . val ( ) , b = d . checkboxToValue ( " # newSkiplistUnique " ) , c = d . checkboxToValue ( " # newSkiplistSparse " ) , f = { type : " skiplist " , fields : d . stringToArray ( a ) , unique : b , sparse : c } } var k = function ( a , b ) { if ( a ) if ( b ) { var c = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " Document error " , c . errorMessage ) } else arangoHelper . arangoError ( " Document error " , " Could not create index . " ) ; d . refreshCollectionsView ( ) } ; window . modalView . hide ( ) , d . model . createIndex ( f , k ) } , lastTarget : null , prepDeleteIndex : function ( a ) { var b = this ; this . lastTarget = a , this . lastId = $ ( this . lastTarget . currentTarget ) . parent ( ) . parent ( ) . first ( ) . children ( ) . first ( ) . text ( ) , <nl> - $ ( " # modal - dialog . modal - footer " ) . after ( ' < div id = " indexDeleteModal " style = " display : block ; " class = " alert alert - error modal - delete - confirmation " > < strong > Really delete ? < / strong > < button id = " indexConfirmDelete " class = " button - danger pull - right modal - confirm - delete " > Yes < / button > < button id = " indexAbortDelete " class = " button - neutral pull - right " > No < / button > < / div > ' ) , $ ( " # indexConfirmDelete " ) . unbind ( " click " ) , $ ( " # indexConfirmDelete " ) . bind ( " click " , function ( ) { $ ( " # indexDeleteModal " ) . remove ( ) , b . deleteIndex ( ) } ) , $ ( " # indexAbortDelete " ) . unbind ( " click " ) , $ ( " # indexAbortDelete " ) . bind ( " click " , function ( ) { $ ( " # indexDeleteModal " ) . remove ( ) } ) } , refreshCollectionsView : function ( ) { window . App . arangoCollectionsStore . fetch ( { success : function ( ) { window . App . collectionsView . render ( ) } } ) } , deleteIndex : function ( ) { var a = function ( a ) { a ? ( arangoHelper . arangoError ( " Could not delete index " ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' ) , this . model . set ( " locked " , ! 1 ) , this . refreshCollectionsView ( ) ) : a | | void 0 = = = a | | ( $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . remove ( ) , this . model . set ( " locked " , ! 1 ) , this . refreshCollectionsView ( ) ) , this . refreshCollectionsView ( ) } . bind ( this ) ; this . model . set ( " locked " , ! 0 ) , this . model . deleteIndex ( this . lastId , a ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < i class = " fa fa - circle - o - notch fa - spin " > < / i > ' ) } , selectIndexType : function ( ) { $ ( " . newIndexClass " ) . hide ( ) ; var a = $ ( " # newIndexType " ) . val ( ) ; $ ( " # newIndexType " + a ) . show ( ) } , getIndex : function ( ) { var a = function ( a , b ) { a ? window . arangoHelper . arangoError ( " Index " , b . errorMessage ) : this . renderIndex ( b ) } . bind ( this ) ; this . model . getIndex ( a ) } , renderIndex : function ( a ) { this . index = a ; var b = " collectionInfoTh modal - text " ; if ( this . index ) { var c = " " , d = " " ; _ . each ( this . index . indexes , function ( a ) { d = " primary " = = = a . type | | " edge " = = = a . type ? ' < span class = " icon_arangodb_locked " data - original - title = " No action " > < / span > ' : ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' , void 0 ! = = a . fields & & ( c = a . fields . join ( " , " ) ) ; var e = a . id . indexOf ( " / " ) , f = a . id . substr ( e + 1 , a . id . length ) , g = a . hasOwnProperty ( " selectivityEstimate " ) ? ( 100 * a . selectivityEstimate ) . toFixed ( 2 ) + " % " : " n / a " , h = a . hasOwnProperty ( " sparse " ) ? a . sparse : " n / a " ; $ ( " # collectionEditIndexTable " ) . append ( " < tr > < th class = " + JSON . stringify ( b ) + " > " + f + " < / th > < th class = " + JSON . stringify ( b ) + " > " + a . type + " < / th > < th class = " + JSON . stringify ( b ) + " > " + a . unique + " < / th > < th class = " + JSON . stringify ( b ) + " > " + h + " < / th > < th class = " + JSON . stringify ( b ) + " > " + g + " < / th > < th class = " + JSON . stringify ( b ) + " > " + c + " < / th > < th class = " + JSON . stringify ( b ) + " > " + d + " < / th > < / tr > " ) } ) } this . bindIndexEvents ( ) } , toggleNewIndexView : function ( ) { var a = $ ( " . index - button - bar2 " ) [ 0 ] ; $ ( " # indexEditView " ) . is ( " : visible " ) ? ( $ ( " # indexEditView " ) . hide ( ) , $ ( " # newIndexView " ) . show ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( " # modal - dialog . modal - footer " ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( " # modal - dialog . modal - footer " ) ) : ( $ ( " # indexEditView " ) . show ( ) , $ ( " # newIndexView " ) . hide ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( a ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( a ) ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " right " ) , this . resetIndexForms ( ) } , stringToArray : function ( a ) { var b = [ ] ; return a . split ( " , " ) . forEach ( function ( a ) { a = a . replace ( / ( ^ \ s + | \ s + $ ) / g , " " ) , " " ! = = a & & b . push ( a ) } ) , b } , checkboxToValue : function ( a ) { return $ ( a ) . prop ( " checked " ) } } ) } ( ) , function ( ) { " use strict " ; window . CollectionsView = Backbone . View . extend ( { el : " # content " , el2 : " # collectionsThumbnailsIn " , searchTimeout : null , refreshRate : 1e4 , template : templateEngine . createTemplate ( " collectionsView . ejs " ) , refetchCollections : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . checkLockedCollections ( ) } } ) } , checkLockedCollections : function ( ) { var a = function ( a , b ) { var c = this ; a ? console . log ( " Could not check locked collections " ) : ( this . collection . each ( function ( a ) { a . set ( " locked " , ! 1 ) } ) , _ . each ( b , function ( a ) { var b = c . collection . findWhere ( { id : a . collection } ) ; b . set ( " locked " , ! 0 ) , b . set ( " lockType " , a . type ) , b . set ( " desc " , a . desc ) } ) , this . collection . each ( function ( a ) { a . get ( " locked " ) | | ( $ ( " # collection_ " + a . get ( " name " ) ) . find ( " . corneredBadge " ) . removeClass ( " loaded unloaded " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . addClass ( a . get ( " status " ) ) ) , a . get ( " locked " ) | | " loading " = = = a . get ( " status " ) ? ( $ ( " # collection_ " + a . get ( " name " ) ) . addClass ( " locked " ) , a . get ( " locked " ) ? ( $ ( " # collection_ " + a . get ( " name " ) ) . find ( " . corneredBadge " ) . removeClass ( " loaded unloaded " ) , $ ( " # collection_ " + a . get ( " name " ) ) . find ( " . corneredBadge " ) . addClass ( " inProgress " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " desc " ) ) ) : $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) ) : ( $ ( " # collection_ " + a . get ( " name " ) ) . removeClass ( " locked " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . hasClass ( " inProgress " ) & & ( $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . removeClass ( " inProgress " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . addClass ( " loaded " ) ) , " unloaded " = = = a . get ( " status " ) & & $ ( " # collection_ " + a . get ( " name " ) + " . icon_arangodb_info " ) . addClass ( " disabled " ) ) } ) ) } . bind ( this ) ; window . arangoHelper . syncAndReturnUninishedAardvarkJobs ( " index " , a ) } , initialize : function ( ) { var a = this ; window . setInterval ( function ( ) { " # collections " = = = window . location . hash & & window . VISIBLE & & a . refetchCollections ( ) } , a . refreshRate ) } , render : function ( ) { this . checkLockedCollections ( ) ; var a = ! 1 ; $ ( " # collectionsDropdown " ) . is ( " : visible " ) & & ( a = ! 0 ) , $ ( this . el ) . html ( this . template . render ( { } ) ) , this . setFilterValues ( ) , a = = = ! 0 & & $ ( " # collectionsDropdown2 " ) . show ( ) ; var b = this . collection . searchOptions ; this . collection . getFiltered ( b ) . forEach ( function ( a ) { $ ( " # collectionsThumbnailsIn " , this . el ) . append ( new window . CollectionListItemView ( { model : a , collectionsView : this } ) . render ( ) . el ) } , this ) , " none " = = = $ ( " # collectionsDropdown2 " ) . css ( " display " ) ? $ ( " # collectionsToggle " ) . removeClass ( " activated " ) : $ ( " # collectionsToggle " ) . addClass ( " activated " ) ; var c ; arangoHelper . setCheckboxStatus ( " # collectionsDropdown " ) ; try { c = b . searchPhrase . length } catch ( d ) { } return $ ( " # searchInput " ) . val ( b . searchPhrase ) , $ ( " # searchInput " ) . focus ( ) , $ ( " # searchInput " ) [ 0 ] . setSelectionRange ( c , c ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " left " ) , this } , events : { " click # createCollection " : " createCollection " , " keydown # searchInput " : " restrictToSearchPhraseKey " , " change # searchInput " : " restrictToSearchPhrase " , " click # searchSubmit " : " restrictToSearchPhrase " , " click . checkSystemCollections " : " checkSystem " , " click # checkLoaded " : " checkLoaded " , " click # checkUnloaded " : " checkUnloaded " , " click # checkDocument " : " checkDocument " , " click # checkEdge " : " checkEdge " , " click # sortName " : " sortName " , " click # sortType " : " sortType " , " click # sortOrder " : " sortOrder " , " click # collectionsToggle " : " toggleView " , " click . css - label " : " checkBoxes " } , updateCollectionsView : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , toggleView : function ( ) { $ ( " # collectionsToggle " ) . toggleClass ( " activated " ) , $ ( " # collectionsDropdown2 " ) . slideToggle ( 200 ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , checkSystem : function ( ) { var a = this . collection . searchOptions , b = a . includeSystem ; a . includeSystem = $ ( " . checkSystemCollections " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeSystem & & this . render ( ) } , checkEdge : function ( ) { var a = this . collection . searchOptions , b = a . includeEdge ; a . includeEdge = $ ( " # checkEdge " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeEdge & & this . render ( ) } , checkDocument : function ( ) { var a = this . collection . searchOptions , b = a . includeDocument ; a . includeDocument = $ ( " # checkDocument " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeDocument & & this . render ( ) } , checkLoaded : function ( ) { var a = this . collection . searchOptions , b = a . includeLoaded ; a . includeLoaded = $ ( " # checkLoaded " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeLoaded & & this . render ( ) } , checkUnloaded : function ( ) { var a = this . collection . searchOptions , b = a . includeUnloaded ; a . includeUnloaded = $ ( " # checkUnloaded " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeUnloaded & & this . render ( ) } , sortName : function ( ) { var a = this . collection . searchOptions , b = a . sortBy ; a . sortBy = $ ( " # sortName " ) . is ( " : checked " ) = = = ! 0 ? " name " : " type " , b ! = = a . sortBy & & this . render ( ) } , sortType : function ( ) { var a = this . collection . searchOptions , b = a . sortBy ; a . sortBy = $ ( " # sortType " ) . is ( " : checked " ) = = = ! 0 ? " type " : " name " , b ! = = a . sortBy & & this . render ( ) } , sortOrder : function ( ) { var a = this . collection . searchOptions , b = a . sortOrder ; a . sortOrder = $ ( " # sortOrder " ) . is ( " : checked " ) = = = ! 0 ? - 1 : 1 , b ! = = a . sortOrder & & this . render ( ) } , setFilterValues : function ( ) { var a = this . collection . searchOptions ; $ ( " # checkLoaded " ) . attr ( " checked " , a . includeLoaded ) , $ ( " # checkUnloaded " ) . attr ( " checked " , a . includeUnloaded ) , $ ( " . checkSystemCollections " ) . attr ( " checked " , a . includeSystem ) , $ ( " # checkEdge " ) . attr ( " checked " , a . includeEdge ) , $ ( " # checkDocument " ) . attr ( " checked " , a . includeDocument ) , $ ( " # sortName " ) . attr ( " checked " , " type " ! = = a . sortBy ) , $ ( " # sortType " ) . attr ( " checked " , " type " = = = a . sortBy ) , $ ( " # sortOrder " ) . attr ( " checked " , 1 ! = = a . sortOrder ) } , search : function ( ) { var a = this . collection . searchOptions , b = $ ( " # searchInput " ) . val ( ) ; b ! = = a . searchPhrase & & ( a . searchPhrase = b , this . render ( ) ) } , resetSearch : function ( ) { this . searchTimeout & & ( clearTimeout ( this . searchTimeout ) , this . searchTimeout = null ) ; var a = this . collection . searchOptions ; a . searchPhrase = null } , restrictToSearchPhraseKey : function ( ) { var a = this ; this . resetSearch ( ) , a . searchTimeout = setTimeout ( function ( ) { a . search ( ) } , 200 ) } , restrictToSearchPhrase : function ( ) { this . resetSearch ( ) , this . search ( ) } , createCollection : function ( a ) { a . preventDefault ( ) , this . createNewCollectionModal ( ) } , submitCreateCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " DB " , " Could not check coordinator state " ) ; else { var c = $ ( " # new - collection - name " ) . val ( ) , d = $ ( " # new - collection - size " ) . val ( ) , e = $ ( " # new - replication - factor " ) . val ( ) , f = $ ( " # new - collection - type " ) . val ( ) , g = $ ( " # new - collection - sync " ) . val ( ) , h = 1 , i = [ ] ; if ( " " = = = e & & ( e = 1 ) , b ) { if ( h = $ ( " # new - collection - shards " ) . val ( ) , " " = = = h & & ( h = 1 ) , h = parseInt ( h , 10 ) , 1 > h ) return arangoHelper . arangoError ( " Number of shards has to be an integer value greater or equal 1 " ) , 0 ; i = _ . pluck ( $ ( " # new - collection - shardBy " ) . select2 ( " data " ) , " text " ) , 0 = = = i . length & & i . push ( " _key " ) } if ( " _ " = = = c . substr ( 0 , 1 ) ) return arangoHelper . arangoError ( ' No " _ " allowed as first character ! ' ) , 0 ; var j = ! 1 , k = " true " = = = g ; if ( d > 0 ) try { d = 1024 * JSON . parse ( d ) * 1024 } catch ( l ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } if ( " " = = = c ) return arangoHelper . arangoError ( " No collection name entered ! " ) , 0 ; var m = function ( a , b ) { if ( a ) try { b = JSON . parse ( b . responseText ) , arangoHelper . arangoError ( " Error " , b . errorMessage ) } catch ( c ) { console . log ( c ) } else this . updateCollectionsView ( ) ; window . modalView . hide ( ) } . bind ( this ) ; this . collection . newCollection ( { collName : c , wfs : k , isSystem : j , collSize : d , replicationFactor : e , collType : f , shards : h , shardBy : i } , m ) } } . bind ( this ) ; window . isCoordinator ( a ) } , createNewCollectionModal : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " DB " , " Could not check coordinator state " ) ; else { var c = [ ] , d = [ ] , e = { } , f = [ ] ; d . push ( window . modalView . createTextEntry ( " new - collection - name " , " Name " , " " , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) , d . push ( window . modalView . createSelectEntry ( " new - collection - type " , " Type " , " " , " The type of the collection to create . " , [ { value : 2 , label : " Document " } , { value : 3 , label : " Edge " } ] ) ) , b & & ( d . push ( window . modalView . createTextEntry ( " new - collection - shards " , " Shards " , " " , " The number of shards to create . You cannot change this afterwards . Recommended : DBServers squared " , " " , ! 0 ) ) , d . push ( window . modalView . createSelect2Entry ( " new - collection - shardBy " , " shardBy " , " " , " The keys used to distribute documents on shards . Type the key and press return to add it . " , " _key " , ! 1 ) ) ) , c . push ( window . modalView . createSuccessButton ( " Save " , this . submitCreateCollection . bind ( this ) ) ) , f . push ( window . modalView . createTextEntry ( " new - collection - size " , " Journal size " , " " , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , window . App . isCluster & & f . push ( window . modalView . createTextEntry ( " new - replication - factor " , " Replication factor " , " " , " Numeric value . Must be at least 1 . Description : TODO " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , f . push ( window . modalView . createSelectEntry ( " new - collection - sync " , " Wait for sync " , " " , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) , e . header = " Advanced " , e . content = f , window . modalView . show ( " modalTable . ejs " , " New Collection " , c , d , e ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; function a ( a , b ) { return ( void 0 = = = a | | null = = = a ) & & ( a = 0 ) , a . toFixed ( b ) } window . DashboardView = Backbone . View . extend ( { el : " # content " , interval : 1e4 , defaultTimeFrame : 12e5 , defaultDetailFrame : 1728e5 , history : { } , graphs : { } , events : { " click . subViewNavbar . subMenuEntry " : " toggleViews " } , tendencies : { asyncPerSecondCurrent : [ " asyncPerSecondCurrent " , " asyncPerSecondPercentChange " ] , syncPerSecondCurrent : [ " syncPerSecondCurrent " , " syncPerSecondPercentChange " ] , clientConnectionsCurrent : [ " clientConnectionsCurrent " , " clientConnectionsPercentChange " ] , clientConnectionsAverage : [ " clientConnections15M " , " clientConnections15MPercentChange " ] , numberOfThreadsCurrent : [ " numberOfThreadsCurrent " , " numberOfThreadsPercentChange " ] , numberOfThreadsAverage : [ " numberOfThreads15M " , " numberOfThreads15MPercentChange " ] , virtualSizeCurrent : [ " virtualSizeCurrent " , " virtualSizePercentChange " ] , virtualSizeAverage : [ " virtualSize15M " , " virtualSize15MPercentChange " ] } , barCharts : { totalTimeDistribution : [ " queueTimeDistributionPercent " , " requestTimeDistributionPercent " ] , dataTransferDistribution : [ " bytesSentDistributionPercent " , " bytesReceivedDistributionPercent " ] } , barChartsElementNames : { queueTimeDistributionPercent : " Queue " , requestTimeDistributionPercent : " Computation " , bytesSentDistributionPercent : " Bytes sent " , bytesReceivedDistributionPercent : " Bytes received " } , getDetailFigure : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) . replace ( / ChartButton / g , " " ) ; return b } , showDetail : function ( a ) { var b , c = this , d = this . getDetailFigure ( a ) ; b = this . dygraphConfig . getDetailChartConfig ( d ) , this . getHistoryStatistics ( d ) , this . detailGraphFigure = d , window . modalView . hideFooter = ! 0 , window . modalView . hide ( ) , window . modalView . show ( " modalGraph . ejs " , b . header , void 0 , void 0 , void 0 , void 0 , this . events ) , window . modalView . hideFooter = ! 1 , $ ( " # modal - dialog " ) . on ( " hidden " , function ( ) { c . hidden ( ) } ) , $ ( " # modal - dialog " ) . toggleClass ( " modal - chart - detail " , ! 0 ) , b . height = . 7 * $ ( window ) . height ( ) , b . width = $ ( " . modal - inner - detail " ) . width ( ) , b . labelsDiv = $ ( b . labelsDiv ) [ 0 ] , this . detailGraph = new Dygraph ( document . getElementById ( " lineChartDetail " ) , this . history [ this . server ] [ d ] , b ) } , hidden : function ( ) { this . detailGraph . destroy ( ) , delete this . detailGraph , delete this . detailGraphFigure } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , prepareDygraphs : function ( ) { var a , b = this ; this . dygraphConfig . getDashBoardFigures ( ) . forEach ( function ( c ) { a = b . dygraphConfig . getDefaultConfig ( c ) ; var d = b . getCurrentSize ( a . div ) ; a . height = d . height , a . width = d . width , b . graphs [ c ] = new Dygraph ( document . getElementById ( a . div ) , b . history [ b . server ] [ c ] | | [ ] , a ) } ) } , initialize : function ( a ) { this . options = a , this . dygraphConfig = a . dygraphConfig , this . d3NotInitialized = ! 0 , this . events [ " click . dashboard - sub - bar - menu - sign " ] = this . showDetail . bind ( this ) , this . events [ " mousedown . dygraph - rangesel - zoomhandle " ] = this . stopUpdating . bind ( this ) , this . events [ " mouseup . dygraph - rangesel - zoomhandle " ] = this . startUpdating . bind ( this ) , this . serverInfo = a . serverToShow , this . serverInfo ? this . server = this . serverInfo . target : this . server = " - local - " , this . history [ this . server ] = { } } , toggleViews : function ( a ) { var b = a . currentTarget . id . split ( " - " ) [ 0 ] , c = this , d = [ " replication " , " requests " , " system " ] ; _ . each ( d , function ( a ) { b ! = = a ? $ ( " # " + a ) . hide ( ) : ( $ ( " # " + a ) . show ( ) , c . resize ( ) , $ ( window ) . resize ( ) ) } ) , $ ( " . subMenuEntries " ) . children ( ) . removeClass ( " active " ) , $ ( " # " + b + " - statistics " ) . addClass ( " active " ) , window . setTimeout ( function ( ) { c . resize ( ) , $ ( window ) . resize ( ) } , 200 ) } , cleanupHistory : function ( a ) { if ( this . history [ this . server ] . hasOwnProperty ( a ) & & this . history [ this . server ] [ a ] . length > this . defaultTimeFrame / this . interval ) for ( ; this . history [ this . server ] [ a ] . length > this . defaultTimeFrame / this . interval ; ) this . history [ this . server ] [ a ] . shift ( ) } , updateCharts : function ( ) { var a = this ; return this . detailGraph ? void this . updateLineChart ( this . detailGraphFigure , ! 0 ) : ( this . prepareD3Charts ( this . isUpdating ) , this . prepareResidentSize ( this . isUpdating ) , this . updateTendencies ( ) , void Object . keys ( this . graphs ) . forEach ( function ( b ) { a . updateLineChart ( b , ! 1 ) } ) ) } , updateTendencies : function ( ) { var a = this , b = this . tendencies , c = " " ; Object . keys ( b ) . forEach ( function ( b ) { var d = " " , e = 0 ; a . history . hasOwnProperty ( a . server ) & & a . history [ a . server ] . hasOwnProperty ( b ) & & ( e = a . history [ a . server ] [ b ] [ 1 ] ) , 0 > e ? c = " # d05448 " : ( c = " # 7da817 " , d = " + " ) , a . history . hasOwnProperty ( a . server ) & & a . history [ a . server ] . hasOwnProperty ( b ) ? $ ( " # " + b ) . html ( a . history [ a . server ] [ b ] [ 0 ] + ' < br / > < span class = " dashboard - figurePer " style = " color : ' + c + ' ; " > ' + d + e + " % < / span > " ) : $ ( " # " + b ) . html ( ' < br / > < span class = " dashboard - figurePer " style = " color : # 000 ; " > < p class = " dataNotReadyYet " > data not ready yet < / p > < / span > ' ) } ) } , updateDateWindow : function ( a , b ) { var c , d , e = ( new Date ) . getTime ( ) ; return b & & a . dateWindow_ ? ( c = a . dateWindow_ [ 0 ] , d = e - a . dateWindow_ [ 1 ] - 5 * this . interval > 0 ? a . dateWindow_ [ 1 ] : e , [ c , d ] ) : [ e - this . defaultTimeFrame , e ] } , updateLineChart : function ( a , b ) { var c = b ? this . detailGraph : this . graphs [ a ] , d = { file : this . history [ this . server ] [ a ] , dateWindow : this . updateDateWindow ( c , b ) } , e = 0 , f = [ ] ; _ . each ( d . file , function ( a ) { var b = a [ 0 ] . getSeconds ( ) - a [ 0 ] . getSeconds ( ) % 10 ; d . file [ e ] [ 0 ] . setSeconds ( b ) , f . push ( d . file [ e ] [ 0 ] ) , e + + } ) ; for ( var g = new Date ( Math . max . apply ( null , f ) ) , h = new Date ( Math . min . apply ( null , f ) ) , i = new Date ( h . getTime ( ) ) , j = [ ] , k = [ ] ; g > i ; ) i = new Date ( i . setSeconds ( i . getSeconds ( ) + 10 ) ) , k . push ( i ) ; _ . each ( k , function ( a ) { var b = ! 1 ; _ . each ( d . file , function ( c ) { Math . floor ( a . getTime ( ) / 1e3 ) = = = Math . floor ( c [ 0 ] . getTime ( ) / 1e3 ) & & ( b = ! 0 ) } ) , b = = = ! 1 & & a < new Date & & j . push ( a ) } ) , _ . each ( j , function ( b ) { ( " systemUserTime " = = = a | | " requests " = = = a | | " pageFaults " = = = a | | " dataTransfer " = = = a ) & & d . file . push ( [ b , 0 , 0 ] ) , " totalTime " = = = a & & d . file . push ( [ b , 0 , 0 , 0 ] ) } ) , void 0 = = = d . file ? ( $ ( " # loadingScreen span " ) . text ( " Statistics not ready yet . Waiting . " ) , $ ( " # loadingScreen " ) . show ( ) , $ ( " # content " ) . hide ( ) ) : ( $ ( " # content " ) . show ( ) , $ ( " # loadingScreen " ) . hide ( ) , d . file . sort ( function ( a , b ) { return new Date ( b [ 0 ] ) - new Date ( a [ 0 ] ) } ) , c . updateOptions ( d ) , this . history [ this . server ] . hasOwnProperty ( a ) & & this . cleanupHistory ( a ) ) , $ ( window ) . trigger ( " resize " ) , this . resize ( ) } , mergeDygraphHistory : function ( a , b ) { var c , d = this ; this . dygraphConfig . getDashBoardFigures ( ! 0 ) . forEach ( function ( e ) { if ( d . dygraphConfig . mapStatToFigure [ e ] & & ( d . history [ d . server ] [ e ] | | ( d . history [ d . server ] [ e ] = [ ] ) , c = [ ] , d . dygraphConfig . mapStatToFigure [ e ] . forEach ( function ( d ) { a [ d ] & & ( " times " = = = d ? c . push ( new Date ( 1e3 * a [ d ] [ b ] ) ) : c . push ( a [ d ] [ b ] ) ) } ) , c . length > 1 ) ) { var f = 0 , g = 0 ; 9 = = = c . length & & ( f + = c [ 1 ] , f + = c [ 6 ] , f + = c [ 7 ] , f + = c [ 8 ] , g + = c [ 2 ] , g + = c [ 3 ] , g + = c [ 4 ] , g + = c [ 5 ] , c = [ c [ 0 ] , f , g ] ) , d . history [ d . server ] [ e ] . push ( c ) } } ) } , cutOffHistory : function ( a , b ) { for ( var c , d = this ; 0 ! = = d . history [ d . server ] [ a ] . length & & ( c = d . history [ d . server ] [ a ] [ 0 ] [ 0 ] , ! ( c > = b ) ) ; ) d . history [ d . server ] [ a ] . shift ( ) } , cutOffDygraphHistory : function ( a ) { var b = this , c = new Date ( a ) ; this . dygraphConfig . getDashBoardFigures ( ! 0 ) . forEach ( function ( a ) { b . dygraphConfig . mapStatToFigure [ a ] & & b . history [ b . server ] [ a ] & & b . cutOffHistory ( a , c ) } ) } , mergeHistory : function ( b ) { var c , d = this ; for ( c = 0 ; c < b . times . length ; + + c ) this . mergeDygraphHistory ( b , c ) ; this . cutOffDygraphHistory ( ( new Date ) . getTime ( ) - this . defaultTimeFrame ) , Object . keys ( this . tendencies ) . forEach ( function ( c ) { var e = 1 , f = 1 ; " virtualSizeCurrent " = = = c | | " virtualSizeAverage " = = = c ? ( b [ d . tendencies [ c ] [ 0 ] ] / = 1073741824 , e = 2 ) : " clientConnectionsCurrent " = = = c ? e = 0 : " numberOfThreadsCurrent " = = = c & & ( e = 0 ) , d . history [ d . server ] [ c ] = [ a ( b [ d . tendencies [ c ] [ 0 ] ] , e ) , a ( 100 * b [ d . tendencies [ c ] [ 1 ] ] , f ) ] } ) , Object . keys ( this . barCharts ) . forEach ( function ( a ) { d . history [ d . server ] [ a ] = d . mergeBarChartData ( d . barCharts [ a ] , b ) } ) , d . history [ d . server ] . physicalMemory = b . physicalMemory , d . history [ d . server ] . residentSizeCurrent = b . residentSizeCurrent , d . history [ d . server ] . residentSizePercent = b . residentSizePercent , d . history [ d . server ] . residentSizeChart = [ { key : " " , color : this . dygraphConfig . colors [ 1 ] , values : [ { label : " used " , value : 100 * b . residentSizePercent } ] } , { key : " " , color : this . dygraphConfig . colors [ 2 ] , values : [ { label : " used " , value : 100 - 100 * b . residentSizePercent } ] } ] , this . nextStart = b . nextStart } , mergeBarChartData : function ( a , b ) { var c , d = { key : this . barChartsElementNames [ a [ 0 ] ] , color : this . dygraphConfig . colors [ 1 ] , values : [ ] } , e = { key : this . barChartsElementNames [ a [ 1 ] ] , color : this . dygraphConfig . colors [ 2 ] , values : [ ] } ; for ( c = b [ a [ 0 ] ] . values . length - 1 ; c > = 0 ; - - c ) d . values . push ( { label : this . getLabel ( b [ a [ 0 ] ] . cuts , c ) , value : b [ a [ 0 ] ] . values [ c ] } ) , e . values . push ( { label : this . getLabel ( b [ a [ 1 ] ] . cuts , c ) , value : b [ a [ 1 ] ] . values [ c ] } ) ; return [ d , e ] } , getLabel : function ( a , b ) { return a [ b ] ? 0 = = = b ? " 0 - " + a [ b ] : a [ b - 1 ] + " - " + a [ b ] : " > " + a [ b - 1 ] } , renderReplicationStatistics : function ( a ) { $ ( " # repl - numbers table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalEvents ) , $ ( " # repl - numbers table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalRequests ) , $ ( " # repl - numbers table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalFailedConnects ) , a . state . lastAppliedContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastAppliedContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , a . state . lastProcessedContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastProcessedContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , a . state . lastAvailableContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastAvailableContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , $ ( " # repl - progress table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . message ) , $ ( " # repl - progress table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . time ) , $ ( " # repl - progress table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . failedConnects ) } , getReplicationStatistics : function ( ) { var a = this ; $ . ajax ( arangoHelper . databaseUrl ( " / _api / replication / applier - state " ) , { async : ! 0 } ) . done ( function ( b ) { if ( b . hasOwnProperty ( " state " ) ) { var c ; c = b . state . running ? " active " : " inactive " , c = ' < span class = " state " > ' + c + " < / span > " , $ ( " # replication - chart . dashboard - sub - bar " ) . html ( " Replication " + c ) , a . renderReplicationStatistics ( b ) } } ) } , getStatistics : function ( a , b ) { var c = this , d = arangoHelper . databaseUrl ( " / _admin / aardvark / statistics / short " , " _system " ) , e = " ? start = " ; e + = c . nextStart ? c . nextStart : ( ( new Date ) . getTime ( ) - c . defaultTimeFrame ) / 1e3 , " - local - " ! = = c . server & & ( e + = " & type = short & DBserver = " + c . serverInfo . target , c . history . hasOwnProperty ( c . server ) | | ( c . history [ c . server ] = { } ) ) , $ . ajax ( d + e , { async : ! 0 , xhrFields : { withCredentials : ! 0 } , crossDomain : ! 0 } ) . done ( function ( d ) { d . times . length > 0 & & ( c . isUpdating = ! 0 , c . mergeHistory ( d ) ) , c . isUpdating ! = = ! 1 & & ( a & & a ( d . enabled , b ) , c . updateCharts ( ) ) } ) . error ( function ( a ) { console . log ( " stat fetch req error " ) , console . log ( a ) } ) , this . getReplicationStatistics ( ) } , getHistoryStatistics : function ( a ) { var b = this , c = " statistics / long " , d = " ? filter = " + this . dygraphConfig . mapStatToFigure [ a ] . join ( ) ; " - local - " ! = = b . server & & ( c = b . server . endpoint + arangoHelper . databaseUrl ( " / _admin / aardvark / statistics / cluster " ) , d + = " & type = long & DBserver = " + b . server . target , b . history . hasOwnProperty ( b . server ) | | ( b . history [ b . server ] = { } ) ) ; var e = window . location . href . split ( " / " ) , f = e [ 0 ] + " / / " + e [ 2 ] + " / " + e [ 3 ] + " / _system / " + e [ 5 ] + " / " + e [ 6 ] + " / " ; $ . ajax ( f + c + d , { async : ! 0 } ) . done ( function ( c ) { var d ; for ( b . history [ b . server ] [ a ] = [ ] , d = 0 ; d < c . times . length ; + + d ) b . mergeDygraphHistory ( c , d , ! 0 ) } ) } , addEmptyDataLabels : function ( ) { 0 = = = $ ( " . dataNotReadyYet " ) . length & & ( $ ( " # dataTransferDistribution " ) . prepend ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) , $ ( " # totalTimeDistribution " ) . prepend ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) , $ ( " . dashboard - bar - chart - title " ) . append ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) ) } , removeEmptyDataLabels : function ( ) { $ ( " . dataNotReadyYet " ) . remove ( ) } , prepareResidentSize : function ( b ) { var c = this , d = this . getCurrentSize ( " # residentSizeChartContainer " ) , e = c . history [ c . server ] . residentSizeCurrent / 1024 / 1024 , f = " " ; f = 1025 > e ? a ( e , 2 ) + " MB " : a ( e / 1024 , 2 ) + " GB " ; var g = a ( 100 * c . history [ c . server ] . residentSizePercent , 2 ) , h = [ a ( c . history [ c . server ] . physicalMemory / 1024 / 1024 / 1024 , 0 ) + " GB " ] ; return void 0 = = = c . history [ c . server ] . residentSizeChart ? void this . addEmptyDataLabels ( ) : ( this . removeEmptyDataLabels ( ) , void nv . addGraph ( function ( ) { var a = nv . models . multiBarHorizontalChart ( ) . x ( function ( a ) { return a . label } ) . y ( function ( a ) { return a . value } ) . width ( d . width ) . height ( d . height ) . margin ( { top : ( $ ( " residentSizeChartContainer " ) . outerHeight ( ) - $ ( " residentSizeChartContainer " ) . height ( ) ) / 2 , right : 1 , bottom : ( $ ( " residentSizeChartContainer " ) . outerHeight ( ) - $ ( " residentSizeChartContainer " ) . height ( ) ) / 2 , left : 1 } ) . showValues ( ! 1 ) . showYAxis ( ! 1 ) . showXAxis ( ! 1 ) . showLegend ( ! 1 ) . showControls ( ! 1 ) . stacked ( ! 0 ) ; return a . yAxis . tickFormat ( function ( a ) { return a + " % " } ) . showMaxMin ( ! 1 ) , a . xAxis . showMaxMin ( ! 1 ) , d3 . select ( " # residentSizeChart svg " ) . datum ( c . history [ c . server ] . residentSizeChart ) . call ( a ) , d3 . select ( " # residentSizeChart svg " ) . select ( " . nv - zeroLine " ) . remove ( ) , b & & ( d3 . select ( " # residentSizeChart svg " ) . select ( " # total " ) . remove ( ) , d3 . select ( " # residentSizeChart svg " ) . select ( " # percentage " ) . remove ( ) ) , d3 . select ( " . dashboard - bar - chart - title . percentage " ) . html ( f + " ( " + g + " % ) " ) , d3 . select ( " . dashboard - bar - chart - title . absolut " ) . html ( h [ 0 ] ) , nv . utils . windowResize ( a . update ) , a } , function ( ) { d3 . selectAll ( " # residentSizeChart . nv - bar " ) . on ( " click " , function ( ) { } ) } ) ) } , prepareD3Charts : function ( b ) { var c = this , d = { totalTimeDistribution : [ " queueTimeDistributionPercent " , " requestTimeDistributionPercent " ] , dataTransferDistribution : [ " bytesSentDistributionPercent " , " bytesReceivedDistributionPercent " ] } ; this . d3NotInitialized & & ( b = ! 1 , this . d3NotInitialized = ! 1 ) , _ . each ( Object . keys ( d ) , function ( b ) { var d = c . getCurrentSize ( " # " + b + " Container . dashboard - interior - chart " ) , e = " # " + b + " Container svg " ; return void 0 = = = c . history [ c . server ] . residentSizeChart ? void c . addEmptyDataLabels ( ) : ( c . removeEmptyDataLabels ( ) , void nv . addGraph ( function ( ) { var f = [ 0 , . 25 , . 5 , . 75 , 1 ] , g = 75 , h = 23 , i = 6 ; d . width < 219 ? ( f = [ 0 , . 5 , 1 ] , g = 72 , h = 21 , i = 5 ) : d . width < 299 ? ( f = [ 0 , . 3334 , . 6667 , 1 ] , g = 77 ) : d . width < 379 ? g = 87 : d . width < 459 ? g = 95 : d . width < 539 ? g = 100 : d . width < 619 & & ( g = 105 ) ; var j = nv . models . multiBarHorizontalChart ( ) . x ( function ( a ) { return a . label } ) . y ( function ( a ) { return a . value } ) . width ( d . width ) . height ( d . height ) . margin ( { top : 5 , right : 20 , bottom : h , left : g } ) . showValues ( ! 1 ) . showYAxis ( ! 0 ) . showXAxis ( ! 0 ) . showLegend ( ! 1 ) . showControls ( ! 1 ) . forceY ( [ 0 , 1 ] ) ; j . yAxis . showMaxMin ( ! 1 ) ; d3 . select ( " . nv - y . nv - axis " ) . selectAll ( " text " ) . attr ( " transform " , " translate ( 0 , " + i + " ) " ) ; return j . yAxis . tickValues ( f ) . tickFormat ( function ( b ) { return a ( 100 * b * 100 / 100 , 0 ) + " % " } ) , d3 . select ( e ) . datum ( c . history [ c . server ] [ b ] ) . call ( j ) , nv . utils . windowResize ( j . update ) , j } , function ( ) { d3 . selectAll ( e + " . nv - bar " ) . on ( " click " , function ( ) { } ) } ) ) } ) } , stopUpdating : function ( ) { this . isUpdating = ! 1 } , startUpdating : function ( ) { var a = this ; a . timer | | ( a . timer = window . setInterval ( function ( ) { window . App . isCluster ? window . location . hash . indexOf ( a . serverInfo . target ) > - 1 & & a . getStatistics ( ) : a . getStatistics ( ) } , a . interval ) ) } , resize : function ( ) { if ( this . isUpdating ) { var a , b = this ; _ . each ( this . graphs , function ( c ) { a = b . getCurrentSize ( c . maindiv_ . id ) , c . resize ( a . width , a . height ) } ) , this . detailGraph & & ( a = this . getCurrentSize ( this . detailGraph . maindiv_ . id ) , this . detailGraph . resize ( a . width , a . height ) ) , this . prepareD3Charts ( ! 0 ) , this . prepareResidentSize ( ! 0 ) } } , template : templateEngine . createTemplate ( " dashboardView . ejs " ) , render : function ( a ) { var b = function ( a , b ) { return b | | $ ( this . el ) . html ( this . template . render ( ) ) , a & & " _system " = = = frontendConfig . db ? ( this . prepareDygraphs ( ) , this . isUpdating & & ( this . prepareD3Charts ( ) , this . prepareResidentSize ( ) , this . updateTendencies ( ) , $ ( window ) . trigger ( " resize " ) ) , this . startUpdating ( ) , void $ ( window ) . resize ( ) ) : ( $ ( this . el ) . html ( " " ) , void ( this . server ? $ ( this . el ) . append ( ' < div style = " color : red " > Server statistics ( ' + this . server + " ) are disabled . < / div > " ) : $ ( this . el ) . append ( ' < div style = " color : red " > Server statistics are disabled . < / div > ' ) ) ) } . bind ( this ) , c = function ( ) { $ ( this . el ) . html ( " " ) , $ ( " . contentDiv " ) . remove ( ) , $ ( " . headerBar " ) . remove ( ) , $ ( " . dashboard - headerbar " ) . remove ( ) , $ ( " . dashboard - row " ) . remove ( ) , $ ( this . el ) . append ( ' < div style = " color : red " > You do not have permission to view this page . < / div > ' ) , $ ( this . el ) . append ( " < div style = \ " color : red \ " > You can switch to ' _system ' to see the dashboard . < / div > " ) } . bind ( this ) ; if ( " _system " ! = = frontendConfig . db ) return void c ( ) ; var d = function ( d , e ) { d | | ( e ? this . getStatistics ( b , a ) : c ( ) ) } . bind ( this ) ; void 0 = = = window . App . currentDB . get ( " name " ) ? window . setTimeout ( function ( ) { return " _system " ! = = window . App . currentDB . get ( " name " ) ? void c ( ) : void this . options . database . hasSystemAccess ( d ) } . bind ( this ) , 300 ) : this . options . database . hasSystemAccess ( d ) } } ) } ( ) , function ( ) { " use strict " ; window . databaseView = Backbone . View . extend ( { users : null , el : " # content " , template : templateEngine . createTemplate ( " databaseView . ejs " ) , dropdownVisible : ! 1 , currentDB : " " , events : { " click # createDatabase " : " createDatabase " , " click # submitCreateDatabase " : " submitCreateDatabase " , " click . editDatabase " : " editDatabase " , " click . icon " : " editDatabase " , " click # selectDatabase " : " updateDatabase " , " click # submitDeleteDatabase " : " submitDeleteDatabase " , " click . contentRowInactive a " : " changeDatabase " , " keyup # databaseSearchInput " : " search " , " click # databaseSearchSubmit " : " search " , " click # databaseToggle " : " toggleSettingsDropdown " , " click . css - label " : " checkBoxes " , " click # dbSortDesc " : " sorting " } , sorting : function ( ) { $ ( " # dbSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # databaseDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , initialize : function ( ) { this . collection . fetch ( { async : ! 0 } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , render : function ( ) { var a = function ( a , b ) { a ? arangoHelper . arangoError ( " DB " , " Could not get current db properties " ) : ( this . currentDB = b , this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " , currentDB : this . currentDB } ) ) , this . dropdownVisible = = = ! 0 & & ( $ ( " # dbSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # databaseToggle " ) . toggleClass ( " activated " ) , $ ( " # databaseDropdown2 " ) . show ( ) ) , arangoHelper . setCheckboxStatus ( " # databaseDropdown " ) , this . replaceSVGs ( ) ) } . bind ( this ) ; return this . collection . getCurrentDatabase ( a ) , this } , toggleSettingsDropdown : function ( ) { $ ( " # dbSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # databaseToggle " ) . toggleClass ( " activated " ) , $ ( " # databaseDropdown2 " ) . slideToggle ( 200 ) } , selectedDatabase : function ( ) { return $ ( " # selectDatabases " ) . val ( ) } , handleError : function ( a , b , c ) { return 409 = = = a ? void arangoHelper . arangoError ( " DB " , " Database " + c + " already exists . " ) : 400 = = = a ? void arangoHelper . arangoError ( " DB " , " Invalid Parameters " ) : 403 = = = a ? void arangoHelper . arangoError ( " DB " , " Insufficent rights . Execute this from _system database " ) : void 0 } , validateDatabaseInfo : function ( a , b ) { return " " = = = b ? ( arangoHelper . arangoError ( " DB " , " You have to define an owner for the new database " ) , ! 1 ) : " " = = = a ? ( arangoHelper . arangoError ( " DB " , " You have to define a name for the new database " ) , ! 1 ) : 0 = = = a . indexOf ( " _ " ) ? ( arangoHelper . arangoError ( " DB " , " Databasename should not start with _ " ) , ! 1 ) : a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ \ - ] * $ / ) ? ! 0 : ( arangoHelper . arangoError ( " DB " , " Databasename may only contain numbers , letters , _ and - " ) , ! 1 ) } , createDatabase : function ( a ) { a . preventDefault ( ) , this . createAddDatabaseModal ( ) } , switchDatabase : function ( a ) { if ( ! $ ( a . target ) . parent ( ) . hasClass ( " iconSet " ) ) { var b = $ ( a . currentTarget ) . find ( " h5 " ) . text ( ) ; if ( " " ! = = b ) { var c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) ; <nl> - } } } , submitCreateDatabase : function ( ) { var a , b = this , c = $ ( " # newDatabaseName " ) . val ( ) , d = $ ( " # newUser " ) . val ( ) ; if ( a = " true " = = = $ ( " # useDefaultPassword " ) . val ( ) ? " ARANGODB_DEFAULT_ROOT_PASSWORD " : $ ( " # newPassword " ) . val ( ) , this . validateDatabaseInfo ( c , d , a ) ) { var e = { name : c , users : [ { username : d , passwd : a , active : ! 0 } ] } ; this . collection . create ( e , { wait : ! 0 , error : function ( a , d ) { b . handleError ( d . status , d . statusText , c ) } , success : function ( ) { b . updateDatabases ( ) , window . modalView . hide ( ) , window . App . naviView . dbSelectionView . render ( $ ( " # dbSelect " ) ) } } ) } } , submitDeleteDatabase : function ( a ) { var b = this . collection . where ( { name : a } ) ; b [ 0 ] . destroy ( { wait : ! 0 , url : arangoHelper . databaseUrl ( " / _api / database / " + a ) } ) , this . updateDatabases ( ) , window . App . naviView . dbSelectionView . render ( $ ( " # dbSelect " ) ) , window . modalView . hide ( ) } , changeDatabase : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) , c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } , updateDatabases : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) , window . App . handleSelectDatabase ( ) } } ) } , editDatabase : function ( a ) { var b = this . evaluateDatabaseName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - database " ) , c = ! 0 ; b = = = this . currentDB & & ( c = ! 1 ) , this . createEditDatabaseModal ( b , c ) } , search : function ( ) { var a , b , c , d ; a = $ ( " # databaseSearchInput " ) , b = $ ( " # databaseSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return - 1 ! = = a . get ( " name " ) . indexOf ( b ) } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b , currentDB : this . currentDB } ) ) , this . replaceSVGs ( ) , a = $ ( " # databaseSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " tile - icon - svg " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , evaluateDatabaseName : function ( a , b ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } , createEditDatabaseModal : function ( a , b ) { var c = [ ] , d = [ ] ; d . push ( window . modalView . createReadOnlyEntry ( " id_name " , " Name " , a , " " ) ) , b ? c . push ( window . modalView . createDeleteButton ( " Delete " , this . submitDeleteDatabase . bind ( this , a ) ) ) : c . push ( window . modalView . createDisabledButton ( " Delete " ) ) , window . modalView . show ( " modalTable . ejs " , " Delete database " , c , d ) } , createAddDatabaseModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newDatabaseName " , " Name " , " " , ! 1 , " Database Name " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Database name must start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No database name given . " } ] ) ) , b . push ( window . modalView . createTextEntry ( " newUser " , " Username " , null ! = = this . users ? this . users . whoAmI ( ) : " root " , " Please define the owner of this database . This will be the only user having initial access to this database if authentication is turned on . Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it . Specifying a username is mandatory even with authentication turned off . If there is a failure you will be informed . " , " Database Owner " , ! 0 , [ { rule : Joi . string ( ) . required ( ) , msg : " No username given . " } ] ) ) , b . push ( window . modalView . createSelectEntry ( " useDefaultPassword " , " Use default password " , ! 0 , " Read the password from the environment variable ARANGODB_DEFAULT_ROOT_PASSWORD . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) , b . push ( window . modalView . createPasswordEntry ( " newPassword " , " Password " , " " , ! 1 , " " , ! 1 ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateDatabase . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create Database " , a , b ) , $ ( " # useDefaultPassword " ) . change ( function ( ) { " true " = = = $ ( " # useDefaultPassword " ) . val ( ) ? $ ( " # row_newPassword " ) . hide ( ) : $ ( " # row_newPassword " ) . show ( ) } ) , $ ( " # row_newPassword " ) . hide ( ) } } ) } ( ) , function ( ) { " use strict " ; window . DBSelectionView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " dbSelectionView . ejs " ) , events : { " click . dbSelectionLink " : " changeDatabase " } , initialize : function ( a ) { this . current = a . current } , changeDatabase : function ( a ) { var b = $ ( a . currentTarget ) . closest ( " . dbSelectionLink . tab " ) . attr ( " id " ) , c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } , render : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " DB " , " Could not fetch databases " ) : ( this . $ el = a , this . $ el . html ( this . template . render ( { list : c , current : this . current . get ( " name " ) } ) ) , this . delegateEvents ( ) ) } . bind ( this ) ; return this . collection . getDatabasesForUser ( b ) , this . el } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a ) { var b = a . split ( " / " ) ; return " collection / " + encodeURIComponent ( b [ 0 ] ) + " / " + encodeURIComponent ( b [ 1 ] ) } ; window . DocumentView = Backbone . View . extend ( { el : " # content " , colid : 0 , docid : 0 , customView : ! 1 , defaultMode : " tree " , template : templateEngine . createTemplate ( " documentView . ejs " ) , events : { " click # saveDocumentButton " : " saveDocument " , " click # deleteDocumentButton " : " deleteDocumentModal " , " click # confirmDeleteDocument " : " deleteDocument " , " click # document - from " : " navigateToDocument " , " click # document - to " : " navigateToDocument " , " keydown # documentEditor . ace_editor " : " keyPress " , " keyup . jsoneditor . search input " : " checkSearchBox " , " click . jsoneditor . modes " : " storeMode " } , checkSearchBox : function ( a ) { " " = = = $ ( a . currentTarget ) . val ( ) & & this . editor . expandAll ( ) } , storeMode : function ( ) { var a = this ; $ ( " . type - modes " ) . on ( " click " , function ( b ) { a . defaultMode = $ ( b . currentTarget ) . text ( ) . toLowerCase ( ) } ) } , keyPress : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? ( a . preventDefault ( ) , this . saveDocument ( ) ) : a . metaKey & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . saveDocument ( ) ) } , editor : 0 , setType : function ( a ) { a = 2 = = = a ? " document " : " edge " ; var b = function ( a , b , c ) { if ( a ) console . log ( b ) , arangoHelper . arangoError ( " Error " , " Could not fetch data . " ) ; else { var d = c + " : " ; this . type = c , this . fillInfo ( d ) , this . fillEditor ( ) } } . bind ( this ) ; " edge " = = = a ? this . collection . getEdge ( this . colid , this . docid , b ) : " document " = = = a & & this . collection . getDocument ( this . colid , this . docid , b ) } , deleteDocumentModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " doc - delete - button " , " Delete " , " Delete this " + this . type + " ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Document " , a , b ) } , deleteDocument : function ( ) { var a = function ( ) { if ( this . customView ) this . customDeleteFunction ( ) ; else { var a = " collection / " + encodeURIComponent ( this . colid ) + " / documents / 1 " ; window . modalView . hide ( ) , window . App . navigate ( a , { trigger : ! 0 } ) } } . bind ( this ) ; if ( " document " = = = this . type ) { var b = function ( b ) { b ? arangoHelper . arangoError ( " Error " , " Could not delete document " ) : a ( ) } . bind ( this ) ; this . collection . deleteDocument ( this . colid , this . docid , b ) } else if ( " edge " = = = this . type ) { var c = function ( b ) { b ? arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) : a ( ) } . bind ( this ) ; this . collection . deleteEdge ( this . colid , this . docid , c ) } } , navigateToDocument : function ( a ) { var b = $ ( a . target ) . attr ( " documentLink " ) ; b & & window . App . navigate ( b , { trigger : ! 0 } ) } , fillInfo : function ( b ) { var c = this . collection . first ( ) , d = c . get ( " _id " ) , e = c . get ( " _key " ) , f = c . get ( " _rev " ) , g = c . get ( " _from " ) , h = c . get ( " _to " ) ; if ( $ ( " # document - type " ) . text ( b ) , $ ( " # document - id " ) . text ( d ) , $ ( " # document - key " ) . text ( e ) , $ ( " # document - rev " ) . text ( f ) , g & & h ) { var i = a ( g ) , j = a ( h ) ; $ ( " # document - from " ) . text ( g ) , $ ( " # document - from " ) . attr ( " documentLink " , i ) , $ ( " # document - to " ) . text ( h ) , $ ( " # document - to " ) . attr ( " documentLink " , j ) } else $ ( " . edge - info - container " ) . hide ( ) } , fillEditor : function ( ) { var a = this . removeReadonlyKeys ( this . collection . first ( ) . attributes ) ; $ ( " . disabledBread " ) . last ( ) . text ( this . collection . first ( ) . get ( " _key " ) ) , this . editor . set ( a ) , $ ( " . ace_content " ) . attr ( " font - size " , " 11pt " ) } , jsonContentChanged : function ( ) { this . enableSaveButton ( ) } , resize : function ( ) { $ ( " # documentEditor " ) . height ( $ ( " . centralRow " ) . height ( ) - 300 ) } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " # documentEditor " ) . height ( $ ( " . centralRow " ) . height ( ) - 300 ) , this . disableSaveButton ( ) , this . breadcrumb ( ) ; var a = this , b = document . getElementById ( " documentEditor " ) , c = { change : function ( ) { a . jsonContentChanged ( ) } , search : ! 0 , mode : " tree " , modes : [ " tree " , " code " ] , iconlib : " fontawesome4 " } ; return this . editor = new JSONEditor ( b , c ) , this . editor . setMode ( this . defaultMode ) , this } , removeReadonlyKeys : function ( a ) { return _ . omit ( a , [ " _key " , " _id " , " _from " , " _to " , " _rev " ] ) } , saveDocument : function ( ) { if ( void 0 = = = $ ( " # saveDocumentButton " ) . attr ( " disabled " ) ) if ( " _ " = = = this . collection . first ( ) . attributes . _id . substr ( 0 , 1 ) ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " doc - save - system - button " , " Caution " , " You are modifying a system collection . Really continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . confirmSaveDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify System Collection " , a , b ) } else this . confirmSaveDocument ( ) } , confirmSaveDocument : function ( ) { window . modalView . hide ( ) ; var a ; try { a = this . editor . get ( ) } catch ( b ) { return this . errorConfirmation ( b ) , void this . disableSaveButton ( ) } if ( a = JSON . stringify ( a ) , " document " = = = this . type ) { var c = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not save document . " ) : ( this . successConfirmation ( ) , this . disableSaveButton ( ) ) } . bind ( this ) ; this . collection . saveDocument ( this . colid , this . docid , a , c ) } else if ( " edge " = = = this . type ) { var d = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not save edge . " ) : ( this . successConfirmation ( ) , this . disableSaveButton ( ) ) } . bind ( this ) ; this . collection . saveEdge ( this . colid , this . docid , a , d ) } } , successConfirmation : function ( ) { arangoHelper . arangoNotification ( " Document saved . " ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # C6FFB0 " } , 500 ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # C6FFB0 " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) } , errorConfirmation : function ( a ) { arangoHelper . arangoError ( " Document editor : " , a ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # FFB0B0 " } , 500 ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # FFB0B0 " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) } , enableSaveButton : function ( ) { $ ( " # saveDocumentButton " ) . prop ( " disabled " , ! 1 ) , $ ( " # saveDocumentButton " ) . addClass ( " button - success " ) , $ ( " # saveDocumentButton " ) . removeClass ( " button - close " ) } , disableSaveButton : function ( ) { $ ( " # saveDocumentButton " ) . prop ( " disabled " , ! 0 ) , $ ( " # saveDocumentButton " ) . addClass ( " button - close " ) , $ ( " # saveDocumentButton " ) . removeClass ( " button - success " ) } , breadcrumb : function ( ) { var a = window . location . hash . split ( " / " ) ; $ ( " # subNavigationBar . breadcrumb " ) . html ( ' < a href = " # collection / ' + a [ 1 ] + ' / documents / 1 " > Collection : ' + a [ 1 ] + ' < / a > < i class = " fa fa - chevron - right " > < / i > Document : ' + a [ 2 ] ) } , escaped : function ( a ) { return a . replace ( / & / g , " & amp ; " ) . replace ( / < / g , " & lt ; " ) . replace ( / > / g , " & gt ; " ) . replace ( / " / g , " & quot ; " ) . replace ( / ' / g , " & # 39 ; " ) } } ) } ( ) , function ( ) { " use strict " ; window . DocumentsView = window . PaginationView . extend ( { filters : { 0 : ! 0 } , filterId : 0 , paginationDiv : " # documentsToolbarF " , idPrefix : " documents " , addDocumentSwitch : ! 0 , activeFilter : ! 1 , lastCollectionName : void 0 , restoredFilters : [ ] , editMode : ! 1 , allowUpload : ! 1 , el : " # content " , table : " # documentsTableID " , template : templateEngine . createTemplate ( " documentsView . ejs " ) , collectionContext : { prev : null , next : null } , editButtons : [ " # deleteSelected " , " # moveSelected " ] , initialize : function ( a ) { this . documentStore = a . documentStore , this . collectionsStore = a . collectionsStore , this . tableView = new window . TableView ( { el : this . table , collection : this . collection } ) , this . tableView . setRowClick ( this . clicked . bind ( this ) ) , this . tableView . setRemoveClick ( this . remove . bind ( this ) ) } , resize : function ( ) { $ ( " # docPureTable " ) . height ( $ ( " . centralRow " ) . height ( ) - 210 ) , $ ( " # docPureTable . pure - table - body " ) . css ( " max - height " , $ ( " # docPureTable " ) . height ( ) - 47 ) } , setCollectionId : function ( a , b ) { this . collection . setCollection ( a ) , this . collection . setPage ( b ) , this . page = b ; var c = function ( b , c ) { b ? arangoHelper . arangoError ( " Error " , " Could not get collection properties . " ) : ( this . type = c , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . collectionModel = this . collectionsStore . get ( a ) ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , c ) } , getDocsCallback : function ( a ) { $ ( " # documents_last " ) . css ( " visibility " , " hidden " ) , $ ( " # documents_first " ) . css ( " visibility " , " hidden " ) , a ? ( window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Could not fetch requested documents . " ) ) : a & & void 0 = = = a | | ( window . progressView . hide ( ) , this . drawTable ( ) , this . renderPaginationElements ( ) ) } , events : { " click # collectionPrev " : " prevCollection " , " click # collectionNext " : " nextCollection " , " click # filterCollection " : " filterCollection " , " click # markDocuments " : " editDocuments " , " click # importCollection " : " importCollection " , " click # exportCollection " : " exportCollection " , " click # filterSend " : " sendFilter " , " click # addFilterItem " : " addFilterItem " , " click . removeFilterItem " : " removeFilterItem " , " click # deleteSelected " : " deleteSelectedDocs " , " click # moveSelected " : " moveSelectedDocs " , " click # addDocumentButton " : " addDocumentModal " , " click # documents_first " : " firstDocuments " , " click # documents_last " : " lastDocuments " , " click # documents_prev " : " prevDocuments " , " click # documents_next " : " nextDocuments " , " click # confirmDeleteBtn " : " confirmDelete " , " click . key " : " nop " , keyup : " returnPressedHandler " , " keydown . queryline input " : " filterValueKeydown " , " click # importModal " : " showImportModal " , " click # resetView " : " resetView " , " click # confirmDocImport " : " startUpload " , " click # exportDocuments " : " startDownload " , " change # documentSize " : " setPagesize " , " change # docsSort " : " setSorting " } , showSpinner : function ( ) { $ ( " # uploadIndicator " ) . show ( ) } , hideSpinner : function ( ) { $ ( " # uploadIndicator " ) . hide ( ) } , showImportModal : function ( ) { $ ( " # docImportModal " ) . modal ( " show " ) } , hideImportModal : function ( ) { $ ( " # docImportModal " ) . modal ( " hide " ) } , setPagesize : function ( ) { var a = $ ( " # documentSize " ) . find ( " : selected " ) . val ( ) ; this . collection . setPagesize ( a ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) } , setSorting : function ( ) { var a = $ ( " # docsSort " ) . val ( ) ; ( " " = = = a | | void 0 = = = a | | null = = = a ) & & ( a = " _key " ) , this . collection . setSort ( a ) } , returnPressedHandler : function ( a ) { 13 = = = a . keyCode & & $ ( a . target ) . is ( $ ( " # docsSort " ) ) & & this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , 13 = = = a . keyCode & & $ ( " # confirmDeleteBtn " ) . attr ( " disabled " ) = = = ! 1 & & this . confirmDelete ( ) } , nop : function ( a ) { a . stopPropagation ( ) } , resetView : function ( ) { var a = function ( a ) { a & & arangoHelper . arangoError ( " Document " , " Could not fetch documents count " ) } . bind ( this ) ; $ ( " input " ) . val ( " " ) , $ ( " select " ) . val ( " = = " ) , this . removeAllFilterItems ( ) , $ ( " # documentSize " ) . val ( this . collection . getPageSize ( ) ) , $ ( " # documents_last " ) . css ( " visibility " , " visible " ) , $ ( " # documents_first " ) . css ( " visibility " , " visible " ) , this . addDocumentSwitch = ! 0 , this . collection . resetFilter ( ) , this . collection . loadTotal ( a ) , this . restoredFilters = [ ] , this . allowUpload = ! 1 , this . files = void 0 , this . file = void 0 , $ ( " # confirmDocImport " ) . attr ( " disabled " , ! 0 ) , this . markFilterToggle ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) } , startDownload : function ( ) { var a = this . collection . buildDownloadDocumentQuery ( ) ; " " ! = = a | | void 0 ! = = a | | null ! = = a ? window . open ( encodeURI ( " query / result / download / " + btoa ( JSON . stringify ( a ) ) ) ) : arangoHelper . arangoError ( " Document error " , " could not download documents " ) } , startUpload : function ( ) { var a = function ( a , b ) { a ? ( arangoHelper . arangoError ( " Upload " , b ) , this . hideSpinner ( ) ) : ( this . hideSpinner ( ) , this . hideImportModal ( ) , this . resetView ( ) ) } . bind ( this ) ; this . allowUpload = = = ! 0 & & ( this . showSpinner ( ) , this . collection . uploadDocuments ( this . file , a ) ) } , uploadSetup : function ( ) { var a = this ; $ ( " # importDocuments " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , $ ( " # confirmDocImport " ) . attr ( " disabled " , ! 1 ) , a . allowUpload = ! 0 } ) } , buildCollectionLink : function ( a ) { return " collection / " + encodeURIComponent ( a . get ( " name " ) ) + " / documents / 1 " } , markFilterToggle : function ( ) { this . restoredFilters . length > 0 ? $ ( " # filterCollection " ) . addClass ( " activated " ) : $ ( " # filterCollection " ) . removeClass ( " activated " ) } , editDocuments : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , this . markFilterToggle ( ) , $ ( " # markDocuments " ) . toggleClass ( " activated " ) , this . changeEditMode ( ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # importHeader " ) . hide ( ) , $ ( " # editHeader " ) . slideToggle ( 200 ) , $ ( " # exportHeader " ) . hide ( ) } , filterCollection : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , this . markFilterToggle ( ) , this . activeFilter = ! 0 , $ ( " # importHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) , $ ( " # exportHeader " ) . hide ( ) , $ ( " # filterHeader " ) . slideToggle ( 200 ) ; var a ; for ( a in this . filters ) if ( this . filters . hasOwnProperty ( a ) ) return void $ ( " # attribute_name " + a ) . focus ( ) } , exportCollection : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # filterHeader " ) . removeClass ( " activated " ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , $ ( " # exportCollection " ) . toggleClass ( " activated " ) , this . markFilterToggle ( ) , $ ( " # exportHeader " ) . slideToggle ( 200 ) , $ ( " # importHeader " ) . hide ( ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) } , importCollection : function ( ) { this . markFilterToggle ( ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , $ ( " # importCollection " ) . toggleClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , $ ( " # importHeader " ) . slideToggle ( 200 ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) , $ ( " # exportHeader " ) . hide ( ) } , changeEditMode : function ( a ) { a = = = ! 1 | | this . editMode = = = ! 0 ? ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) . css ( " cursor " , " default " ) , $ ( " . deleteButton " ) . fadeIn ( ) , $ ( " . addButton " ) . fadeIn ( ) , $ ( " . selected - row " ) . removeClass ( " selected - row " ) , this . editMode = ! 1 , this . tableView . setRowClick ( this . clicked . bind ( this ) ) ) : ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) . css ( " cursor " , " copy " ) , $ ( " . deleteButton " ) . fadeOut ( ) , $ ( " . addButton " ) . fadeOut ( ) , $ ( " . selectedCount " ) . text ( 0 ) , this . editMode = ! 0 , this . tableView . setRowClick ( this . editModeClick . bind ( this ) ) ) } , getFilterContent : function ( ) { var a , b , c = [ ] ; for ( a in this . filters ) if ( this . filters . hasOwnProperty ( a ) ) { b = $ ( " # attribute_value " + a ) . val ( ) ; try { b = JSON . parse ( b ) } catch ( d ) { b = String ( b ) } " " ! = = $ ( " # attribute_name " + a ) . val ( ) & & c . push ( { attribute : $ ( " # attribute_name " + a ) . val ( ) , operator : $ ( " # operator " + a ) . val ( ) , value : b } ) } return c } , sendFilter : function ( ) { this . restoredFilters = this . getFilterContent ( ) ; var a = this ; this . collection . resetFilter ( ) , this . addDocumentSwitch = ! 1 , _ . each ( this . restoredFilters , function ( b ) { void 0 ! = = b . operator & & a . collection . addFilter ( b . attribute , b . operator , b . value ) } ) , this . collection . setToFirst ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . markFilterToggle ( ) } , restoreFilter : function ( ) { var a = this , b = 0 ; this . filterId = 0 , $ ( " # docsSort " ) . val ( this . collection . getSort ( ) ) , _ . each ( this . restoredFilters , function ( c ) { 0 ! = = b & & a . addFilterItem ( ) , void 0 ! = = c . operator & & ( $ ( " # attribute_name " + b ) . val ( c . attribute ) , $ ( " # operator " + b ) . val ( c . operator ) , $ ( " # attribute_value " + b ) . val ( c . value ) ) , b + + , a . collection . addFilter ( c . attribute , c . operator , c . value ) } ) } , addFilterItem : function ( ) { var a = + + this . filterId ; $ ( " # filterHeader " ) . append ( ' < div class = " queryline querylineAdd " > < input id = " attribute_name ' + a + ' " type = " text " placeholder = " Attribute name " > < select name = " operator " id = " operator ' + a + ' " class = " filterSelect " > < option value = " = = " > = = < / option > < option value = " ! = " > ! = < / option > < option value = " & lt ; " > & lt ; < / option > < option value = " & lt ; = " > & lt ; = < / option > < option value = " & gt ; = " > & gt ; = < / option > < option value = " & gt ; " > & gt ; < / option > < / select > < input id = " attribute_value ' + a + ' " type = " text " placeholder = " Attribute value " class = " filterValue " > < a class = " removeFilterItem " id = " removeFilter ' + a + ' " > < i class = " icon icon - minus arangoicon " > < / i > < / a > < / div > ' ) , this . filters [ a ] = ! 0 } , filterValueKeydown : function ( a ) { 13 = = = a . keyCode & & this . sendFilter ( ) } , removeFilterItem : function ( a ) { var b = a . currentTarget , c = b . id . replace ( / ^ removeFilter / , " " ) ; delete this . filters [ c ] , delete this . restoredFilters [ c ] , $ ( b . parentElement ) . remove ( ) } , removeAllFilterItems : function ( ) { var a , b = $ ( " # filterHeader " ) . children ( ) . length ; for ( a = 1 ; b > = a ; a + + ) $ ( " # removeFilter " + a ) . parent ( ) . remove ( ) ; this . filters = { 0 : ! 0 } , this . filterId = 0 } , addDocumentModal : function ( ) { var a = window . location . hash . split ( " / " ) [ 1 ] , b = [ ] , c = [ ] , d = function ( a , d ) { a ? arangoHelper . arangoError ( " Error " , " Could not fetch collection type " ) : " edge " = = = d ? ( c . push ( window . modalView . createTextEntry ( " new - edge - from - attr " , " _from " , " " , " document _id : document handle of the linked vertex ( incoming relation ) " , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No _from attribute given . " } ] ) ) , c . push ( window . modalView . createTextEntry ( " new - edge - to " , " _to " , " " , " document _id : document handle of the linked vertex ( outgoing relation ) " , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No _to attribute given . " } ] ) ) , c . push ( window . modalView . createTextEntry ( " new - edge - key - attr " , " _key " , void 0 , " the edges unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSuccessButton ( " Create " , this . addEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create edge " , b , c ) ) : ( c . push ( window . modalView . createTextEntry ( " new - document - key - attr " , " _key " , void 0 , " the documents unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSuccessButton ( " Create " , this . addDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create document " , b , c ) ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , ! 0 , d ) } , addEdge : function ( ) { var a , b = window . location . hash . split ( " / " ) [ 1 ] , c = $ ( " . modal - body # new - edge - from - attr " ) . last ( ) . val ( ) , d = $ ( " . modal - body # new - edge - to " ) . last ( ) . val ( ) , e = $ ( " . modal - body # new - edge - key - attr " ) . last ( ) . val ( ) , f = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Error " , " Could not create edge " ) ; else { window . modalView . hide ( ) , c = c . _id . split ( " / " ) ; try { a = " collection / " + c [ 0 ] + " / " + c [ 1 ] , decodeURI ( a ) } catch ( d ) { a = " collection / " + c [ 0 ] + " / " + encodeURIComponent ( c [ 1 ] ) } window . location . hash = a } } . bind ( this ) ; " " ! = = e | | void 0 ! = = e ? this . documentStore . createTypeEdge ( b , c , d , e , f ) : this . documentStore . createTypeEdge ( b , c , d , null , f ) } , addDocument : function ( ) { var a , b = window . location . hash . split ( " / " ) [ 1 ] , c = $ ( " . modal - body # new - document - key - attr " ) . last ( ) . val ( ) , d = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Error " , " Could not create document " ) ; else { window . modalView . hide ( ) , c = c . split ( " / " ) ; try { a = " collection / " + c [ 0 ] + " / " + c [ 1 ] , decodeURI ( a ) } catch ( d ) { a = " collection / " + c [ 0 ] + " / " + encodeURIComponent ( c [ 1 ] ) } window . location . hash = a } } . bind ( this ) ; " " ! = = c | | void 0 ! = = c ? this . documentStore . createTypeDocument ( b , c , d ) : this . documentStore . createTypeDocument ( b , null , d ) } , moveSelectedDocs : function ( ) { var a = [ ] , b = [ ] , c = this . getSelectedDocs ( ) ; 0 ! = = c . length & & ( b . push ( window . modalView . createTextEntry ( " move - documents - to " , " Move to " , " " , ! 1 , " collection - name " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Move " , this . confirmMoveSelectedDocs . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Move documents " , a , b ) ) } , confirmMoveSelectedDocs : function ( ) { var a = this . getSelectedDocs ( ) , b = this , c = $ ( " . modal - body " ) . last ( ) . find ( " # move - documents - to " ) . val ( ) , d = function ( ) { this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) } . bind ( this ) ; _ . each ( a , function ( a ) { b . collection . moveDocument ( a , b . collection . collectionID , c , d ) } ) } , deleteSelectedDocs : function ( ) { var a = [ ] , b = [ ] , c = this . getSelectedDocs ( ) ; 0 ! = = c . length & & ( b . push ( window . modalView . createReadOnlyEntry ( void 0 , c . length + " documents selected " , " Do you want to delete all selected documents ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . confirmDeleteSelectedDocs . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete documents " , a , b ) ) } , confirmDeleteSelectedDocs : function ( ) { var a = this . getSelectedDocs ( ) , b = [ ] , c = this ; _ . each ( a , function ( a ) { if ( " document " = = = c . type ) { var d = function ( a ) { a ? ( b . push ( ! 1 ) , arangoHelper . arangoError ( " Document error " , " Could not delete document . " ) ) : ( b . push ( ! 0 ) , c . collection . setTotalMinusOne ( ) , c . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) ) } . bind ( c ) ; c . documentStore . deleteDocument ( c . collection . collectionID , a , d ) } else if ( " edge " = = = c . type ) { var e = function ( a ) { a ? ( b . push ( ! 1 ) , arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) ) : ( c . collection . setTotalMinusOne ( ) , b . push ( ! 0 ) , c . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) ) } . bind ( c ) ; c . documentStore . deleteEdge ( c . collection . collectionID , a , e ) } } ) } , getSelectedDocs : function ( ) { var a = [ ] ; return _ . each ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) , function ( b ) { $ ( b ) . hasClass ( " selected - row " ) & & a . push ( $ ( $ ( b ) . children ( ) [ 1 ] ) . find ( " . key " ) . text ( ) ) } ) , a } , remove : function ( a ) { this . docid = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . find ( " . key " ) . text ( ) , $ ( " # confirmDeleteBtn " ) . attr ( " disabled " , ! 1 ) , $ ( " # docDeleteModal " ) . modal ( " show " ) } , confirmDelete : function ( ) { $ ( " # confirmDeleteBtn " ) . attr ( " disabled " , ! 0 ) ; var a = window . location . hash . split ( " / " ) , b = a [ 3 ] ; " source " ! = = b & & this . reallyDelete ( ) } , reallyDelete : function ( ) { if ( " document " = = = this . type ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not delete document " ) : ( this . collection . setTotalMinusOne ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # docDeleteModal " ) . modal ( " hide " ) ) } . bind ( this ) ; this . documentStore . deleteDocument ( this . collection . collectionID , this . docid , a ) } else if ( " edge " = = = this . type ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) : ( this . collection . setTotalMinusOne ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # docDeleteModal " ) . modal ( " hide " ) ) } . bind ( this ) ; this . documentStore . deleteEdge ( this . collection . collectionID , this . docid , b ) } } , editModeClick : function ( a ) { var b = $ ( a . currentTarget ) ; b . hasClass ( " selected - row " ) ? b . removeClass ( " selected - row " ) : b . addClass ( " selected - row " ) , console . log ( b ) ; var c = this . getSelectedDocs ( ) ; $ ( " . selectedCount " ) . text ( c . length ) , _ . each ( this . editButtons , function ( a ) { c . length > 0 ? ( $ ( a ) . prop ( " disabled " , ! 1 ) , $ ( a ) . removeClass ( " button - neutral " ) , $ ( a ) . removeClass ( " disabled " ) , " # moveSelected " = = = a ? $ ( a ) . addClass ( " button - success " ) : $ ( a ) . addClass ( " button - danger " ) ) : ( $ ( a ) . prop ( " disabled " , ! 0 ) , $ ( a ) . addClass ( " disabled " ) , $ ( a ) . addClass ( " button - neutral " ) , " # moveSelected " = = = a ? $ ( a ) . removeClass ( " button - success " ) : $ ( a ) . removeClass ( " button - danger " ) ) } ) } , clicked : function ( a ) { var b , c = a . currentTarget , d = $ ( c ) . attr ( " id " ) . substr ( 4 ) ; try { b = " collection / " + this . collection . collectionID + " / " + d , decodeURI ( d ) } catch ( e ) { b = " collection / " + this . collection . collectionID + " / " + encodeURIComponent ( d ) } window . location . hash = b } , drawTable : function ( ) { this . tableView . setElement ( $ ( " # docPureTable " ) ) . render ( ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " top " ) , $ ( " . prettify " ) . snippet ( " javascript " , { style : " nedit " , menu : ! 1 , startText : ! 1 , transparent : ! 0 , showNum : ! 1 } ) , this . resize ( ) } , checkCollectionState : function ( ) { this . lastCollectionName = = = this . collectionName ? this . activeFilter & & ( this . filterCollection ( ) , this . restoreFilter ( ) ) : void 0 ! = = this . lastCollectionName & & ( this . collection . resetFilter ( ) , this . collection . setSort ( " " ) , this . restoredFilters = [ ] , this . activeFilter = ! 1 ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , 2 = = = this . type ? this . type = " document " : 3 = = = this . type & & ( this . type = " edge " ) , this . tableView . setElement ( $ ( this . table ) ) . drawLoading ( ) , this . collectionContext = this . collectionsStore . getPosition ( this . collection . collectionID ) , this . collectionName = window . location . hash . split ( " / " ) [ 1 ] , this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Content " ) , this . checkCollectionState ( ) , this . lastCollectionName = this . collectionName , this . uploadSetup ( ) , $ ( " [ data - toggle = tooltip ] " ) . tooltip ( ) , $ ( " . upload - info " ) . tooltip ( ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " top " ) , this . renderPaginationElements ( ) , this . selectActivePagesize ( ) , this . markFilterToggle ( ) , this . resize ( ) , this } , rerender : function ( ) { this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . resize ( ) } , selectActivePagesize : function ( ) { $ ( " # documentSize " ) . val ( this . collection . getPageSize ( ) ) } , renderPaginationElements : function ( ) { this . renderPagination ( ) ; var a = $ ( " # totalDocuments " ) ; 0 = = = a . length & & ( $ ( " # documentsToolbarFL " ) . append ( ' < a id = " totalDocuments " class = " totalDocuments " > < / a > ' ) , a = $ ( " # totalDocuments " ) ) , " document " = = = this . type & & a . html ( numeral ( this . collection . getTotal ( ) ) . format ( " 0 , 0 " ) + " document ( s ) " ) , " edge " = = = this . type & & a . html ( numeral ( this . collection . getTotal ( ) ) . format ( " 0 , 0 " ) + " edge ( s ) " ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } } ) } ( ) , function ( ) { " use strict " ; window . EditListEntryView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " editListEntryView . ejs " ) , initialize : function ( a ) { this . key = a . key , this . value = a . value , this . render ( ) } , events : { " click . deleteAttribute " : " removeRow " } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { key : this . key , value : JSON . stringify ( this . value ) , isReadOnly : this . isReadOnly ( ) } ) ) } , isReadOnly : function ( ) { return 0 = = = this . key . indexOf ( " _ " ) } , getKey : function ( ) { return $ ( " . key " ) . val ( ) } , getValue : function ( ) { var val = $ ( " . val " ) . val ( ) ; try { val = JSON . parse ( val ) } catch ( e ) { try { return eval ( " val = " + val ) , val } catch ( e2 ) { return $ ( " . val " ) . val ( ) } } return val } , removeRow : function ( ) { this . remove ( ) } } ) } ( ) , function ( ) { " use strict " ; window . FooterView = Backbone . View . extend ( { el : " # footerBar " , system : { } , isOffline : ! 0 , isOfflineCounter : 0 , firstLogin : ! 0 , timer : 15e3 , lap : 0 , timerFunction : null , events : { " click . footer - center p " : " showShortcutModal " } , initialize : function ( ) { var a = this ; window . setInterval ( function ( ) { a . getVersion ( ) } , a . timer ) , a . getVersion ( ) , window . VISIBLE = ! 0 , document . addEventListener ( " visibilitychange " , function ( ) { window . VISIBLE = ! window . VISIBLE } ) , $ ( " # offlinePlaceholder button " ) . on ( " click " , function ( ) { a . getVersion ( ) } ) } , template : templateEngine . createTemplate ( " footerView . ejs " ) , showServerStatus : function ( a ) { var b = this ; window . App . isCluster ? b . collection . fetch ( { success : function ( ) { b . renderClusterState ( ! 0 ) } , error : function ( ) { b . renderClusterState ( ! 1 ) } } ) : a = = = ! 0 ? ( $ ( " # healthStatus " ) . removeClass ( " negative " ) , $ ( " # healthStatus " ) . addClass ( " positive " ) , $ ( " . health - state " ) . html ( " GOOD " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - check - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . hide ( ) ) : ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , $ ( " . health - state " ) . html ( " UNKNOWN " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . show ( ) , this . reconnectAnimation ( 0 ) ) } , reconnectAnimation : function ( a ) { var b = this ; 0 = = = a & & ( b . lap = a , $ ( " # offlineSeconds " ) . text ( b . timer / 1e3 ) , clearTimeout ( b . timerFunction ) ) , b . lap < this . timer / 1e3 & & ( b . lap + + , $ ( " # offlineSeconds " ) . text ( b . timer / 1e3 - b . lap ) , b . timerFunction = window . setTimeout ( function ( ) { b . timer / 1e3 - b . lap = = = 0 ? b . getVersion ( ) : b . reconnectAnimation ( b . lap ) } , 1e3 ) ) } , renderClusterState : function ( a ) { var b = 0 ; a ? ( $ ( " # offlinePlaceholder " ) . hide ( ) , this . collection . each ( function ( a ) { " ok " ! = = a . toJSON ( ) . status & & b + + } ) , b > 0 ? ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , 1 = = = b ? $ ( " . health - state " ) . html ( b + " NODE ERROR " ) : $ ( " . health - state " ) . html ( b + " NODES ERROR " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) ) : ( $ ( " # healthStatus " ) . removeClass ( " negative " ) , $ ( " # healthStatus " ) . addClass ( " positive " ) , $ ( " . health - state " ) . html ( " NODES OK " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - check - circle " > < / i > ' ) ) ) : ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , $ ( " . health - state " ) . html ( window . location . host + " OFFLINE " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . show ( ) , this . reconnectAnimation ( 0 ) ) } , showShortcutModal : function ( ) { window . arangoHelper . hotkeysFunctions . showHotkeysModal ( ) } , getVersion : function ( ) { var a = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / version " ) , <nl> + function JSONAdapter ( a , b , c , d , e , f ) { " use strict " ; var g = this , h = { } , i = { } , j = new AbstractAdapter ( b , c , this , d ) ; h . range = e / 2 , h . start = e / 4 , h . getStart = function ( ) { return this . start + Math . random ( ) * this . range } , i . range = f / 2 , i . start = f / 4 , i . getStart = function ( ) { return this . start + Math . random ( ) * this . range } , g . loadNode = function ( a , b ) { g . loadNodeFromTreeById ( a , b ) } , g . loadInitialNode = function ( b , c ) { var d = a + b + " . json " ; j . cleanUp ( ) , d3 . json ( d , function ( a , d ) { void 0 ! = = a & & null ! = = a & & console . log ( a ) ; var e = j . insertInitialNode ( d ) ; g . requestCentralityChildren ( b , function ( a ) { e . _centrality = a } ) , _ . each ( d . children , function ( a ) { var b = j . insertNode ( a ) , c = { _from : e . _id , _to : b . _id , _id : e . _id + " - " + b . _id } ; j . insertEdge ( c ) , g . requestCentralityChildren ( b . _id , function ( a ) { b . _centrality = a } ) , delete b . _data . children } ) , delete e . _data . children , c & & c ( e ) } ) } , g . loadNodeFromTreeById = function ( b , c ) { var d = a + b + " . json " ; d3 . json ( d , function ( a , d ) { void 0 ! = = a & & null ! = = a & & console . log ( a ) ; var e = j . insertNode ( d ) ; g . requestCentralityChildren ( b , function ( a ) { e . _centrality = a } ) , _ . each ( d . children , function ( a ) { var b = j . insertNode ( a ) , c = { _from : e . _id , _to : b . _id , _id : e . _id + " - " + b . _id } ; j . insertEdge ( c ) , g . requestCentralityChildren ( b . _id , function ( a ) { e . _centrality = a } ) , delete b . _data . children } ) , delete e . _data . children , c & & c ( e ) } ) } , g . requestCentralityChildren = function ( b , c ) { var d = a + b + " . json " ; d3 . json ( d , function ( a , b ) { void 0 ! = = a & & null ! = = a & & console . log ( a ) , void 0 ! = = c & & c ( void 0 ! = = b . children ? b . children . length : 0 ) } ) } , g . loadNodeFromTreeByAttributeValue = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . loadInitialNodeByAttributeValue = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . createEdge = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . deleteEdge = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . patchEdge = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . createNode = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . deleteNode = function ( a , b ) { throw " Sorry this adapter is read - only " } , g . patchNode = function ( a , b , c ) { throw " Sorry this adapter is read - only " } , g . setNodeLimit = function ( a , b ) { } , g . setChildLimit = function ( a ) { } , g . expandCommunity = function ( a , b ) { } , g . setWidth = function ( ) { } , g . explore = j . explore } function AbstractAdapter ( a , b , c , d , e ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " An inheriting class has to be given . " ; if ( void 0 = = = d ) throw " A reference to the graph viewer has to be given . " ; e = e | | { } ; var f , g , h , i , j , k = this , l = ! 1 , m = { } , n = { } , o = { } , p = { } , q = 0 , r = { } , s = { } , t = function ( a ) { void 0 ! = = a . prioList & & g . changePrioList ( a . prioList | | [ ] ) } , u = function ( a ) { m . range = a / 2 , m . start = a / 4 , m . getStart = function ( ) { return this . start + Math . random ( ) * this . range } } , v = function ( a ) { n . range = a / 2 , n . start = a / 4 , n . getStart = function ( ) { return this . start + Math . random ( ) * this . range } } , w = function ( b ) { var c = p [ b ] | | b , d = $ . grep ( a , function ( a ) { return a . _id = = = c } ) ; if ( 0 = = = d . length ) return ! 1 ; if ( 1 = = = d . length ) return d [ 0 ] ; throw " Too many nodes with the same ID , should never happen " } , x = function ( a ) { var c = $ . grep ( b , function ( b ) { return b . _id = = = a } ) ; if ( 0 = = = c . length ) return ! 1 ; if ( 1 = = = c . length ) return c [ 0 ] ; throw " Too many edges with the same ID , should never happen " } , y = function ( b , c , d ) { var e = { _data : b , _id : b . _id } , f = w ( e . _id ) ; return f ? f : ( e . x = c | | m . getStart ( ) , e . y = d | | n . getStart ( ) , e . weight = 1 , a . push ( e ) , e . _outboundCounter = 0 , e . _inboundCounter = 0 , e ) } , z = function ( a ) { var b = y ( a ) ; return b . x = 2 * m . start , b . y = 2 * n . start , b . fixed = ! 0 , b } , A = function ( ) { a . length = 0 , b . length = 0 , p = { } , o = { } , d . cleanUp ( ) } , B = function ( a ) { var c , d , e , f = ! 0 , g = { _data : a , _id : a . _id } , i = x ( g . _id ) ; if ( i ) return i ; if ( c = w ( a . _from ) , d = w ( a . _to ) , ! c ) throw " Unable to insert Edge , source node not existing " + a . _from ; if ( ! d ) throw " Unable to insert Edge , target node not existing " + a . _to ; return g . source = c , g . source . _isCommunity ? ( e = o [ g . source . _id ] , g . source = e . getNode ( a . _from ) , g . source . _outboundCounter + + , e . insertOutboundEdge ( g ) , f = ! 1 ) : c . _outboundCounter + + , g . target = d , g . target . _isCommunity ? ( e = o [ g . target . _id ] , g . target = e . getNode ( a . _to ) , g . target . _inboundCounter + + , e . insertInboundEdge ( g ) , f = ! 1 ) : d . _inboundCounter + + , b . push ( g ) , f & & h . call ( " insertEdge " , c . _id , d . _id ) , g } , C = function ( b ) { var c ; for ( c = 0 ; c < a . length ; c + + ) if ( a [ c ] = = = b ) return void a . splice ( c , 1 ) } , D = function ( a , c ) { var d = b [ a ] , e = d . source . _id , f = d . target . _id ; b . splice ( a , 1 ) , c | | h . call ( " deleteEdge " , e , f ) } , E = function ( a , c ) { var d ; for ( d = 0 ; d < b . length ; d + + ) if ( b [ d ] = = = a ) return void D ( d , c ) } , F = function ( a ) { var c ; for ( c = 0 ; c < b . length ; c + + ) b [ c ] . source = = = a ? ( a . _outboundCounter - - , b [ c ] . target . _inboundCounter - - , D ( c ) , c - - ) : b [ c ] . target = = = a & & ( a . _inboundCounter - - , b [ c ] . source . _outboundCounter - - , D ( c ) , c - - ) } , G = function ( a , c ) { var d , e , f , g , i ; for ( d = 0 ; d < b . length ; d + + ) for ( f = b [ d ] . source , g = b [ d ] . target , e = 0 ; e < a . length ; e + + ) i = ! 1 , f = = = a [ e ] & & ( i = c . insertOutboundEdge ( b [ d ] ) , g . _isCommunity | | h . call ( " deleteEdge " , f . _id , g . _id ) , f = b [ d ] . source ) , g = = = a [ e ] & & ( i = c . insertInboundEdge ( b [ d ] ) , f . _isCommunity | | h . call ( " deleteEdge " , f . _id , g . _id ) , g = b [ d ] . target ) , i & & ( b . splice ( d , 1 ) , d - - ) } , H = function ( a ) { if ( a . _outboundCounter > 0 ) { var c , d = [ ] ; for ( c = 0 ; c < b . length ; c + + ) if ( b [ c ] . source = = = a ) { if ( d . push ( b [ c ] ) , a . _outboundCounter - - , D ( c , b [ c ] . target . _isCommunity ) , 0 = = = a . _outboundCounter ) break ; c - - } return d } } , I = function ( b , c ) { if ( b & & 0 ! = = b . length ) { var d = _ . map ( b , function ( a ) { return w ( a ) } ) , e = new CommunityNode ( k , d ) , f = e . _id ; c & & ( e . _reason = c ) , o [ f ] = e , G ( d , e ) , _ . each ( d , function ( a ) { p [ a . _id ] = f , C ( a ) } ) , a . push ( e ) , l = ! 1 } } , J = function ( a ) { var b = a . data ; if ( b . error ) return console . log ( b . cmd ) , void console . log ( b . error ) ; switch ( b . cmd ) { case " debug " : break ; case " getCommunity " : I ( b . result ) } } , K = function ( a ) { l | | ( l = ! 0 , a ? h . call ( " getCommunity " , f , a . _id ) : h . call ( " getCommunity " , f ) ) } , L = function ( b ) { var c , d = a . length , e = - ( 1 / 0 ) ; _ . each ( o , function ( a ) { a . _expanded = = = ! 0 & & ( e < a . _size & & a ! = = b & & ( c = a , e = a . _size ) , d + = a . _size ) } ) , d > f & & ( c ? c . collapse ( ) : K ( b ) ) } , M = function ( c ) { var d = c . getDissolveInfo ( ) , e = d . nodes , g = d . edges . both , i = d . edges . inbound , j = d . edges . outbound ; C ( c ) , f < a . length + e . length & & K ( ) , _ . each ( e , function ( b ) { delete p [ b . _id ] , a . push ( b ) } ) , _ . each ( i , function ( a ) { a . target = a . _target , delete a . _target , a . source . _isCommunity | | h . call ( " insertEdge " , a . source . _id , a . target . _id ) } ) , _ . each ( j , function ( a ) { a . source = a . _source , delete a . _source , a . target . _isCommunity | | h . call ( " insertEdge " , a . source . _id , a . target . _id ) } ) , _ . each ( g , function ( a ) { a . source = a . _source , delete a . _source , a . target = a . _target , delete a . _target , b . push ( a ) , h . call ( " insertEdge " , a . source . _id , a . target . _id ) } ) , delete o [ c . _id ] } , N = function ( a ) { a . expand ( ) , L ( a ) } , O = function ( a ) { if ( _ . size ( a ) > i ) { var b = g . bucketNodes ( _ . values ( a ) , i ) ; _ . each ( b , function ( a ) { if ( a . nodes . length > 1 ) { var b = _ . map ( a . nodes , function ( a ) { return a . _id } ) ; I ( b , a . reason ) } } ) } } , P = function ( a , b ) { f = a , L ( ) , void 0 ! = = b & & b ( ) } , Q = function ( a ) { i = a } , R = function ( a , b ) { a . _expanded = ! 1 ; var c = b . removeOutboundEdgesFromNode ( a ) ; _ . each ( c , function ( a ) { j ( a ) , E ( a , ! 0 ) } ) } , S = function ( a ) { a . _expanded = ! 1 , p [ a . _id ] & & o [ p [ a . _id ] ] . collapseNode ( a ) ; var b = H ( a ) , c = [ ] ; _ . each ( b , function ( b ) { 0 = = = q ? ( r = b , s = a , c . push ( b ) ) : void 0 ! = = a & & ( a . _id = = = r . target . _id ? b . target . _id = = = s . _id & & c . push ( r ) : c . push ( b ) , r = b , s = a ) , q + + } ) , _ . each ( c , j ) , q = 0 } , T = function ( a ) { var b = a . getDissolveInfo ( ) ; C ( a ) , _ . each ( b . nodes , function ( a ) { delete p [ a . _id ] } ) , _ . each ( b . edges . outbound , function ( a ) { j ( a ) , E ( a , ! 0 ) } ) , delete o [ a . _id ] } , U = function ( a , b ) { a . _isCommunity ? k . expandCommunity ( a , b ) : ( a . _expanded = ! 0 , c . loadNode ( a . _id , b ) ) } , V = function ( a , b ) { a . _expanded ? S ( a ) : U ( a , b ) } ; j = function ( a ) { var b , c = a . target ; return c . _isCommunity ? ( b = a . _target , c . removeInboundEdge ( a ) , b . _inboundCounter - - , 0 = = = b . _inboundCounter & & ( R ( b , c ) , c . removeNode ( b ) , delete p [ b . _id ] ) , void ( 0 = = = c . _inboundCounter & & T ( c ) ) ) : ( c . _inboundCounter - - , void ( 0 = = = c . _inboundCounter & & ( S ( c ) , C ( c ) ) ) ) } , i = Number . POSITIVE_INFINITY , g = e . prioList ? new NodeReducer ( e . prioList ) : new NodeReducer , h = new WebWorkerWrapper ( ModularityJoiner , J ) , m . getStart = function ( ) { return 0 } , n . getStart = function ( ) { return 0 } , this . cleanUp = A , this . setWidth = u , this . setHeight = v , this . insertNode = y , this . insertInitialNode = z , this . insertEdge = B , this . removeNode = C , this . removeEdge = E , this . removeEdgesForNode = F , this . expandCommunity = N , this . setNodeLimit = P , this . setChildLimit = Q , this . checkSizeOfInserted = O , this . checkNodeLimit = L , this . explore = V , this . changeTo = t , this . getPrioList = g . getPrioList , this . dissolveCommunity = M } function ArangoAdapter ( a , b , c , d ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " A reference to the graph viewer has to be given . " ; if ( void 0 = = = d ) throw " A configuration with node - and edgeCollection has to be given . " ; if ( void 0 = = = d . graph ) { if ( void 0 = = = d . nodeCollection ) throw " The nodeCollection or a graphname has to be given . " ; if ( void 0 = = = d . edgeCollection ) throw " The edgeCollection or a graphname has to be given . " } var e , f , g , h , i , j = this , k = { } , l = { } , m = { } , n = function ( a ) { h = a } , o = function ( a ) { f = a , l . node = l . base + " document ? collection = " + f } , p = function ( a ) { g = a , l . edge = l . base + " edge ? collection = " + g } , q = function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : l . graph + " / " + a , contentType : " application / json " , success : function ( a ) { o ( a . graph . vertices ) , p ( a . graph . edges ) } } ) } , r = function ( a ) { console . log ( a . baseUrl ) ; var b = a . baseUrl | | " " ; void 0 ! = = a . width & & e . setWidth ( a . width ) , void 0 ! = = a . height & & e . setHeight ( a . height ) , i = void 0 ! = = a . undirected & & a . undirected = = = ! 0 ? " any " : " outbound " , l . base = b + " _api / " , l . cursor = l . base + " cursor " , l . graph = l . base + " graph " , l . collection = l . base + " collection / " , l . document = l . base + " document / " , l . any = l . base + " simple / any " , a . graph ? ( q ( a . graph ) , n ( a . graph ) ) : ( o ( a . nodeCollection ) , p ( a . edgeCollection ) , n ( void 0 ) ) } , s = function ( a , b , c ) { a ! = = m . getAllGraphs & & ( a ! = = m . connectedEdges & & ( b [ " @ nodes " ] = f , a ! = = m . childrenCentrality & & ( b . dir = i ) ) , b [ " @ edges " ] = g ) ; var d = { query : a , bindVars : b } ; $ . ajax ( { type : " POST " , url : l . cursor , data : JSON . stringify ( d ) , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( a ) { c ( a . result ) } , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw " Undefined ERROR " } } } ) } , t = function ( a , b ) { var c = [ ] , d = 0 , e = function ( d ) { c . push ( d . document | | { } ) , c . length = = = a & & b ( c ) } ; for ( d = 0 ; a > d ; d + + ) $ . ajax ( { cache : ! 1 , type : " PUT " , url : l . any , data : JSON . stringify ( { collection : f } ) , contentType : " application / json " , success : e } ) } , u = function ( b , c ) { if ( 0 = = = b . length ) return void ( c & & c ( { errorCode : 404 } ) ) ; b = b [ 0 ] ; var d = { } , f = e . insertNode ( b [ 0 ] . vertex ) , g = a . length ; _ . each ( b , function ( b ) { var c = e . insertNode ( b . vertex ) , f = b . path ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) , _ . each ( f . vertices , function ( b ) { var c = e . insertNode ( b ) ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) } ) , _ . each ( f . edges , function ( a ) { e . insertEdge ( a ) } ) } ) , delete d [ f . _id ] , e . checkSizeOfInserted ( d ) , e . checkNodeLimit ( f ) , c & & c ( f ) } , v = function ( a ) { return function ( b ) { return b & & b . errorCode ? void a ( b ) : void a ( e . insertInitialNode ( b ) ) } } , w = function ( a ) { s ( m . connectedEdges , { id : a } , function ( a ) { _ . each ( a , j . deleteEdge ) } ) } ; d . prioList & & ( k . prioList = d . prioList ) , e = new AbstractAdapter ( a , b , this , c , k ) , r ( d ) , m . getAllGraphs = " FOR g IN _graphs return g . _key " , m . randomDocuments = " FOR u IN @ @ nodes sort rand ( ) limit 10 return u " , m . nodeById = ' FOR n IN @ @ nodes FILTER n . _id = = @ id LET links = ( FOR l IN @ @ edges FILTER n . _id = = l . _from FOR t IN @ @ nodes FILTER t . _id = = l . _to RETURN t . _id ) RETURN MERGE ( n , { " children " : links } ) ' , m . traversalById = ' RETURN TRAVERSAL ( @ @ nodes , @ @ edges , @ id , @ dir , { strategy : " depthfirst " , maxDepth : 1 , paths : true } ) ' , m . traversalByAttribute = function ( a ) { return " FOR n IN @ @ nodes FILTER n . " + a + ' = = @ value RETURN TRAVERSAL ( @ @ nodes , @ @ edges , n . _id , @ dir , { strategy : " depthfirst " , maxDepth : 1 , paths : true } ) ' } , m . childrenCentrality = " FOR u IN @ @ nodes FILTER u . _id = = @ id LET g = ( FOR l in @ @ edges FILTER l . _from = = u . _id RETURN 1 ) RETURN length ( g ) " , m . connectedEdges = " FOR e IN @ @ edges FILTER e . _to = = @ id | | e . _from = = @ id RETURN e " , j . explore = e . explore , j . loadNode = function ( a , b ) { j . loadNodeFromTreeById ( a , b ) } , j . loadRandomNode = function ( a ) { var b = this ; t ( 1 , function ( c ) { var d = c [ 0 ] ; return d . _id ? void b . loadInitialNode ( d . _id , a ) : void 0 } ) } , j . loadInitialNode = function ( a , b ) { e . cleanUp ( ) , j . loadNode ( a , v ( b ) ) } , j . loadNodeFromTreeById = function ( a , b ) { s ( m . traversalById , { id : a } , function ( a ) { u ( a , b ) } ) } , j . loadNodeFromTreeByAttributeValue = function ( a , b , c ) { s ( m . traversalByAttribute ( a ) , { value : b } , function ( a ) { u ( a , c ) } ) } , j . loadInitialNodeByAttributeValue = function ( a , b , c ) { e . cleanUp ( ) , j . loadNodeFromTreeByAttributeValue ( a , b , v ( c ) ) } , j . requestCentralityChildren = function ( a , b ) { s ( m . childrenCentrality , { id : a } , function ( a ) { b ( a [ 0 ] ) } ) } , j . createEdge = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : l . edge + " & from = " + a . source . _id + " & to = " + a . target . _id , data : JSON . stringify ( { } ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { c . _from = a . source . _id , c . _to = a . target . _id , delete c . error ; var d = e . insertEdge ( c ) ; b ( d ) } , error : function ( a ) { throw a . statusText } } ) } , j . deleteEdge = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : l . document + a . _id , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( ) { e . removeEdge ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { throw a . statusText } } ) } , j . patchEdge = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : l . document + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( d ) { a . _data = $ . extend ( a . _data , b ) , c ( ) } , error : function ( a ) { throw a . statusText } } ) } , j . createNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : l . node , data : JSON . stringify ( a ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { c . error = = = ! 1 & & ( a . _key = c . _key , a . _id = c . _id , a . _rev = c . _rev , e . insertNode ( a ) , b ( a ) ) } , error : function ( a ) { throw a . statusText } } ) } , j . deleteNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : l . document + a . _id , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { e . removeEdgesForNode ( a ) , w ( a . _id ) , e . removeNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { throw a . statusText } } ) } , j . patchNode = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : l . document + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( d ) { a . _data = $ . extend ( a . _data , b ) , c ( a ) } , error : function ( a ) { throw a . statusText } } ) } , j . changeToCollections = function ( a , b , c ) { e . cleanUp ( ) , o ( a ) , p ( b ) , void 0 ! = = c & & ( i = c = = = ! 0 ? " any " : " outbound " ) , n ( void 0 ) } , j . changeToGraph = function ( a , b ) { e . cleanUp ( ) , q ( a ) , void 0 ! = = b & & ( i = b = = = ! 0 ? " any " : " outbound " ) , n ( a ) } , j . setNodeLimit = function ( a , b ) { e . setNodeLimit ( a , b ) } , j . setChildLimit = function ( a ) { e . setChildLimit ( a ) } , j . expandCommunity = function ( a , b ) { e . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } , j . getCollections = function ( a ) { a & & a . length > = 2 & & $ . ajax ( { cache : ! 1 , type : " GET " , url : l . collection , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( b ) { var c = b . collections , d = [ ] , e = [ ] ; _ . each ( c , function ( a ) { a . name . match ( / ^ _ / ) | | ( 3 = = = a . type ? e . push ( a . name ) : 2 = = = a . type & & d . push ( a . name ) ) } ) , a ( d , e ) } , error : function ( a ) { throw a . statusText } } ) } , j . getGraphs = function ( a ) { a & & a . length > = 1 & & s ( m . getAllGraphs , { } , a ) } , j . getAttributeExamples = function ( a ) { a & & a . length > = 1 & & t ( 10 , function ( b ) { var c = _ . sortBy ( _ . uniq ( _ . flatten ( _ . map ( b , function ( a ) { return _ . keys ( a ) } ) ) ) , function ( a ) { return a . toLowerCase ( ) } ) ; a ( c ) } ) } , j . getNodeCollection = function ( ) { return f } , j . getEdgeCollection = function ( ) { return g } , j . getDirection = function ( ) { return i } , j . getGraphName = function ( ) { return h } , j . setWidth = e . setWidth , j . changeTo = e . changeTo , j . getPrioList = e . getPrioList } function ColourMapper ( ) { " use strict " ; var a , b = { } , c = { } , d = [ ] , e = this , f = 0 ; d . push ( { back : " # C8E6C9 " , front : " black " } ) , d . push ( { back : " # 8aa249 " , front : " white " } ) , d . push ( { back : " # 8BC34A " , front : " black " } ) , d . push ( { back : " # 388E3C " , front : " white " } ) , d . push ( { back : " # 4CAF50 " , front : " white " } ) , d . push ( { back : " # 212121 " , front : " white " } ) , d . push ( { back : " # 727272 " , front : " white " } ) , d . push ( { back : " # B6B6B6 " , front : " black " } ) , d . push ( { back : " # e5f0a3 " , front : " black " } ) , d . push ( { back : " # 6c4313 " , front : " white " } ) , d . push ( { back : " # 9d8564 " , front : " white " } ) , this . getColour = function ( g ) { return void 0 = = = b [ g ] & & ( b [ g ] = d [ f ] , void 0 = = = c [ d [ f ] . back ] & & ( c [ d [ f ] . back ] = { front : d [ f ] . front , list : [ ] } ) , c [ d [ f ] . back ] . list . push ( g ) , f + + , f = = = d . length & & ( f = 0 ) ) , void 0 ! = = a & & a ( e . getList ( ) ) , b [ g ] . back } , this . getCommunityColour = function ( ) { return " # 333333 " } , this . getForegroundColour = function ( g ) { return void 0 = = = b [ g ] & & ( b [ g ] = d [ f ] , void 0 = = = c [ d [ f ] . back ] & & ( c [ d [ f ] . back ] = { front : d [ f ] . front , list : [ ] } ) , c [ d [ f ] . back ] . list . push ( g ) , f + + , f = = = d . length & & ( f = 0 ) ) , void 0 ! = = a & & a ( e . getList ( ) ) , b [ g ] . front } , this . getForegroundCommunityColour = function ( ) { return " white " } , this . reset = function ( ) { b = { } , c = { } , f = 0 , void 0 ! = = a & & a ( e . getList ( ) ) } , this . getList = function ( ) { return c } , this . setChangeListener = function ( b ) { a = b } , this . reset ( ) } function CommunityNode ( a , b ) { " use strict " ; if ( _ . isUndefined ( a ) | | ! _ . isFunction ( a . dissolveCommunity ) | | ! _ . isFunction ( a . checkNodeLimit ) ) throw " A parent element has to be given . " ; b = b | | [ ] ; var c , d , e , f , g , h = this , i = { } , j = [ ] , k = [ ] , l = { } , m = { } , n = { } , o = { } , p = function ( a ) { return h . _expanded ? 2 * a * Math . sqrt ( j . length ) : a } , q = function ( a ) { return h . _expanded ? 4 * a * Math . sqrt ( j . length ) : a } , r = function ( a ) { var b = h . position , c = a . x * b . z + b . x , d = a . y * b . z + b . y , e = a . z * b . z ; return { x : c , y : d , z : e } } , s = function ( a ) { return h . _expanded ? r ( a . _source . position ) : h . position } , t = function ( a ) { return h . _expanded ? r ( a . _target . position ) : h . position } , u = function ( ) { var a = document . getElementById ( h . _id ) . getBBox ( ) ; c . attr ( " transform " , " translate ( " + ( a . x - 5 ) + " , " + ( a . y - 25 ) + " ) " ) , d . attr ( " width " , a . width + 10 ) . attr ( " height " , a . height + 30 ) , e . attr ( " width " , a . width + 10 ) } , v = function ( ) { if ( ! f ) { var a = new DomObserverFactory ; f = a . createObserver ( function ( a ) { _ . any ( a , function ( a ) { return " transform " = = = a . attributeName } ) & & ( u ( ) , f . disconnect ( ) ) } ) } return f } , w = function ( ) { g . stop ( ) , j . length = 0 , _ . each ( i , function ( a ) { j . push ( a ) } ) , g . start ( ) } , x = function ( ) { g . stop ( ) , k . length = 0 , _ . each ( l , function ( a ) { k . push ( a ) } ) , g . start ( ) } , y = function ( a ) { var b = [ ] ; return _ . each ( a , function ( a ) { b . push ( a ) } ) , b } , z = function ( a ) { return ! ! i [ a ] } , A = function ( ) { return j } , B = function ( a ) { return i [ a ] } , C = function ( a ) { i [ a . _id ] = a , w ( ) , h . _size + + } , D = function ( a ) { _ . each ( a , function ( a ) { i [ a . _id ] = a , h . _size + + } ) , w ( ) } , E = function ( a ) { var b = a . _id | | a ; delete i [ b ] , w ( ) , h . _size - - } , F = function ( a ) { var b ; return _ . has ( a , " _id " ) ? b = a . _id : ( b = a , a = l [ b ] | | m [ b ] ) , a . target = a . _target , delete a . _target , l [ b ] ? ( delete l [ b ] , h . _outboundCounter + + , n [ b ] = a , void x ( ) ) : ( delete m [ b ] , void h . _inboundCounter - - ) } , G = function ( a ) { var b ; return _ . has ( a , " _id " ) ? b = a . _id : ( b = a , a = l [ b ] | | n [ b ] ) , a . source = a . _source , delete a . _source , delete o [ a . source . _id ] [ b ] , l [ b ] ? ( delete l [ b ] , h . _inboundCounter + + , m [ b ] = a , void x ( ) ) : ( delete n [ b ] , void h . _outboundCounter - - ) } , H = function ( a ) { var b = a . _id | | a , c = [ ] ; return _ . each ( o [ b ] , function ( a ) { G ( a ) , c . push ( a ) } ) , delete o [ b ] , c } , I = function ( a ) { return a . _target = a . target , a . target = h , n [ a . _id ] ? ( delete n [ a . _id ] , h . _outboundCounter - - , l [ a . _id ] = a , x ( ) , ! 0 ) : ( m [ a . _id ] = a , h . _inboundCounter + + , ! 1 ) } , J = function ( a ) { var b = a . source . _id ; return a . _source = a . source , a . source = h , o [ b ] = o [ b ] | | { } , o [ b ] [ a . _id ] = a , m [ a . _id ] ? ( delete m [ a . _id ] , h . _inboundCounter - - , l [ a . _id ] = a , x ( ) , ! 0 ) : ( h . _outboundCounter + + , n [ a . _id ] = a , ! 1 ) } , K = function ( ) { return { nodes : j , edges : { both : k , inbound : y ( m ) , outbound : y ( n ) } } } , L = function ( ) { this . _expanded = ! 0 } , M = function ( ) { a . dissolveCommunity ( h ) } , N = function ( ) { this . _expanded = ! 1 } , O = function ( a , b ) { var c = a . select ( " rect " ) . attr ( " width " ) , d = a . append ( " text " ) . attr ( " text - anchor " , " middle " ) . attr ( " fill " , b . getForegroundCommunityColour ( ) ) . attr ( " stroke " , " none " ) ; c * = 2 , c / = 3 , h . _reason & & h . _reason . key & & ( d . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " - 4 " ) . text ( h . _reason . key + " : " ) , d . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " 16 " ) . text ( h . _reason . value ) ) , d . append ( " tspan " ) . attr ( " x " , c ) . attr ( " y " , " 0 " ) . attr ( " fill " , b . getCommunityColour ( ) ) . text ( h . _size ) } , P = function ( b , c , d , e ) { var f = b . append ( " g " ) . attr ( " stroke " , e . getForegroundCommunityColour ( ) ) . attr ( " fill " , e . getCommunityColour ( ) ) ; c ( f , 9 ) , c ( f , 6 ) , c ( f , 3 ) , c ( f ) , f . on ( " click " , function ( ) { h . expand ( ) , a . checkNodeLimit ( h ) , d ( ) } ) , O ( f , e ) } , Q = function ( a , b ) { var c = a . selectAll ( " . node " ) . data ( j , function ( a ) { return a . _id } ) ; c . enter ( ) . append ( " g " ) . attr ( " class " , " node " ) . attr ( " id " , function ( a ) { return a . _id } ) , c . exit ( ) . remove ( ) , c . selectAll ( " * > * " ) . remove ( ) , b ( c ) } , R = function ( a , b ) { c = a . append ( " g " ) , d = c . append ( " rect " ) . attr ( " rx " , " 8 " ) . attr ( " ry " , " 8 " ) . attr ( " fill " , " none " ) . attr ( " stroke " , " black " ) , e = c . append ( " rect " ) . attr ( " rx " , " 8 " ) . attr ( " ry " , " 8 " ) . attr ( " height " , " 20 " ) . attr ( " fill " , " # 686766 " ) . attr ( " stroke " , " none " ) , c . append ( " image " ) . attr ( " id " , h . _id + " _dissolve " ) . attr ( " xlink : href " , " img / icon_delete . png " ) . attr ( " width " , " 16 " ) . attr ( " height " , " 16 " ) . attr ( " x " , " 5 " ) . attr ( " y " , " 2 " ) . attr ( " style " , " cursor : pointer " ) . on ( " click " , function ( ) { h . dissolve ( ) , b ( ) } ) , c . append ( " image " ) . attr ( " id " , h . _id + " _collapse " ) . attr ( " xlink : href " , " img / gv_collapse . png " ) . attr ( " width " , " 16 " ) . attr ( " height " , " 16 " ) . attr ( " x " , " 25 " ) . attr ( " y " , " 2 " ) . attr ( " style " , " cursor : pointer " ) . on ( " click " , function ( ) { h . collapse ( ) , b ( ) } ) ; var f = c . append ( " text " ) . attr ( " x " , " 45 " ) . attr ( " y " , " 15 " ) . attr ( " fill " , " white " ) . attr ( " stroke " , " none " ) . attr ( " text - anchor " , " left " ) ; h . _reason & & f . text ( h . _reason . text ) , v ( ) . observe ( document . getElementById ( h . _id ) , { subtree : ! 0 , attributes : ! 0 } ) } , S = function ( a ) { if ( h . _expanded ) { var b = a . focus ( ) , c = [ b [ 0 ] - h . position . x , b [ 1 ] - h . position . y ] ; a . focus ( c ) , _ . each ( j , function ( b ) { b . position = a ( b ) , b . position . x / = h . position . z , b . position . y / = h . position . z , b . position . z / = h . position . z } ) , a . focus ( b ) } } , T = function ( a , b , c , d , e ) { return a . on ( " click " , null ) , h . _expanded ? ( R ( a , d ) , void Q ( a , c , d , e ) ) : void P ( a , b , d , e ) } , U = function ( a , b , c ) { if ( h . _expanded ) { var d = a . selectAll ( " . link " ) , e = d . select ( " line " ) ; b ( e , d ) , c ( d ) } } , V = function ( a , b ) { var c , d , e = function ( a ) { return a . _id } ; h . _expanded & & ( d = a . selectAll ( " . link " ) . data ( k , e ) , d . enter ( ) . append ( " g " ) . attr ( " class " , " link " ) . attr ( " id " , e ) , d . exit ( ) . remove ( ) , d . selectAll ( " * > * " ) . remove ( ) , c = d . append ( " line " ) , b ( c , d ) ) } , W = function ( a ) { H ( a ) } ; g = new ForceLayouter ( { distance : 100 , gravity : . 1 , charge : - 500 , width : 1 , height : 1 , nodes : j , links : k } ) , this . _id = " * community_ " + Math . floor ( 1e6 * Math . random ( ) ) , b . length > 0 ? ( this . x = b [ 0 ] . x , this . y = b [ 0 ] . y ) : ( this . x = 0 , this . y = 0 ) , this . _size = 0 , this . _inboundCounter = 0 , this . _outboundCounter = 0 , this . _expanded = ! 1 , this . _isCommunity = ! 0 , D ( b ) , this . hasNode = z , this . getNodes = A , this . getNode = B , this . getDistance = p , this . getCharge = q , this . insertNode = C , this . insertInboundEdge = I , this . insertOutboundEdge = J , this . removeNode = E , this . removeInboundEdge = F , this . removeOutboundEdge = G , this . removeOutboundEdgesFromNode = H , this . collapseNode = W , this . dissolve = M , this . getDissolveInfo = K , this . collapse = N , this . expand = L , this . shapeNodes = T , this . shapeInnerEdges = V , this . updateInnerEdges = U , this . addDistortion = S , this . getSourcePosition = s , this . getTargetPosition = t } function DomObserverFactory ( ) { " use strict " ; var a = window . WebKitMutationObserver | | window . MutationObserver ; this . createObserver = function ( b ) { if ( ! a ) throw " Observer not supported " ; return new a ( b ) } } function EdgeShaper ( a , b , c ) { " use strict " ; var d , e , f , g = this , h = [ ] , i = { } , j = new ContextMenu ( " gv_edge_cm " ) , k = function ( a , b ) { return _ . isArray ( a ) ? b [ _ . find ( a , function ( a ) { return b [ a ] } ) ] : b [ a ] } , l = function ( a ) { if ( void 0 = = = a ) return [ " " ] ; " string " ! = typeof a & & ( a = String ( a ) ) ; var b = a . match ( / [ \ w \ W ] { 1 , 10 } ( \ s | $ ) | \ S + ? ( \ s | $ ) / g ) ; return b [ 0 ] = $ . trim ( b [ 0 ] ) , b [ 1 ] = $ . trim ( b [ 1 ] ) , b [ 0 ] . length > 12 & & ( b [ 0 ] = $ . trim ( a . substring ( 0 , 10 ) ) + " - " , b [ 1 ] = $ . trim ( a . substring ( 10 ) ) , b [ 1 ] . length > 12 & & ( b [ 1 ] = b [ 1 ] . split ( / \ W / ) [ 0 ] , b [ 1 ] . length > 12 & & ( b [ 1 ] = b [ 1 ] . substring ( 0 , 10 ) + " . . . " ) ) , b . length = 2 ) , b . length > 2 & & ( b . length = 2 , b [ 1 ] + = " . . . " ) , b } , m = ! 0 , n = { } , o = function ( a ) { return a . _id } , p = function ( a , b ) { } , q = new ColourMapper , r = function ( ) { q . reset ( ) } , s = p , t = p , u = p , v = p , w = function ( ) { f = { click : p , dblclick : p , mousedown : p , mouseup : p , mousemove : p , mouseout : p , mouseover : p } } , x = function ( a , b ) { return 180 * Math . atan2 ( b . y - a . y , b . x - a . x ) / Math . PI } , y = function ( a , b ) { var c , d = Math . sqrt ( ( b . y - a . y ) * ( b . y - a . y ) + ( b . x - a . x ) * ( b . x - a . x ) ) ; return a . x = = = b . x ? d - = 18 * b . z : ( c = Math . abs ( ( b . y - a . y ) / ( b . x - a . x ) ) , d - = . 4 > c ? Math . abs ( d * b . z * 45 / ( b . x - a . x ) ) : Math . abs ( d * b . z * 18 / ( b . y - a . y ) ) ) , d } , z = function ( a , b ) { _ . each ( f , function ( a , c ) { b . on ( c , a ) } ) } , A = function ( a , b ) { if ( " update " = = = a ) s = b ; else { if ( void 0 = = = f [ a ] ) throw " Sorry Unknown Event " + a + " cannot be bound . " ; f [ a ] = b } } , B = function ( a ) { var b , c , d , e ; return d = a . source , e = a . target , d . _isCommunity ? ( i [ d . _id ] = d , b = d . getSourcePosition ( a ) ) : b = d . position , e . _isCommunity ? ( i [ e . _id ] = e , c = e . getTargetPosition ( a ) ) : c = e . position , { s : b , t : c } } , C = function ( a , b ) { i = { } , b . attr ( " transform " , function ( a ) { var b = B ( a ) ; return " translate ( " + b . s . x + " , " + b . s . y + " ) rotate ( " + x ( b . s , b . t ) + " ) " } ) , a . attr ( " x2 " , function ( a ) { var b = B ( a ) ; return y ( b . s , b . t ) } ) } , D = function ( a , b ) { t ( a , b ) , m & & u ( a , b ) , v ( a , b ) , z ( a , b ) , C ( a , b ) } , E = function ( a ) { void 0 ! = = a & & ( h = a ) ; var b , c = g . parent . selectAll ( " . link " ) . data ( h , o ) ; c . enter ( ) . append ( " g " ) . attr ( " class " , " link " ) . attr ( " id " , o ) , c . exit ( ) . remove ( ) , c . selectAll ( " * > * " ) . remove ( ) , b = c . append ( " line " ) , D ( b , c ) , _ . each ( i , function ( a ) { a . shapeInnerEdges ( d3 . select ( this ) , D ) } ) , j . bindMenu ( $ ( " . link " ) ) } , F = function ( ) { var a = g . parent . selectAll ( " . link " ) , b = a . select ( " line " ) ; C ( b , a ) , s ( a ) , _ . each ( i , function ( a ) { a . updateInnerEdges ( d3 . select ( this ) , C , s ) } ) } , G = function ( a ) { switch ( $ ( " svg defs marker # arrow " ) . remove ( ) , a . type ) { case EdgeShaper . shapes . NONE : t = p ; break ; case EdgeShaper . shapes . ARROW : t = function ( a , b ) { a . attr ( " marker - end " , " url ( # arrow ) " ) } , 0 = = = d . selectAll ( " defs " ) [ 0 ] . length & & d . append ( " defs " ) , d . select ( " defs " ) . append ( " marker " ) . attr ( " id " , " arrow " ) . attr ( " refX " , " 10 " ) . attr ( " refY " , " 5 " ) . attr ( " markerUnits " , " strokeWidth " ) . attr ( " markerHeight " , " 10 " ) . attr ( " markerWidth " , " 10 " ) . attr ( " orient " , " auto " ) . append ( " path " ) . attr ( " d " , " M 0 0 L 10 5 L 0 10 z " ) ; break ; default : throw " Sorry given Shape not known ! " } } , H = function ( a ) { u = _ . isFunction ( a ) ? function ( b , c ) { c . append ( " text " ) . attr ( " text - anchor " , " middle " ) . text ( a ) } : function ( b , c ) { c . append ( " text " ) . attr ( " text - anchor " , " middle " ) . text ( function ( b ) { var c = l ( k ( a , b . _data ) ) ; return c [ 0 ] | | " " } ) } , s = function ( a ) { a . select ( " text " ) . attr ( " transform " , function ( a ) { var b = B ( a ) ; return " translate ( " + y ( b . s , b . t ) / 2 + " , - 3 ) " } ) } } , I = function ( a ) { void 0 ! = = a . reset & & a . reset & & w ( ) , _ . each ( a , function ( a , b ) { " reset " ! = = b & & A ( b , a ) } ) } , J = function ( a ) { switch ( $ ( " svg defs # gradientEdgeColor " ) . remove ( ) , r ( ) , a . type ) { case " single " : v = function ( b , c ) { b . attr ( " stroke " , a . stroke ) } ; break ; case " gradient " : 0 = = = d . selectAll ( " defs " ) [ 0 ] . length & & d . append ( " defs " ) ; var b = d . select ( " defs " ) . append ( " linearGradient " ) . attr ( " id " , " gradientEdgeColor " ) ; b . append ( " stop " ) . attr ( " offset " , " 0 " ) . attr ( " stop - color " , a . source ) , b . append ( " stop " ) . attr ( " offset " , " 0 . 4 " ) . attr ( " stop - color " , a . source ) , b . append ( " stop " ) . attr ( " offset " , " 0 . 6 " ) . attr ( " stop - color " , a . target ) , b . append ( " stop " ) . attr ( " offset " , " 1 " ) . attr ( " stop - color " , a . target ) , v = function ( a , b ) { a . attr ( " stroke " , " url ( # gradientEdgeColor ) " ) , a . attr ( " y2 " , " 0 . 0000000000000001 " ) } ; break ; case " attribute " : v = function ( b , c ) { c . attr ( " stroke " , function ( b ) { return q . getColour ( b . _data [ a . key ] ) } ) } ; break ; default : throw " Sorry given colour - scheme not known " } } , K = function ( a ) { void 0 ! = = a . shape & & G ( a . shape ) , void 0 ! = = a . label & & ( H ( a . label ) , g . label = a . label ) , void 0 ! = = a . actions & & I ( a . actions ) , void 0 ! = = a . color & & J ( a . color ) } ; for ( g . parent = a , w ( ) , d = a ; d [ 0 ] [ 0 ] & & d [ 0 ] [ 0 ] . ownerSVGElement ; ) d = d3 . select ( d [ 0 ] [ 0 ] . ownerSVGElement ) ; void 0 = = = b & & ( b = { color : { type : " single " , stroke : " # 686766 " } } ) , void 0 = = = b . color & & ( b . color = { type : " single " , stroke : " # 686766 " } ) , K ( b ) , _ . isFunction ( c ) & & ( o = c ) , e = d . append ( " g " ) , g . changeTo = function ( a ) { K ( a ) , E ( ) , F ( ) } , g . drawEdges = function ( a ) { E ( a ) , F ( ) } , g . updateEdges = function ( ) { F ( ) } , g . reshapeEdges = function ( ) { E ( ) } , g . activateLabel = function ( a ) { m = ! ! a , E ( ) } , g . addAnEdgeFollowingTheCursor = function ( a , b ) { return n = e . append ( " line " ) , n . attr ( " stroke " , " black " ) . attr ( " id " , " connectionLine " ) . attr ( " x1 " , a ) . attr ( " y1 " , b ) . attr ( " x2 " , a ) . attr ( " y2 " , b ) , function ( a , b ) { n . attr ( " x2 " , a ) . attr ( " y2 " , b ) } } , g . removeCursorFollowingEdge = function ( ) { n . remove & & ( n . remove ( ) , n = { } ) } , g . addMenuEntry = function ( a , b ) { j . addEntry ( a , b ) } , g . getLabel = function ( ) { return g . label | | " " } , g . resetColourMap = r } function EventDispatcher ( a , b , c ) { " use strict " ; var d , e , f , g , h = this , i = function ( b ) { if ( void 0 = = = b . shaper & & ( b . shaper = a ) , d . checkNodeEditorConfig ( b ) ) { var c = new d . InsertNode ( b ) , e = new d . PatchNode ( b ) , f = new d . DeleteNode ( b ) ; h . events . CREATENODE = function ( a , b , d , e ) { var f ; return f = _ . isFunction ( a ) ? a ( ) : a , function ( ) { c ( f , b , d , e ) } } , h . events . PATCHNODE = function ( a , b , c ) { if ( ! _ . isFunction ( b ) ) throw " Please give a function to extract the new node data " ; return function ( ) { e ( a , b ( ) , c ) } } , h . events . DELETENODE = function ( a ) { return function ( b ) { f ( b , a ) } } } } , j = function ( a ) { if ( void 0 = = = a . shaper & & ( a . shaper = b ) , d . checkEdgeEditorConfig ( a ) ) { var c = new d . InsertEdge ( a ) , e = new d . PatchEdge ( a ) , f = new d . DeleteEdge ( a ) , g = null , i = ! 1 ; h . events . STARTCREATEEDGE = function ( a ) { return function ( b ) { var c = d3 . event | | window . event ; g = b , i = ! 1 , void 0 ! = = a & & a ( b , c ) , c . stopPropagation ( ) } } , h . events . CANCELCREATEEDGE = function ( a ) { return function ( ) { g = null , void 0 = = = a | | i | | a ( ) } } , h . events . FINISHCREATEEDGE = function ( a ) { return function ( b ) { null ! = = g & & b ! = = g & & ( c ( g , b , a ) , i = ! 0 ) } } , h . events . PATCHEDGE = function ( a , b , c ) { if ( ! _ . isFunction ( b ) ) throw " Please give a function to extract the new node data " ; return function ( ) { e ( a , b ( ) , c ) } } , h . events . DELETEEDGE = function ( a ) { return function ( b ) { f ( b , a ) } } } } , k = function ( ) { g = g | | $ ( " svg " ) , g . unbind ( ) , _ . each ( e , function ( a , b ) { g . bind ( b , function ( c ) { _ . each ( a , function ( a ) { a ( c ) } ) , f [ b ] & & f [ b ] ( c ) } ) } ) } ; if ( void 0 = = = a ) throw " NodeShaper has to be given . " ; if ( void 0 = = = b ) throw " EdgeShaper has to be given . " ; d = new EventLibrary , e = { click : [ ] , dblclick : [ ] , mousedown : [ ] , mouseup : [ ] , mousemove : [ ] , mouseout : [ ] , mouseover : [ ] } , f = { } , h . events = { } , void 0 ! = = c & & ( void 0 ! = = c . expand & & d . checkExpandConfig ( c . expand ) & & ( h . events . EXPAND = new d . Expand ( c . expand ) , a . setGVStartFunction ( function ( ) { c . expand . reshapeNodes ( ) , c . expand . startCallback ( ) } ) ) , void 0 ! = = c . drag & & d . checkDragConfig ( c . drag ) & & ( h . events . DRAG = d . Drag ( c . drag ) ) , void 0 ! = = c . nodeEditor & & i ( c . nodeEditor ) , void 0 ! = = c . edgeEditor & & j ( c . edgeEditor ) ) , Object . freeze ( h . events ) , h . bind = function ( c , d , e ) { if ( void 0 = = = e | | ! _ . isFunction ( e ) ) throw " You have to give a function that should be bound as a third argument " ; var g = { } ; switch ( c ) { case " nodes " : g [ d ] = e , a . changeTo ( { actions : g } ) ; break ; case " edges " : g [ d ] = e , b . changeTo ( { actions : g } ) ; break ; case " svg " : f [ d ] = e , k ( ) ; break ; default : if ( void 0 = = = c . bind ) throw ' Sorry cannot bind to object . Please give either " nodes " , " edges " or a jQuery - selected DOM - Element ' ; c . unbind ( d ) , c . bind ( d , e ) } } , h . rebind = function ( c , d ) { switch ( d = d | | { } , d . reset = ! 0 , c ) { case " nodes " : a . changeTo ( { actions : d } ) ; break ; case " edges " : b . changeTo ( { actions : d } ) ; break ; case " svg " : f = { } , _ . each ( d , function ( a , b ) { " reset " ! = = b & & ( f [ b ] = a ) } ) , k ( ) ; break ; default : throw ' Sorry cannot rebind to object . Please give either " nodes " , " edges " or " svg " ' } } , h . fixSVG = function ( a , b ) { if ( void 0 = = = e [ a ] ) throw " Sorry unkown event " ; e [ a ] . push ( b ) , k ( ) } , Object . freeze ( h . events ) } function EventLibrary ( ) { " use strict " ; var a = this ; this . checkExpandConfig = function ( a ) { if ( void 0 = = = a . startCallback ) throw " A callback to the Start - method has to be defined " ; if ( void 0 = = = a . adapter | | void 0 = = = a . adapter . explore ) throw " An adapter to load data has to be defined " ; if ( void 0 = = = a . reshapeNodes ) throw " A callback to reshape nodes has to be defined " ; return ! 0 } , this . Expand = function ( b ) { a . checkExpandConfig ( b ) ; var c = b . startCallback , d = b . adapter . explore , e = b . reshapeNodes ; return function ( a ) { d ( a , c ) , e ( ) , c ( ) } } , this . checkDragConfig = function ( a ) { if ( void 0 = = = a . layouter ) throw " A layouter has to be defined " ; if ( void 0 = = = a . layouter . drag | | ! _ . isFunction ( a . layouter . drag ) ) throw " The layouter has to offer a drag function " ; return ! 0 } , this . Drag = function ( b ) { return a . checkDragConfig ( b ) , b . layouter . drag } , this . checkNodeEditorConfig = function ( a ) { if ( void 0 = = = a . adapter ) throw " An adapter has to be defined " ; if ( void 0 = = = a . shaper ) throw " A node shaper has to be defined " ; return ! 0 } , this . checkEdgeEditorConfig = function ( a ) { if ( void 0 = = = a . adapter ) throw " An adapter has to be defined " ; if ( void 0 = = = a . shaper ) throw " An edge Shaper has to be defined " ; return ! 0 } , this . InsertNode = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e , f ) { var g , h ; _ . isFunction ( a ) & & ! b ? ( g = a , h = { } ) : ( g = b , h = a ) , c . createNode ( h , function ( a ) { d . reshapeNodes ( ) , g ( a ) } , e , f ) } } , this . PatchNode = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e ) { c . patchNode ( a , b , function ( a ) { d . reshapeNodes ( ) , e ( a ) } ) } } , this . DeleteNode = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b ) { c . deleteNode ( a , function ( ) { d . reshapeNodes ( ) , b ( ) } ) } } , this . SelectNodeCollection = function ( b ) { a . checkNodeEditorConfig ( b ) ; var c = b . adapter ; if ( ! _ . isFunction ( c . useNodeCollection ) ) throw " The adapter has to support collection changes " ; return function ( a , b ) { c . useNodeCollection ( a ) , b ( ) } } , this . InsertEdge = function ( b ) { a . checkEdgeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e ) { c . createEdge ( { source : a , target : b } , function ( a ) { d . reshapeEdges ( ) , e ( a ) } ) } } , this . PatchEdge = function ( b ) { a . checkEdgeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b , e ) { c . patchEdge ( a , b , function ( a ) { d . reshapeEdges ( ) , e ( a ) } ) } } , this . DeleteEdge = function ( b ) { a . checkEdgeEditorConfig ( b ) ; var c = b . adapter , d = b . shaper ; return function ( a , b ) { c . deleteEdge ( a , function ( ) { d . reshapeEdges ( ) , b ( ) } ) } } } function ForceLayouter ( a ) { " use strict " ; var b = this , c = d3 . layout . force ( ) , d = a . charge | | - 600 , e = a . distance | | 80 , f = a . gravity | | . 01 , g = function ( a ) { <nl> + var b = 0 ; return b + = a . source . _isCommunity ? a . source . getDistance ( e ) : e , b + = a . target . _isCommunity ? a . target . getDistance ( e ) : e } , h = function ( a ) { return a . _isCommunity ? a . getCharge ( d ) : d } , i = a . onUpdate | | function ( ) { } , j = a . width | | 880 , k = a . height | | 680 , l = function ( a ) { a . distance & & ( e = a . distance ) , a . gravity & & c . gravity ( a . gravity ) , a . charge & & ( d = a . charge ) } ; if ( void 0 = = = a . nodes ) throw " No nodes defined " ; if ( void 0 = = = a . links ) throw " No links defined " ; c . nodes ( a . nodes ) , c . links ( a . links ) , c . size ( [ j , k ] ) , c . linkDistance ( g ) , c . gravity ( f ) , c . charge ( h ) , c . on ( " tick " , function ( ) { } ) , b . start = function ( ) { c . start ( ) } , b . stop = function ( ) { c . stop ( ) } , b . drag = c . drag , b . setCombinedUpdateFunction = function ( a , d , e ) { void 0 ! = = e ? ( i = function ( ) { c . alpha ( ) < . 1 & & ( a . updateNodes ( ) , d . updateEdges ( ) , e ( ) , c . alpha ( ) < . 05 & & b . stop ( ) ) } , c . on ( " tick " , i ) ) : ( i = function ( ) { c . alpha ( ) < . 1 & & ( a . updateNodes ( ) , d . updateEdges ( ) , c . alpha ( ) < . 05 & & b . stop ( ) ) } , c . on ( " tick " , i ) ) } , b . changeTo = function ( a ) { l ( a ) } , b . changeWidth = function ( a ) { j = a , c . size ( [ j , k ] ) } } function FoxxAdapter ( a , b , c , d , e ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " The route has to be given . " ; if ( void 0 = = = d ) throw " A reference to the graph viewer has to be given . " ; e = e | | { } ; var f , g = this , h = { } , i = { } , j = c , k = { cache : ! 1 , contentType : " application / json " , dataType : " json " , processData : ! 1 , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw console . log ( b ) , " Undefined ERROR " } } } , l = function ( ) { i . query = { get : function ( a , b ) { var c = $ . extend ( k , { type : " GET " , url : j + " / query / " + a , success : b } ) ; $ . ajax ( c ) } } , i . nodes = { post : function ( a , b ) { var c = $ . extend ( k , { type : " POST " , url : j + " / nodes " , data : JSON . stringify ( a ) , success : b } ) ; $ . ajax ( c ) } , put : function ( a , b , c ) { var d = $ . extend ( k , { type : " PUT " , url : j + " / nodes / " + a , data : JSON . stringify ( b ) , success : c } ) ; $ . ajax ( d ) } , del : function ( a , b ) { var c = $ . extend ( k , { type : " DELETE " , url : j + " / nodes / " + a , success : b } ) ; $ . ajax ( c ) } } , i . edges = { post : function ( a , b ) { var c = $ . extend ( k , { type : " POST " , url : j + " / edges " , data : JSON . stringify ( a ) , success : b } ) ; $ . ajax ( c ) } , put : function ( a , b , c ) { var d = $ . extend ( k , { type : " PUT " , url : j + " / edges / " + a , data : JSON . stringify ( b ) , success : c } ) ; $ . ajax ( d ) } , del : function ( a , b ) { var c = $ . extend ( k , { type : " DELETE " , url : j + " / edges / " + a , success : b } ) ; $ . ajax ( c ) } } , i . forNode = { del : function ( a , b ) { var c = $ . extend ( k , { type : " DELETE " , url : j + " / edges / forNode / " + a , success : b } ) ; $ . ajax ( c ) } } } , m = function ( a , b , c ) { i [ a ] . get ( b , c ) } , n = function ( a , b , c ) { i [ a ] . post ( b , c ) } , o = function ( a , b , c ) { i [ a ] . del ( b , c ) } , p = function ( a , b , c , d ) { i [ a ] . put ( b , c , d ) } , q = function ( a ) { void 0 ! = = a . width & & f . setWidth ( a . width ) , void 0 ! = = a . height & & f . setHeight ( a . height ) } , r = function ( b , c ) { var d = { } , e = b . first , g = a . length ; e = f . insertNode ( e ) , _ . each ( b . nodes , function ( b ) { b = f . insertNode ( b ) , g < a . length & & ( d [ b . _id ] = b , g = a . length ) } ) , _ . each ( b . edges , function ( a ) { f . insertEdge ( a ) } ) , delete d [ e . _id ] , f . checkSizeOfInserted ( d ) , f . checkNodeLimit ( e ) , void 0 ! = = c & & _ . isFunction ( c ) & & c ( e ) } ; e . prioList & & ( h . prioList = e . prioList ) , f = new AbstractAdapter ( a , b , this , d , h ) , q ( e ) , l ( ) , g . explore = f . explore , g . loadNode = function ( a , b ) { m ( " query " , a , function ( a ) { r ( a , b ) } ) } , g . loadInitialNode = function ( a , b ) { f . cleanUp ( ) ; var c = function ( a ) { b ( f . insertInitialNode ( a ) ) } ; g . loadNode ( a , c ) } , g . requestCentralityChildren = function ( a , b ) { } , g . createEdge = function ( a , b ) { var c = _ . clone ( a ) ; c . _from = a . source . _id , c . _to = a . target . _id , delete c . source , delete c . target , n ( " edges " , c , function ( c ) { c . _from = a . source . _id , c . _to = a . target . _id , delete c . error ; var d = f . insertEdge ( c ) ; void 0 ! = = b & & _ . isFunction ( b ) & & b ( d ) } ) } , g . deleteEdge = function ( a , b ) { o ( " edges " , a . _id , function ( ) { f . removeEdge ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } ) } , g . patchEdge = function ( a , b , c ) { p ( " edges " , a . _id , b , function ( d ) { a . _data = $ . extend ( a . _data , b ) , void 0 ! = = c & & _ . isFunction ( c ) & & c ( ) } ) } , g . createNode = function ( a , b ) { n ( " nodes " , a , function ( a ) { f . insertNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( a ) } ) } , g . deleteNode = function ( a , b ) { o ( " nodes " , a . _id , function ( ) { f . removeEdgesForNode ( a ) , o ( " forNode " , a . _id , function ( ) { } ) , f . removeNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } ) } , g . patchNode = function ( a , b , c ) { p ( " nodes " , a . _id , b , function ( d ) { a . _data = $ . extend ( a . _data , b ) , void 0 ! = = c & & _ . isFunction ( c ) & & c ( a ) } ) } , g . setNodeLimit = function ( a , b ) { f . setNodeLimit ( a , b ) } , g . setChildLimit = function ( a ) { f . setChildLimit ( a ) } , g . expandCommunity = function ( a , b ) { f . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } , g . setWidth = f . setWidth , g . changeTo = f . changeTo , g . getPrioList = f . getPrioList } function GharialAdapter ( a , b , c , d ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " A reference to the graph viewer has to be given . " ; if ( void 0 = = = d ) throw " A configuration with graphName has to be given . " ; if ( void 0 = = = d . graphName ) throw " The graphname has to be given . " ; var e , f , g , h , i , j , k , l = this , m = { } , n = { } , o = { } , p = function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : n . graph + " / " + a + " / edge " , contentType : " application / json " , success : function ( a ) { h = a . collections , i = h [ 0 ] } } ) , $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : n . graph + " / " + a + " / vertex " , contentType : " application / json " , success : function ( a ) { f = a . collections , g = f [ 0 ] } } ) } , q = function ( a ) { j = a , p ( a ) , n . edges = n . graph + " / " + j + " / edge / " , n . vertices = n . graph + " / " + j + " / vertex / " , n . any = n . base + " simple / any " } , r = function ( a ) { var b = a . baseUrl | | " " ; void 0 ! = = a . width & & e . setWidth ( a . width ) , void 0 ! = = a . height & & e . setHeight ( a . height ) , k = void 0 ! = = a . undirected ? a . undirected = = = ! 0 ? " any " : " outbound " : " any " , n . base = b + " _api / " , n . cursor = n . base + " cursor " , n . graph = n . base + " gharial " , a . graphName & & q ( a . graphName ) } , s = function ( a , b , c ) { a ! = = o . getAllGraphs & & ( b . graph = j , a ! = = o . connectedEdges & & a ! = = o . childrenCentrality & & a ! = = o . randomVertices & & ( b . dir = k ) ) ; var d = { query : a , bindVars : b } ; $ . ajax ( { type : " POST " , url : n . cursor , data : JSON . stringify ( d ) , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( a ) { c ( a . result ) } , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw " Undefined ERROR " } } } ) } , t = function ( a , b ) { var c , d = { query : o . randomVertices , bindVars : { " @ collection " : b , limit : a } } ; return $ . ajax ( { type : " POST " , url : n . cursor , data : JSON . stringify ( d ) , contentType : " application / json " , dataType : " json " , processData : ! 1 , async : ! 1 , success : function ( a ) { c = a . result } , error : function ( a ) { try { throw console . log ( a . statusText ) , " [ " + a . errorNum + " ] " + a . errorMessage } catch ( b ) { throw " Undefined ERROR " } } } ) , c } , u = function ( b , c ) { if ( 0 = = = b . length | | 0 = = = b [ 0 ] . length | | 0 = = = b [ 0 ] [ 0 ] . length ) return void ( c & & c ( { errorCode : 404 } ) ) ; b = b [ 0 ] [ 0 ] ; var d = { } , f = e . insertNode ( b [ 0 ] . vertex ) , g = a . length ; _ . each ( b , function ( b ) { var c = e . insertNode ( b . vertex ) , f = b . path ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) , _ . each ( f . vertices , function ( b ) { var c = e . insertNode ( b ) ; g < a . length & & ( d [ c . _id ] = c , g = a . length ) } ) , _ . each ( f . edges , function ( a ) { e . insertEdge ( a ) } ) } ) , delete d [ f . _id ] , e . checkSizeOfInserted ( d ) , e . checkNodeLimit ( f ) , c & & c ( f ) } , v = function ( a ) { return function ( b ) { return b & & b . errorCode ? void a ( b ) : void a ( e . insertInitialNode ( b ) ) } } ; d . prioList & & ( m . prioList = d . prioList ) , e = new AbstractAdapter ( a , b , this , c , m ) , r ( d ) , o . getAllGraphs = " FOR g IN _graphs return g . _key " , o . traversal = ' RETURN GRAPH_TRAVERSAL ( @ graph , @ example , @ dir , { strategy : " depthfirst " , maxDepth : 1 , paths : true } ) ' , o . childrenCentrality = " RETURN LENGTH ( GRAPH_EDGES ( @ graph , @ id , { direction : any } ) ) " , o . connectedEdges = " RETURN GRAPH_EDGES ( @ graph , @ id ) " , o . randomVertices = " FOR x IN @ @ collection SORT RAND ( ) LIMIT @ limit RETURN x " , l . explore = e . explore , l . loadNode = function ( a , b ) { l . loadNodeFromTreeById ( a , b ) } , l . NODES_TO_DISPLAY = 19 , l . TOTAL_NODES = 0 , l . definedNodes = [ ] , l . randomNodes = [ ] , l . loadRandomNode = function ( a , b ) { var c , d = _ . shuffle ( l . getNodeCollections ( ) ) ; for ( c = 0 ; c < d . length ; + + c ) { void 0 ! = = b & & ( " all " = = = b ? l . NODES_TO_DISPLAY = l . TOTAL_NODES : l . NODES_TO_DISPLAY = parseInt ( b , 10 ) - 1 , l . NODES_TO_DISPLAY > = l . TOTAL_NODES ? $ ( " . infoField " ) . hide ( ) : $ ( " . infoField " ) . show ( ) ) ; var e = t ( l . NODES_TO_DISPLAY , d [ c ] ) ; if ( e . length > 0 ) { return _ . each ( e , function ( a ) { l . randomNodes . push ( a ) } ) , void l . loadInitialNode ( e [ 0 ] . _id , a ) } } a ( { errorCode : 404 } ) } , l . loadInitialNode = function ( a , b ) { e . cleanUp ( ) , l . loadNode ( a , v ( b ) ) } , l . getRandomNodes = function ( ) { var a = [ ] , b = [ ] ; l . definedNodes . length > 0 & & _ . each ( l . definedNodes , function ( a ) { b . push ( a ) } ) , l . randomNodes . length > 0 & & _ . each ( l . randomNodes , function ( a ) { b . push ( a ) } ) ; var c = 0 ; return _ . each ( b , function ( b ) { c < l . NODES_TO_DISPLAY & & ( a . push ( { vertex : b , path : { edges : [ ] , vertices : [ b ] } } ) , c + + ) } ) , a } , l . loadNodeFromTreeById = function ( a , b ) { s ( o . traversal , { example : a } , function ( c ) { var d = [ ] ; d = l . getRandomNodes ( ) , d . length > 0 ? _ . each ( d , function ( a ) { s ( o . traversal , { example : a . vertex . _id } , function ( a ) { _ . each ( a [ 0 ] [ 0 ] , function ( a ) { c [ 0 ] [ 0 ] . push ( a ) } ) , u ( c , b ) } ) } ) : s ( o . traversal , { example : a } , function ( a ) { u ( a , b ) } ) } ) } , l . loadNodeFromTreeByAttributeValue = function ( a , b , c ) { var d = { } ; d [ a ] = b , s ( o . traversal , { example : d } , function ( a ) { u ( a , c ) } ) } , l . getNodeExampleFromTreeByAttributeValue = function ( a , b , c ) { var d = { } ; d [ a ] = b , s ( o . traversal , { example : d } , function ( d ) { if ( void 0 = = = d [ 0 ] [ 0 ] ) throw arangoHelper . arangoError ( " Graph error " , " no nodes found " ) , " No suitable nodes have been found . " ; _ . each ( d [ 0 ] [ 0 ] , function ( d ) { if ( d . vertex [ a ] = = = b ) { var f = { } ; f . _key = d . vertex . _key , f . _id = d . vertex . _id , f . _rev = d . vertex . _rev , e . insertNode ( f ) , c ( f ) } } ) } ) } , l . loadAdditionalNodeByAttributeValue = function ( a , b , c ) { l . getNodeExampleFromTreeByAttributeValue ( a , b , c ) } , l . loadInitialNodeByAttributeValue = function ( a , b , c ) { e . cleanUp ( ) , l . loadNodeFromTreeByAttributeValue ( a , b , v ( c ) ) } , l . requestCentralityChildren = function ( a , b ) { s ( o . childrenCentrality , { id : a } , function ( a ) { b ( a [ 0 ] ) } ) } , l . createEdge = function ( a , b ) { var c = { } ; c . _from = a . source . _id , c . _to = a . target . _id , $ . ajax ( { cache : ! 1 , type : " POST " , url : n . edges + i , data : JSON . stringify ( c ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( a ) { if ( a . error = = = ! 1 ) { var d , f = a . edge ; f . _from = c . _from , f . _to = c . _to , d = e . insertEdge ( f ) , b ( d ) } } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . deleteEdge = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : n . edges + a . _id , contentType : " application / json " , dataType : " json " , processData : ! 1 , success : function ( ) { e . removeEdge ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . patchEdge = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : n . edges + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { a . _data = $ . extend ( a . _data , b ) , c ( ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . createNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : n . vertices + g , data : JSON . stringify ( a ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { c . error = = = ! 1 & & ( a . _key = c . vertex . _key , a . _id = c . vertex . _id , a . _rev = c . vertex . _rev , e . insertNode ( a ) , b ( a ) ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . deleteNode = function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : n . vertices + a . _id , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { e . removeEdgesForNode ( a ) , e . removeNode ( a ) , void 0 ! = = b & & _ . isFunction ( b ) & & b ( ) } , error : function ( a ) { var b = " " ; try { b = JSON . parse ( a . responseText ) . errorMessage + " ( " + JSON . parse ( a . responseText ) . errorNum + " ) " , arangoHelper . arangoError ( a . statusText , b ) } catch ( c ) { throw a . statusText } } } ) } , l . patchNode = function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : n . vertices + a . _id , data : JSON . stringify ( b ) , dataType : " json " , contentType : " application / json " , processData : ! 1 , success : function ( ) { a . _data = $ . extend ( a . _data , b ) , c ( a ) } , error : function ( a ) { throw a . statusText } } ) } , l . changeToGraph = function ( a , b ) { e . cleanUp ( ) , q ( a ) , void 0 ! = = b & & ( k = b = = = ! 0 ? " any " : " outbound " ) } , l . setNodeLimit = function ( a , b ) { e . setNodeLimit ( a , b ) } , l . setChildLimit = function ( a ) { e . setChildLimit ( a ) } , l . expandCommunity = function ( a , b ) { e . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } , l . getGraphs = function ( a ) { a & & a . length > = 1 & & s ( o . getAllGraphs , { } , a ) } , l . getAttributeExamples = function ( a ) { if ( a & & a . length > = 1 ) { var b , c = [ ] , d = _ . shuffle ( l . getNodeCollections ( ) ) ; for ( b = 0 ; b < d . length ; + + b ) { var e = t ( 10 , d [ b ] ) ; $ . ajax ( { cache : ! 1 , type : " GET " , async : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + encodeURIComponent ( d [ b ] ) + " / count " ) , contentType : " application / json " , success : function ( a ) { l . TOTAL_NODES = l . TOTAL_NODES + a . count } } ) , e . length > 0 & & ( c = c . concat ( _ . flatten ( _ . map ( e , function ( a ) { return _ . keys ( a ) } ) ) ) ) } var c = _ . sortBy ( _ . uniq ( c ) , function ( a ) { return a . toLowerCase ( ) } ) ; a ( c ) } } , l . getEdgeCollections = function ( ) { return h } , l . getSelectedEdgeCollection = function ( ) { return i } , l . useEdgeCollection = function ( a ) { if ( ! _ . contains ( h , a ) ) throw " Collection " + a + " is not available in the graph . " ; i = a } , l . getNodeCollections = function ( ) { return f } , l . getSelectedNodeCollection = function ( ) { return g } , l . useNodeCollection = function ( a ) { if ( ! _ . contains ( f , a ) ) throw " Collection " + a + " is not available in the graph . " ; g = a } , l . getDirection = function ( ) { return k } , l . getGraphName = function ( ) { return j } , l . setWidth = e . setWidth , l . changeTo = e . changeTo , l . getPrioList = e . getPrioList } function ModularityJoiner ( ) { " use strict " ; var a = { } , b = Array . prototype . forEach , c = Object . keys , d = Array . isArray , e = Object . prototype . toString , f = Array . prototype . indexOf , g = Array . prototype . map , h = Array . prototype . some , i = { isArray : d | | function ( a ) { return " [ object Array ] " = = = e . call ( a ) } , isFunction : function ( a ) { return " function " = = typeof a } , isString : function ( a ) { return " [ object String ] " = = = e . call ( a ) } , each : function ( c , d , e ) { if ( null ! = = c & & void 0 ! = = c ) { var f , g , h ; if ( b & & c . forEach = = = b ) c . forEach ( d , e ) ; else if ( c . length = = = + c . length ) { for ( f = 0 , g = c . length ; g > f ; f + + ) if ( d . call ( e , c [ f ] , f , c ) = = = a ) return } else for ( h in c ) if ( c . hasOwnProperty ( h ) & & d . call ( e , c [ h ] , h , c ) = = = a ) return } } , keys : c | | function ( a ) { if ( " object " ! = typeof a | | Array . isArray ( a ) ) throw new TypeError ( " Invalid object " ) ; var b , c = [ ] ; for ( b in a ) a . hasOwnProperty ( b ) & & ( c [ c . length ] = b ) ; return c } , min : function ( a , b , c ) { if ( ! b & & i . isArray ( a ) & & a [ 0 ] = = = + a [ 0 ] & & a . length < 65535 ) return Math . min . apply ( Math , a ) ; if ( ! b & & i . isEmpty ( a ) ) return 1 / 0 ; var d = { computed : 1 / 0 , value : 1 / 0 } ; return i . each ( a , function ( a , e , f ) { var g = b ? b . call ( c , a , e , f ) : a ; g < d . computed & & ( d = { value : a , computed : g } ) } ) , d . value } , map : function ( a , b , c ) { var d = [ ] ; return null = = = a ? d : g & & a . map = = = g ? a . map ( b , c ) : ( i . each ( a , function ( a , e , f ) { d [ d . length ] = b . call ( c , a , e , f ) } ) , d ) } , pluck : function ( a , b ) { return i . map ( a , function ( a ) { return a [ b ] } ) } , uniq : function ( a , b , c , d ) { i . isFunction ( b ) & & ( d = c , c = b , b = ! 1 ) ; var e = c ? i . map ( a , c , d ) : a , f = [ ] , g = [ ] ; return i . each ( e , function ( c , d ) { b ? d & & g [ g . length - 1 ] = = = c | | ( g . push ( c ) , f . push ( a [ d ] ) ) : i . contains ( g , c ) | | ( g . push ( c ) , f . push ( a [ d ] ) ) } ) , f } , union : function ( ) { return i . uniq ( Array . prototype . concat . apply ( Array . prototype , arguments ) ) } , isEmpty : function ( a ) { var b ; if ( null = = = a ) return ! 0 ; if ( i . isArray ( a ) | | i . isString ( a ) ) return 0 = = = a . length ; for ( b in a ) if ( a . hasOwnProperty ( b ) ) return ! 1 ; return ! 0 } , any : function ( b , c , d ) { c = c | | i . identity ; var e = ! 1 ; return null = = = b ? e : h & & b . some = = = h ? b . some ( c , d ) : ( i . each ( b , function ( b , f , g ) { return e ? a : ( e = c . call ( d , b , f , g ) , a ) } ) , ! ! e ) } , contains : function ( a , b ) { return null = = = a ? ! 1 : f & & a . indexOf = = = f ? - 1 ! = = a . indexOf ( b ) : i . any ( a , function ( a ) { return a = = = b } ) } , values : function ( a ) { var b , c = [ ] ; for ( b in a ) a . hasOwnProperty ( b ) & & c . push ( a [ b ] ) ; return c } } , j = { } , k = { } , l = { } , m = 0 , n = 0 , o = null , p = null , q = null , r = { } , s = function ( a ) { var b , c = Number . NEGATIVE_INFINITY ; return i . each ( p [ a ] , function ( a , d ) { a > c & & ( c = a , b = d ) } ) , 0 > c ? void delete q [ a ] : void ( q [ a ] = b ) } , t = function ( a , b ) { s ( b ) } , u = function ( a , b ) { return b > a ? p [ a ] & & p [ a ] [ b ] : p [ b ] & & p [ b ] [ a ] } , v = function ( a , b ) { return b > a ? p [ a ] [ b ] : p [ b ] [ a ] } , w = function ( a , b , c ) { return b > a ? ( p [ a ] = p [ a ] | | { } , void ( p [ a ] [ b ] = c ) ) : ( p [ b ] = p [ b ] | | { } , void ( p [ b ] [ a ] = c ) ) } , x = function ( a , b ) { if ( b > a ) { if ( ! p [ a ] ) return ; return delete p [ a ] [ b ] , void ( i . isEmpty ( p [ a ] ) & & delete p [ a ] ) } a ! = = b & & x ( b , a ) } , y = function ( a , b ) { var c , d ; return b > a ? u ( a , b ) ? ( d = v ( a , b ) , q [ a ] = = = b ? void s ( a ) : u ( a , q [ a ] ) ? ( c = v ( a , q [ a ] ) , void ( d > c & & ( q [ a ] = b ) ) ) : void s ( a ) ) : void s ( a ) : void ( a ! = = b & & y ( b , a ) ) } , z = function ( a , b ) { o [ a ] . _in + = o [ b ] . _in , o [ a ] . _out + = o [ b ] . _out , delete o [ b ] } , A = function ( a , b ) { j [ a ] = j [ a ] | | { } , j [ a ] [ b ] = ( j [ a ] [ b ] | | 0 ) + 1 , k [ b ] = k [ b ] | | { } , k [ b ] [ a ] = ( k [ b ] [ a ] | | 0 ) + 1 , l [ a ] = l [ a ] | | { _in : 0 , _out : 0 } , l [ b ] = l [ b ] | | { _in : 0 , _out : 0 } , l [ a ] . _out + + , l [ b ] . _in + + , m + + , n = Math . pow ( m , - 1 ) } , B = function ( a , b ) { j [ a ] & & ( j [ a ] [ b ] - - , 0 = = = j [ a ] [ b ] & & delete j [ a ] [ b ] , k [ b ] [ a ] - - , 0 = = = k [ b ] [ a ] & & delete k [ b ] [ a ] , l [ a ] . _out - - , l [ b ] . _in - - , m - - , n = m > 0 ? Math . pow ( m , - 1 ) : 0 , i . isEmpty ( j [ a ] ) & & delete j [ a ] , i . isEmpty ( k [ b ] ) & & delete k [ b ] , 0 = = = l [ a ] . _in & & 0 = = = l [ a ] . _out & & delete l [ a ] , 0 = = = l [ b ] . _in & & 0 = = = l [ b ] . _out & & delete l [ b ] ) } , C = function ( ) { return o = { } , i . each ( l , function ( a , b ) { o [ b ] = { _in : a . _in / m , _out : a . _out / m } } ) , o } , D = function ( a , b ) { return o [ a ] . _out * o [ b ] . _in + o [ a ] . _in * o [ b ] . _out } , E = function ( a ) { var b = i . keys ( j [ a ] | | { } ) , c = i . keys ( k [ a ] | | { } ) ; return i . union ( b , c ) } , F = function ( ) { p = { } , i . each ( j , function ( a , b ) { var c = k [ b ] | | { } , d = E ( b ) ; i . each ( d , function ( d ) { var e , f = a [ d ] | | 0 ; f + = c [ d ] | | 0 , e = f * n - D ( b , d ) , e > 0 & & w ( b , d , e ) } ) } ) } , G = function ( ) { return q = { } , i . each ( p , t ) , q } , H = function ( a , b , c ) { var d ; return u ( c , a ) ? ( d = v ( c , a ) , u ( c , b ) ? ( d + = v ( c , b ) , w ( c , a , d ) , x ( c , b ) , y ( c , a ) , void y ( c , b ) ) : ( d - = D ( c , b ) , 0 > d & & x ( c , a ) , void y ( c , a ) ) ) : void ( u ( c , b ) & & ( d = v ( c , b ) , d - = D ( c , a ) , d > 0 & & w ( c , a , d ) , y ( c , a ) , x ( c , b ) , y ( c , b ) ) ) } , I = function ( a , b ) { i . each ( p , function ( c , d ) { return d = = = a | | d = = = b ? void i . each ( c , function ( c , d ) { return d = = = b ? ( x ( a , b ) , void y ( a , b ) ) : void H ( a , b , d ) } ) : void H ( a , b , d ) } ) } , J = function ( ) { return j } , K = function ( ) { return q } , L = function ( ) { return p } , M = function ( ) { return o } , N = function ( ) { return r } , O = function ( ) { var a , b , c = Number . NEGATIVE_INFINITY ; return i . each ( q , function ( d , e ) { c < p [ e ] [ d ] & & ( a = d , b = e , c = p [ e ] [ d ] ) } ) , 0 > = c ? null : { sID : b , lID : a , val : c } } , P = function ( a ) { var b , c = Number . NEGATIVE_INFINITY ; return i . each ( a , function ( a ) { a . q > c & & ( c = a . q , b = a . nodes ) } ) , b } , Q = function ( ) { C ( ) , F ( ) , G ( ) , r = { } } , R = function ( a ) { var b = a . sID , c = a . lID , d = a . val ; r [ b ] = r [ b ] | | { nodes : [ b ] , q : 0 } , r [ c ] ? ( r [ b ] . nodes = r [ b ] . nodes . concat ( r [ c ] . nodes ) , r [ b ] . q + = r [ c ] . q , delete r [ c ] ) : r [ b ] . nodes . push ( c ) , r [ b ] . q + = d , I ( b , c ) , z ( b , c ) } , S = function ( a , b , c ) { if ( 0 = = = c . length ) return ! 0 ; var d = [ ] ; return i . each ( c , function ( c ) { a [ c ] = = = Number . POSITIVE_INFINITY & & ( a [ c ] = b , d = d . concat ( E ( c ) ) ) } ) , S ( a , b + 1 , d ) } , T = function ( a ) { var b = { } ; if ( i . each ( j , function ( a , c ) { b [ c ] = Number . POSITIVE_INFINITY } ) , b [ a ] = 0 , S ( b , 1 , E ( a ) ) ) return b ; throw " FAIL ! " } , U = function ( a ) { return function ( b ) { return a [ b ] } } , V = function ( a , b ) { var c , d = { } , e = [ ] , f = { } , g = function ( a , b ) { var c = f [ i . min ( a , U ( f ) ) ] , e = f [ i . min ( b , U ( f ) ) ] , g = e - c ; return 0 = = = g & & ( g = d [ b [ b . length - 1 ] ] . q - d [ a [ a . length - 1 ] ] . q ) , g } ; for ( Q ( ) , c = O ( ) ; null ! = = c ; ) R ( c ) , c = O ( ) ; return d = N ( ) , void 0 ! = = b ? ( i . each ( d , function ( a , c ) { i . contains ( a . nodes , b ) & & delete d [ c ] } ) , e = i . pluck ( i . values ( d ) , " nodes " ) , f = T ( b ) , e . sort ( g ) , e [ 0 ] ) : P ( d ) } ; this . insertEdge = A , this . deleteEdge = B , this . getAdjacencyMatrix = J , this . getHeap = K , this . getDQ = L , this . getDegrees = M , this . getCommunities = N , this . getBest = O , this . setup = Q , this . joinCommunity = R , this . getCommunity = V } function NodeReducer ( a ) { " use strict " ; a = a | | [ ] ; var b = function ( a , b ) { a . push ( b ) } , c = function ( a , b ) { if ( ! a . reason . example ) return a . reason . example = b , 1 ; var c = b . _data | | { } , d = a . reason . example . _data | | { } , e = _ . union ( _ . keys ( d ) , _ . keys ( c ) ) , f = 0 , g = 0 ; return _ . each ( e , function ( a ) { void 0 ! = = d [ a ] & & void 0 ! = = c [ a ] & & ( f + + , d [ a ] = = = c [ a ] & & ( f + = 4 ) ) } ) , g = 5 * e . length , g + + , f + + , f / g } , d = function ( ) { return a } , e = function ( b ) { a = b } , f = function ( b , c ) { var d = { } , e = [ ] ; return _ . each ( b , function ( b ) { var c , e , f = b . _data , g = 0 ; for ( g = 0 ; g < a . length ; g + + ) if ( c = a [ g ] , void 0 ! = = f [ c ] ) return e = f [ c ] , d [ c ] = d [ c ] | | { } , d [ c ] [ e ] = d [ c ] [ e ] | | [ ] , void d [ c ] [ e ] . push ( b ) ; e = " default " , d [ e ] = d [ e ] | | [ ] , d [ e ] . push ( b ) } ) , _ . each ( d , function ( a , b ) { _ . each ( a , function ( a , c ) { var d = { key : b , value : c , text : b + " : " + c } ; e . push ( { reason : d , nodes : a } ) } ) } ) , e } , g = function ( d , e ) { var g = [ ] , h = . 5 ; return d . length < = e ? g = _ . map ( d , function ( a ) { return { reason : { type : " single " , text : " One Node " } , nodes : [ a ] } } ) : _ . isEmpty ( a ) ? ( _ . each ( d , function ( a ) { var d , f , i ; for ( f = 0 , i = Number . POSITIVE_INFINITY , d = 0 ; e > d ; d + + ) { if ( g [ d ] = g [ d ] | | { reason : { type : " similar " , text : " Similar Nodes " } , nodes : [ ] } , c ( g [ d ] , a ) > h ) return void b ( g [ d ] . nodes , a ) ; i > g [ d ] . nodes . length & & ( f = d , i = g [ d ] . nodes . length ) } b ( g [ f ] . nodes , a ) } ) , g ) : f ( d , e ) } ; this . bucketNodes = g , this . changePrioList = e , this . getPrioList = d } function NodeShaper ( a , b , c ) { " use strict " ; var d , e , f = this , g = [ ] , h = ! 0 , i = new ContextMenu ( " gv_node_cm " ) , j = function ( a , b ) { return _ . isArray ( a ) ? b [ _ . find ( a , function ( a ) { return b [ a ] } ) ] : b [ a ] } , k = function ( a ) { if ( void 0 = = = a ) return [ " " ] ; " string " ! = typeof a & & ( a = String ( a ) ) ; var b = a . match ( / [ \ w \ W ] { 1 , 10 } ( \ s | $ ) | \ S + ? ( \ s | $ ) / g ) ; return b [ 0 ] = $ . trim ( b [ 0 ] ) , b [ 1 ] = $ . trim ( b [ 1 ] ) , b [ 0 ] . length > 12 & & ( b [ 0 ] = $ . trim ( a . substring ( 0 , 10 ) ) , b [ 1 ] = $ . trim ( a . substring ( 10 ) ) , b [ 1 ] . length > 12 & & ( b [ 1 ] = b [ 1 ] . split ( / \ W / ) [ 0 ] , b [ 1 ] . length > 2 & & ( b [ 1 ] = b [ 1 ] . substring ( 0 , 5 ) + " . . . " ) ) , b . length = 2 ) , b . length > 2 & & ( b . length = 2 , b [ 1 ] + = " . . . " ) , b } , l = function ( a ) { } , m = l , n = function ( a ) { return { x : a . x , y : a . y , z : 1 } } , o = n , p = function ( ) { _ . each ( g , function ( a ) { a . position = o ( a ) , a . _isCommunity & & a . addDistortion ( o ) } ) } , q = new ColourMapper , r = function ( ) { q . reset ( ) } , s = function ( a ) { return a . _id } , t = l , u = l , v = l , w = function ( ) { return " black " } , x = function ( ) { f . parent . selectAll ( " . node " ) . on ( " mousedown . drag " , null ) , d = { click : l , dblclick : l , drag : l , mousedown : l , mouseup : l , mousemove : l , mouseout : l , mouseover : l } , e = l } , y = function ( a ) { _ . each ( d , function ( b , c ) { " drag " = = = c ? a . call ( b ) : a . on ( c , b ) } ) } , z = function ( a ) { var b = a . filter ( function ( a ) { return a . _isCommunity } ) , c = a . filter ( function ( a ) { return ! a . _isCommunity } ) ; u ( c ) , b . each ( function ( a ) { a . shapeNodes ( d3 . select ( this ) , u , z , m , q ) } ) , h & & v ( c ) , t ( c ) , y ( c ) , p ( ) } , A = function ( a , b ) { if ( " update " = = = a ) e = b ; else { if ( void 0 = = = d [ a ] ) throw " Sorry Unknown Event " + a + " cannot be bound . " ; d [ a ] = b } } , B = function ( ) { var a = f . parent . selectAll ( " . node " ) ; p ( ) , a . attr ( " transform " , function ( a ) { return " translate ( " + a . position . x + " , " + a . position . y + " ) scale ( " + a . position . z + " ) " } ) , e ( a ) } , C = function ( a ) { void 0 ! = = a & & ( g = a ) ; var b = f . parent . selectAll ( " . node " ) . data ( g , s ) ; b . enter ( ) . append ( " g " ) . attr ( " class " , function ( a ) { return a . _isCommunity ? " node communitynode " : " node " } ) . attr ( " id " , s ) , b . exit ( ) . remove ( ) , b . selectAll ( " * > * " ) . remove ( ) , z ( b ) , B ( ) , i . bindMenu ( $ ( " . node " ) ) } , D = function ( a ) { var b , c , d , e , f , g , h ; switch ( a . type ) { case NodeShaper . shapes . NONE : u = l ; break ; case NodeShaper . shapes . CIRCLE : b = a . radius | | 25 , u = function ( a , c ) { a . append ( " circle " ) . attr ( " r " , b ) , c & & a . attr ( " cx " , - c ) . attr ( " cy " , - c ) } ; break ; case NodeShaper . shapes . RECT : c = a . width | | 90 , d = a . height | | 36 , e = _ . isFunction ( c ) ? function ( a ) { return - ( c ( a ) / 2 ) } : function ( a ) { return - ( c / 2 ) } , f = _ . isFunction ( d ) ? function ( a ) { return - ( d ( a ) / 2 ) } : function ( ) { return - ( d / 2 ) } , u = function ( a , b ) { b = b | | 0 , a . append ( " rect " ) . attr ( " width " , c ) . attr ( " height " , d ) . attr ( " x " , function ( a ) { return e ( a ) - b } ) . attr ( " y " , function ( a ) { return f ( a ) - b } ) . attr ( " rx " , " 8 " ) . attr ( " ry " , " 8 " ) } ; break ; case NodeShaper . shapes . IMAGE : c = a . width | | 32 , d = a . height | | 32 , g = a . fallback | | " " , h = a . source | | g , e = _ . isFunction ( c ) ? function ( a ) { return - ( c ( a ) / 2 ) } : - ( c / 2 ) , f = _ . isFunction ( d ) ? function ( a ) { return - ( d ( a ) / 2 ) } : - ( d / 2 ) , u = function ( a ) { var b = a . append ( " image " ) . attr ( " width " , c ) . attr ( " height " , d ) . attr ( " x " , e ) . attr ( " y " , f ) ; _ . isFunction ( h ) ? b . attr ( " xlink : href " , h ) : b . attr ( " xlink : href " , function ( a ) { return a . _data [ h ] ? a . _data [ h ] : g } ) } ; break ; case void 0 : break ; default : throw " Sorry given Shape not known ! " } } , E = function ( a ) { var b = [ ] ; _ . each ( a , function ( a ) { b = $ ( a ) . find ( " text " ) , $ ( a ) . css ( " width " , " 90px " ) , $ ( a ) . css ( " height " , " 36px " ) , $ ( a ) . textfill ( { innerTag : " text " , maxFontPixels : 16 , minFontPixels : 10 , explicitWidth : 90 , explicitHeight : 36 } ) } ) } , F = function ( a ) { v = _ . isFunction ( a ) ? function ( b ) { var c = b . append ( " text " ) . attr ( " text - anchor " , " middle " ) . attr ( " fill " , w ) . attr ( " stroke " , " none " ) ; c . each ( function ( b ) { var c = k ( a ( b ) ) , d = c [ 0 ] ; 2 = = = c . length & & ( d + = c [ 1 ] ) , d . length > 15 & & ( d = d . substring ( 0 , 13 ) + " . . . " ) , void 0 ! = = d & & " " ! = = d | | ( d = " ATTR NOT SET " ) , d3 . select ( this ) . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " 5 " ) . text ( d ) } ) , E ( b ) } : function ( b ) { var c = b . append ( " text " ) . attr ( " text - anchor " , " middle " ) . attr ( " fill " , w ) . attr ( " stroke " , " none " ) ; c . each ( function ( b ) { var c = k ( j ( a , b . _data ) ) , d = c [ 0 ] ; 2 = = = c . length & & ( d + = c [ 1 ] ) , d . length > 15 & & ( d = d . substring ( 0 , 13 ) + " . . . " ) , void 0 ! = = d & & " " ! = = d | | ( d = " ATTR NOT SET " ) , d3 . select ( this ) . append ( " tspan " ) . attr ( " x " , " 0 " ) . attr ( " dy " , " 5 " ) . text ( d ) } ) , E ( b ) } } , G = function ( a ) { void 0 ! = = a . reset & & a . reset & & x ( ) , _ . each ( a , function ( a , b ) { " reset " ! = = b & & A ( b , a ) } ) } , H = function ( a ) { switch ( r ( ) , a . type ) { case " single " : t = function ( b ) { b . attr ( " fill " , a . fill ) } , w = function ( b ) { return a . stroke } ; break ; case " expand " : t = function ( b ) { b . attr ( " fill " , function ( b ) { return b . _expanded ? a . expanded : a . collapsed } ) } , w = function ( a ) { return " white " } ; break ; case " attribute " : t = function ( b ) { b . attr ( " fill " , function ( b ) { return void 0 = = = b . _data ? q . getCommunityColour ( ) : q . getColour ( j ( a . key , b . _data ) ) } ) . attr ( " stroke " , function ( a ) { return a . _expanded ? " # fff " : " transparent " } ) . attr ( " fill - opacity " , function ( a ) { return a . _expanded ? " 1 " : " 0 . 3 " } ) } , w = function ( b ) { return void 0 = = = b . _data ? q . getForegroundCommunityColour ( ) : q . getForegroundColour ( j ( a . key , b . _data ) ) } ; break ; default : throw " Sorry given colour - scheme not known " } } , I = function ( a ) { if ( " reset " = = = a ) o = n ; else { if ( ! _ . isFunction ( a ) ) throw " Sorry distortion cannot be parsed . " ; o = a } } , J = function ( a ) { void 0 ! = = a . shape & & D ( a . shape ) , void 0 ! = = a . label & & ( F ( a . label ) , f . label = a . label ) , void 0 ! = = a . actions & & G ( a . actions ) , void 0 ! = = a . color & & ( H ( a . color ) , f . color = a . color ) , void 0 ! = = a . distortion & & I ( a . distortion ) } ; f . parent = a , x ( ) , void 0 = = = b & & ( b = { } ) , void 0 = = = b . shape & & ( b . shape = { type : NodeShaper . shapes . RECT } ) , void 0 = = = b . color & & ( b . color = { type : " single " , fill : " # 333333 " , stroke : " white " } ) , void 0 = = = b . distortion & & ( b . distortion = " reset " ) , J ( b ) , _ . isFunction ( c ) & & ( s = c ) , f . changeTo = function ( a ) { J ( a ) , C ( ) } , f . drawNodes = function ( a ) { C ( a ) } , f . updateNodes = function ( ) { B ( ) } , f . reshapeNodes = function ( ) { C ( ) } , f . activateLabel = function ( a ) { h = ! ! a , C ( ) } , f . getColourMapping = function ( ) { return q . getList ( ) } , f . setColourMappingListener = function ( a ) { q . setChangeListener ( a ) } , f . setGVStartFunction = function ( a ) { m = a } , f . getLabel = function ( ) { return f . label | | " " } , f . getColor = function ( ) { return f . color . key | | " " } , f . addMenuEntry = function ( a , b ) { i . addEntry ( a , b ) } , f . resetColourMap = r } function PreviewAdapter ( a , b , c , d ) { " use strict " ; if ( void 0 = = = a ) throw " The nodes have to be given . " ; if ( void 0 = = = b ) throw " The edges have to be given . " ; if ( void 0 = = = c ) throw " A reference to the graph viewer has to be given . " ; var e = this , f = new AbstractAdapter ( a , b , this , c ) , g = function ( a ) { void 0 ! = = a . width & & f . setWidth ( a . width ) , void 0 ! = = a . height & & f . setHeight ( a . height ) } , h = function ( a , b ) { var c = { } , d = a . first ; d = f . insertNode ( d ) , _ . each ( a . nodes , function ( a ) { a = f . insertNode ( a ) , c [ a . _id ] = a } ) , _ . each ( a . edges , function ( a ) { f . insertEdge ( a ) } ) , delete c [ d . _id ] , void 0 ! = = b & & _ . isFunction ( b ) & & b ( d ) } ; d = d | | { } , g ( d ) , e . loadInitialNode = function ( a , b ) { f . cleanUp ( ) ; var c = function ( a ) { b ( f . insertInitialNode ( a ) ) } ; e . loadNode ( a , c ) } , e . loadNode = function ( a , b ) { var c = [ ] , d = [ ] , e = { } , f = { _id : 1 , label : " Node 1 " , image : " img / stored . png " } , g = { _id : 2 , label : " Node 2 " } , i = { _id : 3 , label : " Node 3 " } , j = { _id : 4 , label : " Node 4 " } , k = { _id : 5 , label : " Node 5 " } , l = { _id : " 1 - 2 " , _from : 1 , _to : 2 , label : " Edge 1 " } , m = { _id : " 1 - 3 " , _from : 1 , _to : 3 , label : " Edge 2 " } , n = { _id : " 1 - 4 " , _from : 1 , _to : 4 , label : " Edge 3 " } , o = { _id : " 1 - 5 " , _from : 1 , _to : 5 , label : " Edge 4 " } , p = { _id : " 2 - 3 " , _from : 2 , _to : 3 , label : " Edge 5 " } ; c . push ( f ) , c . push ( g ) , c . push ( i ) , c . push ( j ) , c . push ( k ) , d . push ( l ) , d . push ( m ) , d . push ( n ) , d . push ( o ) , d . push ( p ) , e . first = f , e . nodes = c , e . edges = d , h ( e , b ) } , e . explore = f . explore , e . requestCentralityChildren = function ( a , b ) { } , e . createEdge = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " createEdge was triggered . " ) } , e . deleteEdge = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " deleteEdge was triggered . " ) } , e . patchEdge = function ( a , b , c ) { arangoHelper . arangoError ( " Server - side " , " patchEdge was triggered . " ) } , e . createNode = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " createNode was triggered . " ) } , e . deleteNode = function ( a , b ) { arangoHelper . arangoError ( " Server - side " , " deleteNode was triggered . " ) , arangoHelper . arangoError ( " Server - side " , " onNodeDelete was triggered . " ) } , e . patchNode = function ( a , b , c ) { arangoHelper . arangoError ( " Server - side " , " patchNode was triggered . " ) } , e . setNodeLimit = function ( a , b ) { f . setNodeLimit ( a , b ) } , e . setChildLimit = function ( a ) { f . setChildLimit ( a ) } , e . setWidth = f . setWidth , e . expandCommunity = function ( a , b ) { f . expandCommunity ( a ) , void 0 ! = = b & & b ( ) } } function WebWorkerWrapper ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A class has to be given . " ; if ( void 0 = = = b ) throw " A callback has to be given . " ; var c , d = Array . prototype . slice . call ( arguments ) , e = { } , f = function ( ) { var c , d = function ( a ) { switch ( a . data . cmd ) { case " construct " : try { w = new ( Function . prototype . bind . apply ( Construct , [ null ] . concat ( a . data . args ) ) ) , w ? self . postMessage ( { cmd : " construct " , result : ! 0 } ) : self . postMessage ( { cmd : " construct " , result : ! 1 } ) } catch ( b ) { self . postMessage ( { cmd : " construct " , result : ! 1 , error : b . message | | b } ) } break ; default : var c , d = { cmd : a . data . cmd } ; if ( w & & " function " = = typeof w [ a . data . cmd ] ) try { c = w [ a . data . cmd ] . apply ( w , a . data . args ) , c & & ( d . result = c ) , self . postMessage ( d ) } catch ( e ) { d . error = e . message | | e , self . postMessage ( d ) } else d . error = " Method not known " , self . postMessage ( d ) } } , e = function ( a ) { var b = " var w , Construct = " + a . toString ( ) + " ; self . onmessage = " + d . toString ( ) ; return new window . Blob ( b . split ( ) ) } , f = window . URL , g = new e ( a ) ; return c = new window . Worker ( f . createObjectURL ( g ) ) , c . onmessage = b , c } , g = function ( ) { return a . apply ( this , d ) } ; try { return c = f ( ) , e . call = function ( a ) { var b = Array . prototype . slice . call ( arguments ) ; b . shift ( ) , c . postMessage ( { cmd : a , args : b } ) } , d . shift ( ) , d . shift ( ) , d . unshift ( " construct " ) , e . call . apply ( this , d ) , e } catch ( h ) { d . shift ( ) , d . shift ( ) , g . prototype = a . prototype ; try { c = new g } catch ( i ) { return void b ( { data : { cmd : " construct " , error : i } } ) } return e . call = function ( a ) { var d = Array . prototype . slice . call ( arguments ) , e = { data : { cmd : a } } ; if ( ! _ . isFunction ( c [ a ] ) ) return e . data . error = " Method not known " , void b ( e ) ; d . shift ( ) ; try { e . data . result = c [ a ] . apply ( c , d ) , b ( e ) } catch ( f ) { e . data . error = f , b ( e ) } } , b ( { data : { cmd : " construct " , result : ! 0 } } ) , e } } function ZoomManager ( a , b , c , d , e , f , g , h ) { " use strict " ; if ( void 0 = = = a | | 0 > a ) throw " A width has to be given . " ; if ( void 0 = = = b | | 0 > b ) throw " A height has to be given . " ; if ( void 0 = = = c | | void 0 = = = c . node | | " svg " ! = = c . node ( ) . tagName . toLowerCase ( ) ) throw " A svg has to be given . " ; if ( void 0 = = = d | | void 0 = = = d . node | | " g " ! = = d . node ( ) . tagName . toLowerCase ( ) ) throw " A group has to be given . " ; if ( void 0 = = = e | | void 0 = = = e . activateLabel | | void 0 = = = e . changeTo | | void 0 = = = e . updateNodes ) throw " The Node shaper has to be given . " ; if ( void 0 = = = f | | void 0 = = = f . activateLabel | | void 0 = = = f . updateEdges ) throw " The Edge shaper has to be given . " ; var i , j , k , l , m , n , o , p , q , r , s , t , u , v , w , x = this , y = a * b , z = h | | function ( ) { } , A = function ( ) { var a , b ; return l > = k ? ( b = i * l , b * = b , a = 60 * b ) : ( b = j * l , b * = b , a = 4 * Math . PI * b ) , Math . floor ( y / a ) } , B = function ( ) { q = s / l - . 99999999 , r = t / l , p . distortion ( q ) , p . radius ( r ) } , C = function ( a , b , c , g ) { g ? null ! = = a & & ( l = a ) : l = a , null ! = = b & & ( m [ 0 ] + = b ) , null ! = = c & & ( m [ 1 ] + = c ) , o = A ( ) , z ( o ) , e . activateLabel ( l > = k ) , f . activateLabel ( l > = k ) , B ( ) ; var h = " translate ( " + m + " ) " , i = " scale ( " + l + " ) " ; d . _isCommunity ? d . attr ( " transform " , h ) : d . attr ( " transform " , h + i ) , v & & v . slider ( " option " , " value " , l ) } , D = function ( a ) { var b = [ ] ; return b [ 0 ] = a [ 0 ] - n [ 0 ] , b [ 1 ] = a [ 1 ] - n [ 1 ] , n [ 0 ] = a [ 0 ] , n [ 1 ] = a [ 1 ] , b } , E = function ( a ) { void 0 = = = a & & ( a = { } ) ; var b = a . maxFont | | 16 , c = a . minFont | | 6 , d = a . maxRadius | | 25 , e = a . minRadius | | 4 ; s = a . focusZoom | | 1 , t = a . focusRadius | | 100 , w = e / d , i = b , j = d , k = c / b , l = 1 , m = [ 0 , 0 ] , n = [ 0 , 0 ] , B ( ) , o = A ( ) , u = d3 . behavior . zoom ( ) . scaleExtent ( [ w , 1 ] ) . on ( " zoom " , function ( ) { var a , b = d3 . event . sourceEvent , c = l ; " mousewheel " = = = b . type | | " DOMMouseScroll " = = = b . type ? ( b . wheelDelta ? b . wheelDelta > 0 ? ( c + = . 01 , c > 1 & & ( c = 1 ) ) : ( c - = . 01 , w > c & & ( c = w ) ) : b . detail > 0 ? ( c + = . 01 , c > 1 & & ( c = 1 ) ) : ( c - = . 01 , w > c & & ( c = w ) ) , a = [ 0 , 0 ] ) : a = D ( d3 . event . translate ) , C ( c , a [ 0 ] , a [ 1 ] ) } ) } , F = function ( ) { } ; p = d3 . fisheye . circular ( ) , E ( g ) , c . call ( u ) , e . changeTo ( { distortion : p } ) , c . on ( " mousemove " , F ) , x . translation = function ( ) { return null } , x . scaleFactor = function ( ) { return l } , x . scaledMouse = function ( ) { return null } , x . getDistortion = function ( ) { return q } , x . getDistortionRadius = function ( ) { return r } , x . getNodeLimit = function ( ) { return o } , x . getMinimalZoomFactor = function ( ) { return w } , x . registerSlider = function ( a ) { v = a } , x . triggerScale = function ( a ) { C ( a , null , null , ! 0 ) } , x . triggerTranslation = function ( a , b ) { C ( null , a , b , ! 0 ) } , x . changeWidth = function ( c ) { y = a * b } } function ArangoAdapterControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The ArangoAdapter has to be given . " ; this . addControlChangeCollections = function ( c ) { var d = " control_adapter_collections " , e = d + " _ " ; b . getCollections ( function ( f , g ) { b . getGraphs ( function ( h ) { uiComponentsHelper . createButton ( a , " Collections " , d , function ( ) { modalDialogHelper . createModalDialog ( " Switch Collections " , e , [ { type : " decission " , id : " collections " , group : " loadtype " , text : " Select existing collections " , isDefault : void 0 = = = b . getGraphName ( ) , interior : [ { type : " list " , id : " node_collection " , text : " Vertex collection " , objects : f , selected : b . getNodeCollection ( ) } , { type : " list " , id : " edge_collection " , text : " Edge collection " , objects : g , selected : b . getEdgeCollection ( ) } ] } , { type : " decission " , id : " graphs " , <nl> + group : " loadtype " , text : " Select existing graph " , isDefault : void 0 ! = = b . getGraphName ( ) , interior : [ { type : " list " , id : " graph " , objects : h , selected : b . getGraphName ( ) } ] } , { type : " checkbox " , text : " Start with random vertex " , id : " random " , selected : ! 0 } , { type : " checkbox " , id : " undirected " , selected : " any " = = = b . getDirection ( ) } ] , function ( ) { var a = $ ( " # " + e + " node_collection " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , d = $ ( " # " + e + " edge_collection " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , f = $ ( " # " + e + " graph " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , g = ! ! $ ( " # " + e + " undirected " ) . prop ( " checked " ) , h = ! ! $ ( " # " + e + " random " ) . prop ( " checked " ) , i = $ ( " input [ type = ' radio ' ] [ name = ' loadtype ' ] : checked " ) . prop ( " id " ) ; return i = = = e + " collections " ? b . changeToCollections ( a , d , g ) : b . changeToGraph ( f , g ) , h ? void b . loadRandomNode ( c ) : void ( _ . isFunction ( c ) & & c ( ) ) } ) } ) } ) } ) } , this . addControlChangePriority = function ( ) { var c = " control_adapter_priority " , d = c + " _ " , e = ( b . getPrioList ( ) , " Group vertices " ) ; uiComponentsHelper . createButton ( a , e , c , function ( ) { modalDialogHelper . createModalChangeDialog ( e , d , [ { type : " extendable " , id : " attribute " , objects : b . getPrioList ( ) } ] , function ( ) { var a = $ ( " input [ id ^ = " + d + " attribute_ ] " ) , c = [ ] ; a . each ( function ( a , b ) { var d = $ ( b ) . val ( ) ; " " ! = = d & & c . push ( d ) } ) , b . changeTo ( { prioList : c } ) } ) } ) } , this . addAll = function ( ) { this . addControlChangeCollections ( ) , this . addControlChangePriority ( ) } } function ContextMenu ( a ) { " use strict " ; if ( void 0 = = = a ) throw " An id has to be given . " ; var b , c , d = " # " + a , e = function ( a , d ) { var e , f ; e = document . createElement ( " div " ) , e . className = " context - menu - item " , f = document . createElement ( " div " ) , f . className = " context - menu - item - inner " , f . appendChild ( document . createTextNode ( a ) ) , f . onclick = function ( ) { d ( d3 . select ( c . target ) . data ( ) [ 0 ] ) } , e . appendChild ( f ) , b . appendChild ( e ) } , f = function ( a ) { c = $ . contextMenu . create ( d , { shadow : ! 1 } ) , a . each ( function ( ) { $ ( this ) . bind ( " contextmenu " , function ( a ) { return c . show ( this , a ) , ! 1 } ) } ) } , g = function ( ) { return b = document . getElementById ( a ) , b & & b . parentElement . removeChild ( b ) , b = document . createElement ( " div " ) , b . className = " context - menu context - menu - theme - osx " , b . id = a , document . body . appendChild ( b ) , b } ; g ( ) , this . addEntry = e , this . bindMenu = f } function EdgeShaperControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The EdgeShaper has to be given . " ; var c = this ; this . addControlOpticShapeNone = function ( ) { var c = " control_edge_none " ; uiComponentsHelper . createButton ( a , " None " , c , function ( ) { b . changeTo ( { shape : { type : EdgeShaper . shapes . NONE } } ) } ) } , this . addControlOpticShapeArrow = function ( ) { var c = " control_edge_arrow " ; uiComponentsHelper . createButton ( a , " Arrow " , c , function ( ) { b . changeTo ( { shape : { type : EdgeShaper . shapes . ARROW } } ) } ) } , this . addControlOpticLabel = function ( ) { var c = " control_edge_label " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Label Attribute " , d , [ { type : " text " , id : " key " , text : " Edge label attribute " , value : b . getLabel ( ) } ] , function ( ) { var a = $ ( " # " + d + " key " ) . attr ( " value " ) ; b . changeTo ( { label : a } ) } ) } ) } , this . addControlOpticLabelList = function ( ) { var d = " control_edge_label " , e = d + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , d , function ( ) { modalDialogHelper . createModalDialog ( " Change Label Attribute " , e , [ { type : " extendable " , id : " label " , text : " Edge label attribute " , objects : b . getLabel ( ) } ] , function ( ) { var a = $ ( " input [ id ^ = " + e + " label_ ] " ) , d = [ ] ; a . each ( function ( a , b ) { var c = $ ( b ) . val ( ) ; " " ! = = c & & d . push ( c ) } ) ; var f = { label : d } ; c . applyLocalStorage ( f ) , b . changeTo ( f ) } ) } ) } , this . applyLocalStorage = function ( a ) { if ( " undefined " ! = = Storage ) try { var b = JSON . parse ( localStorage . getItem ( " graphSettings " ) ) , c = window . location . hash . split ( " / " ) [ 1 ] , d = window . location . pathname . split ( " / " ) [ 2 ] , e = c + d ; _ . each ( a , function ( a , c ) { void 0 ! = = c & & ( b [ e ] . viewer . hasOwnProperty ( " edgeShaper " ) | | ( b [ e ] . viewer . edgeShaper = { } ) , b [ e ] . viewer . edgeShaper [ c ] = a ) } ) , localStorage . setItem ( " graphSettings " , JSON . stringify ( b ) ) } catch ( f ) { console . log ( f ) } } , this . addControlOpticSingleColour = function ( ) { var c = " control_edge_singlecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Single Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Colour " , d , [ { type : " text " , id : " stroke " } ] , function ( ) { var a = $ ( " # " + d + " stroke " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " single " , stroke : a } } ) } ) } ) } , this . addControlOpticAttributeColour = function ( ) { var c = " control_edge_attributecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Colour by Attribute " , c , function ( ) { modalDialogHelper . createModalDialog ( " Display colour by attribute " , d , [ { type : " text " , id : " key " } ] , function ( ) { var a = $ ( " # " + d + " key " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " attribute " , key : a } } ) } ) } ) } , this . addControlOpticGradientColour = function ( ) { var c = " control_edge_gradientcolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Gradient Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Change colours for gradient " , d , [ { type : " text " , id : " source " } , { type : " text " , id : " target " } ] , function ( ) { var a = $ ( " # " + d + " source " ) . attr ( " value " ) , c = $ ( " # " + d + " target " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " gradient " , source : a , target : c } } ) } ) } ) } , this . addAllOptics = function ( ) { c . addControlOpticShapeNone ( ) , c . addControlOpticShapeArrow ( ) , c . addControlOpticLabel ( ) , c . addControlOpticSingleColour ( ) , c . addControlOpticAttributeColour ( ) , c . addControlOpticGradientColour ( ) } , this . addAllActions = function ( ) { } , this . addAll = function ( ) { c . addAllOptics ( ) , c . addAllActions ( ) } } function EventDispatcherControls ( a , b , c , d , e ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The NodeShaper has to be given . " ; if ( void 0 = = = c ) throw " The EdgeShaper has to be given . " ; if ( void 0 = = = d ) throw " The Start callback has to be given . " ; var f = this , g = { expand : { icon : " hand - pointer - o " , title : " Expand a node . " } , add : { icon : " plus - square " , title : " Add a node . " } , trash : { icon : " minus - square " , title : " Remove a node / edge . " } , drag : { icon : " hand - rock - o " , title : " Drag a node . " } , edge : { icon : " external - link - square " , title : " Create an edge between two nodes . " } , edit : { icon : " pencil - square " , title : " Edit attributes of a node . " } , view : { icon : " search " , title : " View attributes of a node . " } } , h = new EventDispatcher ( b , c , e ) , i = e . edgeEditor . adapter , j = ! ! i & & _ . isFunction ( i . useNodeCollection ) & & _ . isFunction ( i . useEdgeCollection ) , k = function ( b ) { a . appendChild ( b ) } , l = function ( a , b , c ) { var d = uiComponentsHelper . createIconButton ( a , " control_event_ " + b , c ) ; k ( d ) } , m = function ( a ) { h . rebind ( " nodes " , a ) } , n = function ( a ) { h . rebind ( " edges " , a ) } , o = function ( a ) { h . rebind ( " svg " , a ) } , p = function ( a ) { var b = a | | window . event , c = { } ; return c . x = b . clientX , c . y = b . clientY , c . x + = document . body . scrollLeft , c . y + = document . body . scrollTop , c } , q = function ( a ) { var b , c , d , e = p ( a ) , f = $ ( " svg # graphViewerSVG " ) . offset ( ) ; return b = d3 . select ( " svg # graphViewerSVG " ) . node ( ) , d = b . getBoundingClientRect ( ) , $ ( " svg # graphViewerSVG " ) . height ( ) < = d . height ? { x : e . x - f . left , y : e . y - f . top } : ( c = b . getBBox ( ) , { x : e . x - ( d . left - c . x ) , y : e . y - ( d . top - c . y ) } ) } , r = { nodes : { } , edges : { } , svg : { } } , s = function ( ) { var a = " control_event_new_node " , c = a + " _ " , e = function ( a ) { var e = q ( a ) ; modalDialogHelper . createModalCreateDialog ( " Create New Node " , c , { } , function ( a ) { h . events . CREATENODE ( a , function ( a ) { $ ( " # " + c + " modal " ) . modal ( " hide " ) , b . reshapeNodes ( ) , d ( ) } , e . x , e . y ) ( ) } ) } ; r . nodes . newNode = e } , t = function ( ) { var a = function ( a ) { modalDialogHelper . createModalViewDialog ( " View Node " + a . _id , " control_event_node_view_ " , a . _data , function ( ) { modalDialogHelper . createModalEditDialog ( " Edit Node " + a . _id , " control_event_node_edit_ " , a . _data , function ( b ) { h . events . PATCHNODE ( a , b , function ( ) { $ ( " # control_event_node_edit_modal " ) . modal ( " hide " ) } ) ( ) } ) } ) } , b = function ( a ) { modalDialogHelper . createModalViewDialog ( " View Edge " + a . _id , " control_event_edge_view_ " , a . _data , function ( ) { modalDialogHelper . createModalEditDialog ( " Edit Edge " + a . _id , " control_event_edge_edit_ " , a . _data , function ( b ) { h . events . PATCHEDGE ( a , b , function ( ) { $ ( " # control_event_edge_edit_modal " ) . modal ( " hide " ) } ) ( ) } ) } ) } ; r . nodes . view = a , r . edges . view = b } , u = function ( ) { var a = h . events . STARTCREATEEDGE ( function ( a , b ) { var d = q ( b ) , e = c . addAnEdgeFollowingTheCursor ( d . x , d . y ) ; h . bind ( " svg " , " mousemove " , function ( a ) { var b = q ( a ) ; e ( b . x , b . y ) } ) } ) , b = h . events . FINISHCREATEEDGE ( function ( a ) { c . removeCursorFollowingEdge ( ) , h . bind ( " svg " , " mousemove " , function ( ) { } ) , d ( ) } ) , e = function ( ) { h . events . CANCELCREATEEDGE ( ) , c . removeCursorFollowingEdge ( ) , h . bind ( " svg " , " mousemove " , function ( ) { } ) } ; r . nodes . startEdge = a , r . nodes . endEdge = b , r . svg . cancelEdge = e } , v = function ( ) { var a = function ( a ) { arangoHelper . openDocEditor ( a . _id , " document " ) } , b = function ( a ) { arangoHelper . openDocEditor ( a . _id , " edge " ) } ; r . nodes . edit = a , r . edges . edit = b } , w = function ( ) { var a = function ( a ) { modalDialogHelper . createModalDeleteDialog ( " Delete Node " + a . _id , " control_event_node_delete_ " , a , function ( a ) { h . events . DELETENODE ( function ( ) { $ ( " # control_event_node_delete_modal " ) . modal ( " hide " ) , b . reshapeNodes ( ) , c . reshapeEdges ( ) , d ( ) } ) ( a ) } ) } , e = function ( a ) { modalDialogHelper . createModalDeleteDialog ( " Delete Edge " + a . _id , " control_event_edge_delete_ " , a , function ( a ) { h . events . DELETEEDGE ( function ( ) { $ ( " # control_event_edge_delete_modal " ) . modal ( " hide " ) , b . reshapeNodes ( ) , c . reshapeEdges ( ) , d ( ) } ) ( a ) } ) } ; r . nodes . del = a , r . edges . del = e } , x = function ( ) { r . nodes . spot = h . events . EXPAND } ; s ( ) , t ( ) , u ( ) , v ( ) , w ( ) , x ( ) , this . dragRebinds = function ( ) { return { nodes : { drag : h . events . DRAG } } } , this . newNodeRebinds = function ( ) { return { svg : { click : r . nodes . newNode } } } , this . viewRebinds = function ( ) { return { nodes : { click : r . nodes . view } , edges : { click : r . edges . view } } } , this . connectNodesRebinds = function ( ) { return { nodes : { mousedown : r . nodes . startEdge , mouseup : r . nodes . endEdge } , svg : { mouseup : r . svg . cancelEdge } } } , this . editRebinds = function ( ) { return { nodes : { click : r . nodes . edit } , edges : { click : r . edges . edit } } } , this . expandRebinds = function ( ) { return { nodes : { click : r . nodes . spot } } } , this . deleteRebinds = function ( ) { return { nodes : { click : r . nodes . del } , edges : { click : r . edges . del } } } , this . rebindAll = function ( a ) { m ( a . nodes ) , n ( a . edges ) , o ( a . svg ) } , b . addMenuEntry ( " Edit " , r . nodes . edit ) , b . addMenuEntry ( " Spot " , r . nodes . spot ) , b . addMenuEntry ( " Trash " , r . nodes . del ) , c . addMenuEntry ( " Edit " , r . edges . edit ) , c . addMenuEntry ( " Trash " , r . edges . del ) , this . addControlNewNode = function ( ) { var a = g . add , b = " select_node_collection " , c = function ( ) { j & & i . getNodeCollections ( ) . length > 1 & & modalDialogHelper . createModalDialog ( " Select Vertex Collection " , b , [ { type : " list " , id : " vertex " , objects : i . getNodeCollections ( ) , text : " Select collection " , selected : i . getSelectedNodeCollection ( ) } ] , function ( ) { var a = $ ( " # " + b + " vertex " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) ; i . useNodeCollection ( a ) } , " Select " ) , f . rebindAll ( f . newNodeRebinds ( ) ) } ; l ( a , " new_node " , c ) } , this . addControlView = function ( ) { var a = g . view , b = function ( ) { f . rebindAll ( f . viewRebinds ( ) ) } ; l ( a , " view " , b ) } , this . addControlDrag = function ( ) { var a = g . drag , b = function ( ) { f . rebindAll ( f . dragRebinds ( ) ) } ; l ( a , " drag " , b ) } , this . addControlEdit = function ( ) { var a = g . edit , b = function ( ) { f . rebindAll ( f . editRebinds ( ) ) } ; l ( a , " edit " , b ) } , this . addControlExpand = function ( ) { var a = g . expand , b = function ( ) { f . rebindAll ( f . expandRebinds ( ) ) } ; l ( a , " expand " , b ) } , this . addControlDelete = function ( ) { var a = g . trash , b = function ( ) { f . rebindAll ( f . deleteRebinds ( ) ) } ; l ( a , " delete " , b ) } , this . addControlConnect = function ( ) { var a = g . edge , b = " select_edge_collection " , c = function ( ) { j & & i . getEdgeCollections ( ) . length > 1 & & modalDialogHelper . createModalDialog ( " Select Edge Collection " , b , [ { type : " list " , id : " edge " , objects : i . getEdgeCollections ( ) , text : " Select collection " , selected : i . getSelectedEdgeCollection ( ) } ] , function ( ) { var a = $ ( " # " + b + " edge " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) ; i . useEdgeCollection ( a ) } , " Select " ) , f . rebindAll ( f . connectNodesRebinds ( ) ) } ; l ( a , " connect " , c ) } , this . addAll = function ( ) { f . addControlExpand ( ) , f . addControlDrag ( ) , f . addControlEdit ( ) , f . addControlConnect ( ) , f . addControlNewNode ( ) , f . addControlDelete ( ) } } function GharialAdapterControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The GharialAdapter has to be given . " ; this . addControlChangeGraph = function ( c ) { var d = " control_adapter_graph " , e = d + " _ " ; b . getGraphs ( function ( f ) { uiComponentsHelper . createButton ( a , " Switch Graph " , d , function ( ) { modalDialogHelper . createModalDialog ( " Switch Graph " , e , [ { type : " list " , id : " graph " , objects : f , text : " Select graph " , selected : b . getGraphName ( ) } , { type : " checkbox " , text : " Start with random vertex " , id : " random " , selected : ! 0 } ] , function ( ) { var a = $ ( " # " + e + " graph " ) . children ( " option " ) . filter ( " : selected " ) . text ( ) , d = ! ! $ ( " # " + e + " undirected " ) . prop ( " checked " ) , f = ! ! $ ( " # " + e + " random " ) . prop ( " checked " ) ; return b . changeToGraph ( a , d ) , f ? void b . loadRandomNode ( c ) : void ( _ . isFunction ( c ) & & c ( ) ) } ) } ) } ) } , this . addControlChangePriority = function ( ) { var c = " control_adapter_priority " , d = c + " _ " , e = " Group vertices " ; uiComponentsHelper . createButton ( a , e , c , function ( ) { modalDialogHelper . createModalChangeDialog ( e + " by attribute " , d , [ { type : " extendable " , id : " attribute " , objects : b . getPrioList ( ) } ] , function ( ) { var a = $ ( " input [ id ^ = " + d + " attribute_ ] " ) , c = [ ] ; _ . each ( a , function ( a ) { var b = $ ( a ) . val ( ) ; " " ! = = b & & c . push ( b ) } ) , b . changeTo ( { prioList : c } ) } ) } ) } , this . addAll = function ( ) { this . addControlChangeGraph ( ) , this . addControlChangePriority ( ) } } function GraphViewerPreview ( a , b ) { " use strict " ; var c , d , e , f , g , h , i , j = function ( ) { return d3 . select ( a ) . append ( " svg " ) . attr ( " id " , " graphViewerSVG " ) . attr ( " width " , d ) . attr ( " height " , e ) . attr ( " class " , " graph - viewer " ) . attr ( " style " , " width : " + d + " px ; height : " + e + " ; " ) } , k = function ( a ) { var b = 0 ; return _ . each ( a , function ( c , d ) { c = = = ! 1 ? delete a [ d ] : b + + } ) , b > 0 } , l = function ( a , b ) { _ . each ( b , function ( b , c ) { a [ c ] = a [ c ] | | { } , _ . each ( b , function ( b , d ) { a [ c ] [ d ] = b } ) } ) } , m = function ( a ) { if ( a ) { var b = { } ; a . drag & & l ( b , i . dragRebinds ( ) ) , a . create & & ( l ( b , i . newNodeRebinds ( ) ) , l ( b , i . connectNodesRebinds ( ) ) ) , a . remove & & l ( b , i . deleteRebinds ( ) ) , a . expand & & l ( b , i . expandRebinds ( ) ) , a . edit & & l ( b , i . editRebinds ( ) ) , i . rebindAll ( b ) } } , n = function ( b ) { var c = document . createElement ( " div " ) ; i = new EventDispatcherControls ( c , f . nodeShaper , f . edgeShaper , f . start , f . dispatcherConfig ) , c . id = " toolbox " , c . className = " btn - group btn - group - vertical pull - left toolbox " , a . appendChild ( c ) , _ . each ( b , function ( a , b ) { switch ( b ) { case " expand " : i . addControlExpand ( ) ; break ; case " create " : i . addControlNewNode ( ) , i . addControlConnect ( ) ; break ; case " drag " : i . addControlDrag ( ) ; break ; case " edit " : i . addControlEdit ( ) ; break ; case " remove " : i . addControlDelete ( ) } } ) } , o = function ( a ) { var b = document . createElement ( " div " ) ; i = new EventDispatcherControls ( b , f . nodeShaper , f . edgeShaper , f . start , f . dispatcherConfig ) } , p = function ( ) { b & & ( b . nodeShaper & & ( b . nodeShaper . label & & ( b . nodeShaper . label = " label " ) , b . nodeShaper . shape & & b . nodeShaper . shape . type = = = NodeShaper . shapes . IMAGE & & b . nodeShaper . shape . source & & ( b . nodeShaper . shape . source = " image " ) ) , b . edgeShaper & & b . edgeShaper . label & & ( b . edgeShaper . label = " label " ) ) } , q = function ( ) { return p ( ) , new GraphViewer ( c , d , e , h , b ) } ; d = a . getBoundingClientRect ( ) . width , e = a . getBoundingClientRect ( ) . height , h = { type : " preview " } , b = b | | { } , g = k ( b . toolbox ) , g & & ( d - = 43 ) , c = j ( ) , f = q ( ) , g ? n ( b . toolbox ) : o ( ) , f . loadGraph ( " 1 " ) , m ( b . actions ) } function GraphViewerUI ( a , b , c , d , e , f ) { " use strict " ; if ( void 0 = = = a ) throw " A parent element has to be given . " ; if ( ! a . id ) throw " The parent element needs an unique id . " ; if ( void 0 = = = b ) throw " An adapter configuration has to be given " ; var g , h , i , j , k , l , m , n , o , p = c + 20 | | a . getBoundingClientRect ( ) . width - 81 + 20 , q = d | | a . getBoundingClientRect ( ) . height , r = document . createElement ( " ul " ) , s = document . createElement ( " div " ) , t = function ( ) { g . adapter . NODES_TO_DISPLAY < g . adapter . TOTAL_NODES & & ( $ ( " . headerBar " ) . append ( ' < div class = " infoField " > Graph too big . A random section is rendered . < div class = " fa fa - info - circle " > < / div > < / div > ' ) , $ ( " . infoField . fa - info - circle " ) . attr ( " title " , " You can display additional / other vertices by using the toolbar buttons . " ) . tooltip ( ) ) } , u = function ( ) { var a , b = document . createElement ( " div " ) , c = document . createElement ( " div " ) , d = document . createElement ( " div " ) , e = document . createElement ( " div " ) , f = document . createElement ( " button " ) , h = document . createElement ( " span " ) , i = document . createElement ( " input " ) , j = document . createElement ( " i " ) , k = document . createElement ( " span " ) , l = function ( ) { $ ( s ) . css ( " cursor " , " progress " ) } , n = function ( ) { $ ( s ) . css ( " cursor " , " " ) } , o = function ( a ) { return n ( ) , a & & a . errorCode & & 404 = = = a . errorCode ? void arangoHelper . arangoError ( " Graph error " , " could not find a matching node . " ) : void 0 } , p = function ( ) { l ( ) , " " = = = a . value | | void 0 = = = a . value ? g . loadGraph ( i . value , o ) : g . loadGraphWithAttributeValue ( a . value , i . value , o ) } ; b . id = " filterDropdown " , b . className = " headerDropdown smallDropdown " , c . className = " dropdownInner " , d . className = " queryline " , a = document . createElement ( " input " ) , m = document . createElement ( " ul " ) , e . className = " pull - left input - append searchByAttribute " , a . id = " attribute " , a . type = " text " , a . placeholder = " Attribute name " , f . id = " attribute_example_toggle " , f . className = " button - neutral gv_example_toggle " , h . className = " caret gv_caret " , m . className = " gv - dropdown - menu " , i . id = " value " , i . className = " searchInput gv_searchInput " , i . type = " text " , i . placeholder = " Attribute value " , j . id = " loadnode " , j . className = " fa fa - search " , k . className = " searchEqualsLabel " , k . appendChild ( document . createTextNode ( " = = " ) ) , c . appendChild ( d ) , d . appendChild ( e ) , e . appendChild ( a ) , e . appendChild ( f ) , e . appendChild ( m ) , f . appendChild ( h ) , d . appendChild ( k ) , d . appendChild ( i ) , d . appendChild ( j ) , j . onclick = p , $ ( i ) . keypress ( function ( a ) { return 13 = = = a . keyCode | | 13 = = = a . which ? ( p ( ) , ! 1 ) : void 0 } ) , f . onclick = function ( ) { $ ( m ) . slideToggle ( 200 ) } ; var q = document . createElement ( " p " ) ; return q . className = " dropdown - title " , q . innerHTML = " Filter graph by attribute : " , b . appendChild ( q ) , b . appendChild ( c ) , b } , v = function ( ) { var a , b = document . createElement ( " div " ) , c = document . createElement ( " div " ) , d = document . createElement ( " div " ) , e = document . createElement ( " div " ) , f = document . createElement ( " button " ) , h = document . createElement ( " span " ) , i = document . createElement ( " input " ) , j = document . createElement ( " i " ) , k = document . createElement ( " span " ) , l = function ( ) { $ ( s ) . css ( " cursor " , " progress " ) } , m = function ( ) { $ ( s ) . css ( " cursor " , " " ) } , o = function ( a ) { return m ( ) , a & & a . errorCode & & 404 = = = a . errorCode ? void arangoHelper . arangoError ( " Graph error " , " could not find a matching node . " ) : void 0 } , p = function ( ) { l ( ) , " " ! = = a . value & & g . loadGraphWithAdditionalNode ( a . value , i . value , o ) } ; b . id = " nodeDropdown " , b . className = " headerDropdown smallDropdown " , c . className = " dropdownInner " , d . className = " queryline " , a = document . createElement ( " input " ) , n = document . createElement ( " ul " ) , e . className = " pull - left input - append searchByAttribute " , a . id = " attribute " , a . type = " text " , a . placeholder = " Attribute name " , f . id = " attribute_example_toggle2 " , f . className = " button - neutral gv_example_toggle " , h . className = " caret gv_caret " , n . className = " gv - dropdown - menu " , i . id = " value " , i . className = " searchInput gv_searchInput " , i . type = " text " , i . placeholder = " Attribute value " , j . id = " loadnode " , j . className = " fa fa - search " , k . className = " searchEqualsLabel " , k . appendChild ( document . createTextNode ( " = = " ) ) , c . appendChild ( d ) , d . appendChild ( e ) , e . appendChild ( a ) , e . appendChild ( f ) , e . appendChild ( n ) , f . appendChild ( h ) , d . appendChild ( k ) , d . appendChild ( i ) , d . appendChild ( j ) , C ( n ) , j . onclick = p , $ ( i ) . keypress ( function ( a ) { return 13 = = = a . keyCode | | 13 = = = a . which ? ( p ( ) , ! 1 ) : void 0 } ) , f . onclick = function ( ) { $ ( n ) . slideToggle ( 200 ) } ; var q = document . createElement ( " p " ) ; return q . className = " dropdown - title " , q . innerHTML = " Add specific node by attribute : " , b . appendChild ( q ) , b . appendChild ( c ) , b } , w = function ( ) { var a , b , c , d , e , f , g , h ; return a = document . createElement ( " div " ) , a . id = " configureDropdown " , a . className = " headerDropdown " , b = document . createElement ( " div " ) , b . className = " dropdownInner " , c = document . createElement ( " ul " ) , d = document . createElement ( " li " ) , d . className = " nav - header " , d . appendChild ( document . createTextNode ( " Vertices " ) ) , g = document . createElement ( " ul " ) , h = document . createElement ( " li " ) , h . className = " nav - header " , h . appendChild ( document . createTextNode ( " Edges " ) ) , e = document . createElement ( " ul " ) , f = document . createElement ( " li " ) , f . className = " nav - header " , f . appendChild ( document . createTextNode ( " Connection " ) ) , c . appendChild ( d ) , g . appendChild ( h ) , e . appendChild ( f ) , b . appendChild ( c ) , b . appendChild ( g ) , b . appendChild ( e ) , a . appendChild ( b ) , { configure : a , nodes : c , edges : g , col : e } } , x = function ( a , b , c , d ) { var e , f , g , h , i , j , k , l , m , n , o ; return a . className = " headerButtonBar " , e = document . createElement ( " ul " ) , e . className = " headerButtonList " , a . appendChild ( e ) , g = document . createElement ( " li " ) , g . className = " enabled " , h = document . createElement ( " a " ) , h . id = b , h . className = " headerButton " , i = document . createElement ( " span " ) , i . className = " icon_arangodb_settings2 " , $ ( i ) . attr ( " title " , " Configure " ) , e . appendChild ( g ) , g . appendChild ( h ) , h . appendChild ( i ) , j = document . createElement ( " li " ) , j . className = " enabled " , k = document . createElement ( " a " ) , k . id = d , k . className = " headerButton " , l = document . createElement ( " span " ) , l . className = " fa fa - search - plus " , $ ( l ) . attr ( " title " , " Show additional vertices " ) , e . appendChild ( j ) , j . appendChild ( k ) , k . appendChild ( l ) , m = document . createElement ( " li " ) , m . className = " enabled " , n = document . createElement ( " a " ) , n . id = c , n . className = " headerButton " , o = document . createElement ( " span " ) , o . className = " icon_arangodb_filter " , $ ( o ) . attr ( " title " , " Filter " ) , e . appendChild ( m ) , m . appendChild ( n ) , n . appendChild ( o ) , f = w ( ) , f . filter = u ( ) , f . node = v ( ) , h . onclick = function ( ) { $ ( " # filterdropdown " ) . removeClass ( " activated " ) , $ ( " # nodedropdown " ) . removeClass ( " activated " ) , $ ( " # configuredropdown " ) . toggleClass ( " activated " ) , $ ( f . configure ) . slideToggle ( 200 ) , $ ( f . filter ) . hide ( ) , $ ( f . node ) . hide ( ) } , k . onclick = function ( ) { $ ( " # filterdropdown " ) . removeClass ( " activated " ) , $ ( " # configuredropdown " ) . removeClass ( " activated " ) , $ ( " # nodedropdown " ) . toggleClass ( " activated " ) , $ ( f . node ) . slideToggle ( 200 ) , $ ( f . filter ) . hide ( ) , $ ( f . configure ) . hide ( ) } , n . onclick = function ( ) { $ ( " # configuredropdown " ) . removeClass ( " activated " ) , $ ( " # nodedropdown " ) . removeClass ( " activated " ) , $ ( " # filterdropdown " ) . toggleClass ( " activated " ) , $ ( f . filter ) . slideToggle ( 200 ) , $ ( f . node ) . hide ( ) , $ ( f . configure ) . hide ( ) } , f } , y = function ( ) { return console . log ( q ) , d3 . select ( " # " + a . id + " # background " ) . append ( " svg " ) . attr ( " id " , " graphViewerSVG " ) . attr ( " width " , p ) . attr ( " height " , q ) . attr ( " class " , " graph - viewer " ) . style ( " width " , p + " px " ) . style ( " height " , q + " px " ) } , z = function ( ) { var a = document . createElement ( " div " ) , b = document . createElement ( " div " ) , c = document . createElement ( " button " ) , d = document . createElement ( " button " ) , e = document . createElement ( " button " ) , f = document . createElement ( " button " ) ; a . className = " gv_zoom_widget " , b . className = " gv_zoom_buttons_bg " , c . className = " btn btn - icon btn - zoom btn - zoom - top gv - zoom - btn pan - top " , d . className = " btn btn - icon btn - zoom btn - zoom - left gv - zoom - btn pan - left " , e . className = " btn btn - icon btn - zoom btn - zoom - right gv - zoom - btn pan - right " , f . className = " btn btn - icon btn - zoom btn - zoom - bottom gv - zoom - btn pan - bottom " , c . onclick = function ( ) { g . zoomManager . triggerTranslation ( 0 , - 10 ) } , d . onclick = function ( ) { g . zoomManager . triggerTranslation ( - 10 , 0 ) } , e . onclick = function ( ) { g . zoomManager . triggerTranslation ( 10 , 0 ) } , f . onclick = function ( ) { g . zoomManager . triggerTranslation ( 0 , 10 ) } , b . appendChild ( c ) , b . appendChild ( d ) , b . appendChild ( e ) , b . appendChild ( f ) , l = document . createElement ( " div " ) , l . id = " gv_zoom_slider " , l . className = " gv_zoom_slider " , s . appendChild ( a ) , s . insertBefore ( a , o [ 0 ] [ 0 ] ) , a . appendChild ( b ) , a . appendChild ( l ) , $ ( " # gv_zoom_slider " ) . slider ( { orientation : " vertical " , min : g . zoomManager . getMinimalZoomFactor ( ) , max : 1 , value : 1 , step : . 01 , slide : function ( a , b ) { g . zoomManager . triggerScale ( b . value ) } } ) , g . zoomManager . registerSlider ( $ ( " # gv_zoom_slider " ) ) } , A = function ( ) { var a = document . createElement ( " div " ) , b = new EventDispatcherControls ( a , g . nodeShaper , g . edgeShaper , g . start , g . dispatcherConfig ) ; a . id = " toolbox " , a . className = " btn - group btn - group - vertical toolbox " , s . insertBefore ( a , o [ 0 ] [ 0 ] ) , b . addAll ( ) , $ ( " # control_event_expand " ) . click ( ) } , B = function ( ) { var a = ' < li class = " enabled " style = " float : right " > < select id = " graphSize " class = " documents - size " > < optgroup label = " Starting points : " > < option value = " 5 " selected = " " > 5 vertices < / option > < option value = " 10 " > 10 vertices < / option > < option value = " 20 " > 20 vertices < / option > < option value = " 50 " > 50 vertices < / option > < option value = " 100 " > 100 vertices < / option > < option value = " 500 " > 500 vertices < / option > < option value = " 1000 " > 1000 vertices < / option > < option value = " 2500 " > 2500 vertices < / option > < option value = " 5000 " > 5000 vertices < / option > < option value = " all " > All vertices < / option > < / select > < / optgroup > < / li > ' ; $ ( " . headerBar . headerButtonList " ) . prepend ( a ) } , C = function ( a ) { var b ; b = a ? $ ( a ) : $ ( m ) , b . innerHTML = " " ; var c = document . createElement ( " li " ) , d = document . createElement ( " img " ) ; $ ( c ) . append ( d ) , d . className = " gv - throbber " , b . append ( c ) , g . adapter . getAttributeExamples ( function ( a ) { $ ( b ) . html ( " " ) , _ . each ( a , function ( a ) { var c = document . createElement ( " li " ) , d = document . createElement ( " a " ) , e = document . createElement ( " label " ) ; $ ( c ) . append ( d ) , $ ( d ) . append ( e ) , $ ( e ) . append ( document . createTextNode ( a ) ) , e . className = " gv_dropdown_label " , b . append ( c ) , c . onclick = function ( ) { b . value = a , $ ( b ) . parent ( ) . find ( " input " ) . val ( a ) , $ ( b ) . slideToggle ( 200 ) } } ) } ) } , D = function ( ) { var a = document . createElement ( " div " ) , b = document . createElement ( " div " ) , c = ( document . createElement ( " a " ) , x ( b , " configuredropdown " , " filterdropdown " , " nodedropdown " ) ) ; i = new NodeShaperControls ( c . nodes , g . nodeShaper ) , j = new EdgeShaperControls ( c . edges , g . edgeShaper ) , k = new GharialAdapterControls ( c . col , g . adapter ) , r . id = " menubar " , a . className = " headerBar " , b . id = " modifiers " , r . appendChild ( a ) , r . appendChild ( c . configure ) , r . appendChild ( c . filter ) , r . appendChild ( c . node ) , a . appendChild ( b ) , k . addControlChangeGraph ( function ( ) { C ( ) , g . start ( ! 0 ) } ) , k . addControlChangePriority ( ) , i . addControlOpticLabelAndColourList ( g . adapter ) , j . addControlOpticLabelList ( ) , C ( ) } , E = function ( ) { h = i . createColourMappingList ( ) , h . className = " gv - colour - list " , s . insertBefore ( h , o [ 0 ] [ 0 ] ) } ; a . appendChild ( r ) , a . appendChild ( s ) , s . className = " contentDiv gv - background " , s . id = " background " , e = e | | { } , e . zoom = ! 0 , o = y ( ) , " undefined " ! = = Storage & & ( this . graphSettings = { } , this . loadLocalStorage = function ( ) { var a = b . baseUrl . split ( " / " ) [ 2 ] , c = b . graphName + a ; if ( null = = = localStorage . getItem ( " graphSettings " ) | | " null " = = = localStorage . getItem ( " graphSettings " ) ) { var d = { } ; d [ c ] = { viewer : e , adapter : b } , localStorage . setItem ( " graphSettings " , JSON . stringify ( d ) ) } else try { var f = JSON . parse ( localStorage . getItem ( " graphSettings " ) ) ; this . graphSettings = f , void 0 ! = = f [ c ] . viewer & & ( e = f [ c ] . viewer ) , void 0 ! = = f [ c ] . adapter & & ( b = f [ c ] . adapter ) } catch ( g ) { console . log ( " Could not load graph settings , resetting graph settings . " ) , this . graphSettings [ c ] = { viewer : e , adapter : b } , localStorage . setItem ( " graphSettings " , JSON . stringify ( this . graphSettings ) ) } } , this . loadLocalStorage ( ) , this . writeLocalStorage = function ( ) { } ) , g = new GraphViewer ( o , p , q , b , e ) , A ( ) , z ( ) , D ( ) , E ( ) , t ( ) , B ( ) , $ ( " # graphSize " ) . on ( " change " , function ( ) { var a = $ ( " # graphSize " ) . find ( " : selected " ) . val ( ) ; g . loadGraphWithRandomStart ( function ( a ) { a & & a . errorCode & & arangoHelper . arangoError ( " Graph " , " Sorry your graph seems to be empty " ) } , a ) } ) , f & & ( " string " = = typeof f ? g . loadGraph ( f ) : g . loadGraphWithRandomStart ( function ( a ) { a & & a . errorCode & & arangoHelper . arangoError ( " Graph " , " Sorry your graph seems to be empty " ) } ) ) , this . changeWidth = function ( a ) { g . changeWidth ( a ) ; var b = a - 55 ; o . attr ( " width " , b ) . style ( " width " , b + " px " ) } } function GraphViewerWidget ( a , b ) { " use strict " ; var c , d , e , f , g , h , i , j , k = function ( ) { return d3 . select ( d ) . append ( " svg " ) . attr ( " id " , " graphViewerSVG " ) . attr ( " width " , e ) . attr ( " height " , f ) . attr ( " class " , " graph - viewer " ) . attr ( " style " , " width : " + e + " px ; height : " + f + " px ; " ) } , l = function ( a ) { var b = 0 ; return _ . each ( a , function ( c , d ) { c = = = ! 1 ? delete a [ d ] : b + + } ) , b > 0 } , m = function ( a , b ) { _ . each ( b , function ( b , c ) { a [ c ] = a [ c ] | | { } , _ . each ( b , function ( b , d ) { a [ c ] [ d ] = b } ) } ) } , n = function ( a ) { if ( a ) { var b = { } ; a . drag & & m ( b , j . dragRebinds ( ) ) , a . create & & ( m ( b , j . newNodeRebinds ( ) ) , m ( b , j . connectNodesRebinds ( ) ) ) , a . remove & & m ( b , j . deleteRebinds ( ) ) , a . expand & & m ( b , j . expandRebinds ( ) ) , a . edit & & m ( b , j . editRebinds ( ) ) , j . rebindAll ( b ) } } , o = function ( a ) { var b = document . createElement ( " div " ) ; j = new EventDispatcherControls ( b , g . nodeShaper , g . edgeShaper , g . start , g . dispatcherConfig ) , b . id = " toolbox " , b . className = " btn - group btn - group - vertical pull - left toolbox " , d . appendChild ( b ) , _ . each ( a , function ( a , b ) { switch ( b ) { case " expand " : j . addControlExpand ( ) ; break ; case " create " : j . addControlNewNode ( ) , j . addControlConnect ( ) ; break ; case " drag " : j . addControlDrag ( ) ; break ; case " edit " : j . addControlEdit ( ) ; break ; case " remove " : j . addControlDelete ( ) } } ) } , p = function ( a ) { var b = document . createElement ( " div " ) ; j = new EventDispatcherControls ( b , g . nodeShaper , g . edgeShaper , g . start , g . dispatcherConfig ) } , q = function ( ) { return new GraphViewer ( c , e , f , i , a ) } ; d = document . body , e = d . getBoundingClientRect ( ) . width , f = d . getBoundingClientRect ( ) . height , i = { type : " foxx " , route : " . " } , a = a | | { } , h = l ( a . toolbox ) , h & & ( e - = 43 ) , c = k ( ) , g = q ( ) , h ? o ( a . toolbox ) : p ( ) , b & & g . loadGraph ( b ) , n ( a . actions ) } function LayouterControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The Layouter has to be given . " ; var c = this ; this . addControlGravity = function ( ) { var c = " control_layout_gravity " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Gravity " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Gravity Strength " , d , [ { type : " text " , id : " value " } ] , function ( ) { var a = $ ( " # " + d + " value " ) . attr ( " value " ) ; b . changeTo ( { gravity : a } ) } ) } ) } , this . addControlCharge = function ( ) { var c = " control_layout_charge " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Charge " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Charge Strength " , d , [ { type : " text " , id : " value " } ] , function ( ) { var a = $ ( " # " + d + " value " ) . attr ( " value " ) ; b . changeTo ( { charge : a } ) } ) } ) } , this . addControlDistance = function ( ) { var c = " control_layout_distance " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Distance " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch Distance Strength " , d , [ { type : " text " , id : " value " } ] , function ( ) { var a = $ ( " # " + d + " value " ) . attr ( " value " ) ; b . changeTo ( { distance : a } ) } ) } ) } , this . addAll = function ( ) { c . addControlDistance ( ) , c . addControlGravity ( ) , c . addControlCharge ( ) } } function NodeShaperControls ( a , b ) { " use strict " ; if ( void 0 = = = a ) throw " A list element has to be given . " ; if ( void 0 = = = b ) throw " The NodeShaper has to be given . " ; var c , d = this , e = function ( a ) { for ( ; c . hasChildNodes ( ) ; ) c . removeChild ( c . lastChild ) ; var b = document . createElement ( " ul " ) ; c . appendChild ( b ) , _ . each ( a , function ( a , c ) { var d = document . createElement ( " ul " ) , e = a . list , f = a . front ; d . style . backgroundColor = c , d . style . color = f , _ . each ( e , function ( a ) { var b = document . createElement ( " li " ) ; b . appendChild ( document . createTextNode ( a ) ) , d . appendChild ( b ) } ) , b . appendChild ( d ) } ) } ; this . addControlOpticShapeNone = function ( ) { uiComponentsHelper . createButton ( a , " None " , " control_node_none " , function ( ) { b . changeTo ( { shape : { type : NodeShaper . shapes . NONE } } ) } ) } , this . applyLocalStorage = function ( a ) { if ( " undefined " ! = = Storage ) try { var b = JSON . parse ( localStorage . getItem ( " graphSettings " ) ) , c = window . location . hash . split ( " / " ) [ 1 ] , d = window . location . pathname . split ( " / " ) [ 2 ] , e = c + d ; _ . each ( a , function ( a , c ) { void 0 ! = = c & & ( b [ e ] . viewer . nodeShaper [ c ] = a ) } ) , localStorage . setItem ( " graphSettings " , JSON . stringify ( b ) ) } catch ( f ) { console . log ( f ) } } , this . addControlOpticShapeCircle = function ( ) { var c = " control_node_circle " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Circle " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Circle " , d , [ { type : " text " , id : " radius " } ] , function ( ) { var a = $ ( " # " + d + " radius " ) . attr ( " value " ) ; b . changeTo ( { shape : { type : NodeShaper . shapes . CIRCLE , radius : a } } ) } ) } ) } , this . addControlOpticShapeRect = function ( ) { var c = " control_node_rect " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Rectangle " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Rectangle " , " control_node_rect_ " , [ { type : " text " , id : " width " } , { type : " text " , id : " height " } ] , function ( ) { var a = $ ( " # " + d + " width " ) . attr ( " value " ) , c = $ ( " # " + d + " height " ) . attr ( " value " ) ; b . changeTo ( { shape : { type : NodeShaper . shapes . RECT , width : a , height : c } } ) } ) } ) } , this . addControlOpticLabel = function ( ) { var c = " control_node_label " , e = c + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , c , function ( ) { modalDialogHelper . createModalChangeDialog ( " Change label attribute " , e , [ { type : " text " , id : " key " } ] , function ( ) { var a = $ ( " # " + e + " key " ) . attr ( " value " ) , c = { label : a } ; d . applyLocalStorage ( c ) , b . changeTo ( c ) } ) } ) } , this . addControlOpticSingleColour = function ( ) { var c = " control_node_singlecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Single Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Switch to Colour " , d , [ { type : " text " , id : " fill " } , { type : " text " , id : " stroke " } ] , function ( ) { var a = $ ( " # " + d + " fill " ) . attr ( " value " ) , c = $ ( " # " + d + " stroke " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " single " , fill : a , stroke : c } } ) } ) } ) } , this . addControlOpticAttributeColour = function ( ) { var c = " control_node_attributecolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Colour by Attribute " , c , function ( ) { modalDialogHelper . createModalDialog ( " Display colour by attribute " , d , [ { type : " text " , id : " key " } ] , function ( ) { var a = $ ( " # " + d + " key " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " attribute " , key : a } } ) } ) } ) } , this . addControlOpticExpandColour = function ( ) { var c = " control_node_expandcolour " , d = c + " _ " ; uiComponentsHelper . createButton ( a , " Expansion Colour " , c , function ( ) { modalDialogHelper . createModalDialog ( " Display colours for expansion " , d , [ { type : " text " , id : " expanded " } , { type : " text " , id : " collapsed " } ] , function ( ) { <nl> + var a = $ ( " # " + d + " expanded " ) . attr ( " value " ) , c = $ ( " # " + d + " collapsed " ) . attr ( " value " ) ; b . changeTo ( { color : { type : " expand " , expanded : a , collapsed : c } } ) } ) } ) } , this . addControlOpticLabelAndColour = function ( e ) { var f = " control_node_labelandcolour " , g = f + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , f , function ( ) { modalDialogHelper . createModalChangeDialog ( " Change label attribute " , g , [ { type : " text " , id : " label - attribute " , text : " Vertex label attribute " , value : b . getLabel ( ) | | " " } , { type : " decission " , id : " samecolour " , group : " colour " , text : " Use this attribute for coloring , too " , isDefault : b . getLabel ( ) = = = b . getColor ( ) } , { type : " decission " , id : " othercolour " , group : " colour " , text : " Use different attribute for coloring " , isDefault : b . getLabel ( ) ! = = b . getColor ( ) , interior : [ { type : " text " , id : " colour - attribute " , text : " Color attribute " , value : b . getColor ( ) | | " " } ] } ] , function ( ) { var a = $ ( " # " + g + " label - attribute " ) . attr ( " value " ) , e = $ ( " # " + g + " colour - attribute " ) . attr ( " value " ) , f = $ ( " input [ type = ' radio ' ] [ name = ' colour ' ] : checked " ) . attr ( " id " ) ; f = = = g + " samecolour " & & ( e = a ) ; var h = { label : a , color : { type : " attribute " , key : e } } ; d . applyLocalStorage ( h ) , b . changeTo ( h ) , void 0 = = = c & & ( c = d . createColourMappingList ( ) ) } ) } ) } , this . addControlOpticLabelAndColourList = function ( e ) { var f = " control_node_labelandcolourlist " , g = f + " _ " ; uiComponentsHelper . createButton ( a , " Configure Label " , f , function ( ) { modalDialogHelper . createModalChangeDialog ( " Change label attribute " , g , [ { type : " extendable " , id : " label " , text : " Vertex label attribute " , objects : b . getLabel ( ) } , { type : " decission " , id : " samecolour " , group : " colour " , text : " Use this attribute for coloring , too " , isDefault : b . getLabel ( ) = = = b . getColor ( ) } , { type : " decission " , id : " othercolour " , group : " colour " , text : " Use different attribute for coloring " , isDefault : b . getLabel ( ) ! = = b . getColor ( ) , interior : [ { type : " extendable " , id : " colour " , text : " Color attribute " , objects : b . getColor ( ) | | " " } ] } ] , function ( ) { var a = $ ( " input [ id ^ = " + g + " label_ ] " ) , e = $ ( " input [ id ^ = " + g + " colour_ ] " ) , f = $ ( " input [ type = ' radio ' ] [ name = ' colour ' ] : checked " ) . attr ( " id " ) , h = [ ] , i = [ ] ; a . each ( function ( a , b ) { var c = $ ( b ) . val ( ) ; " " ! = = c & & h . push ( c ) } ) , e . each ( function ( a , b ) { var c = $ ( b ) . val ( ) ; " " ! = = c & & i . push ( c ) } ) , f = = = g + " samecolour " & & ( i = h ) ; var j = { label : h , color : { type : " attribute " , key : i } } ; d . applyLocalStorage ( j ) , b . changeTo ( j ) , void 0 = = = c & & ( c = d . createColourMappingList ( ) ) } ) } ) } , this . addAllOptics = function ( ) { d . addControlOpticShapeNone ( ) , d . addControlOpticShapeCircle ( ) , d . addControlOpticShapeRect ( ) , d . addControlOpticLabel ( ) , d . addControlOpticSingleColour ( ) , d . addControlOpticAttributeColour ( ) , d . addControlOpticExpandColour ( ) } , this . addAllActions = function ( ) { } , this . addAll = function ( ) { d . addAllOptics ( ) , d . addAllActions ( ) } , this . createColourMappingList = function ( ) { return void 0 ! = = c ? c : ( c = document . createElement ( " div " ) , c . id = " node_colour_list " , e ( b . getColourMapping ( ) ) , b . setColourMappingListener ( e ) , c ) } } function GraphViewer ( a , b , c , d , e ) { " use strict " ; if ( $ ( " html " ) . attr ( " xmlns : xlink " , " http : / / www . w3 . org / 1999 / xlink " ) , void 0 = = = a | | void 0 = = = a . append ) throw " SVG has to be given and has to be selected using d3 . select " ; if ( void 0 = = = b | | 0 > = b ) throw " A width greater 0 has to be given " ; if ( void 0 = = = c | | 0 > = c ) throw " A height greater 0 has to be given " ; if ( void 0 = = = d | | void 0 = = = d . type ) throw " An adapter configuration has to be given " ; var f , g , h , i , j , k , l , m , n = this , o = [ ] , p = [ ] , q = function ( a ) { if ( ! a ) return a = { } , a . nodes = p , a . links = o , a . width = b , a . height = c , void ( i = new ForceLayouter ( a ) ) ; switch ( a . type . toLowerCase ( ) ) { case " force " : a . nodes = p , a . links = o , a . width = b , a . height = c , i = new ForceLayouter ( a ) ; break ; default : throw " Sorry unknown layout type . " } } , r = function ( a ) { f . setNodeLimit ( a , n . start ) } , s = function ( d ) { d & & ( j = new ZoomManager ( b , c , a , k , g , h , { } , r ) ) } , t = function ( a ) { var b = a . edgeShaper | | { } , c = a . nodeShaper | | { } , d = c . idfunc | | void 0 , e = a . zoom | | ! 1 ; b . shape = b . shape | | { type : EdgeShaper . shapes . ARROW } , q ( a . layouter ) , m = k . append ( " g " ) , h = new EdgeShaper ( m , b ) , l = k . append ( " g " ) , g = new NodeShaper ( l , c , d ) , i . setCombinedUpdateFunction ( g , h ) , s ( e ) } ; switch ( d . type . toLowerCase ( ) ) { case " arango " : d . width = b , d . height = c , f = new ArangoAdapter ( p , o , this , d ) , f . setChildLimit ( 10 ) ; break ; case " gharial " : d . width = b , d . height = c , f = new GharialAdapter ( p , o , this , d ) , f . setChildLimit ( 10 ) ; break ; case " foxx " : d . width = b , d . height = c , f = new FoxxAdapter ( p , o , d . route , this , d ) ; break ; case " json " : f = new JSONAdapter ( d . path , p , o , this , b , c ) ; break ; case " preview " : d . width = b , d . height = c , f = new PreviewAdapter ( p , o , this , d ) ; break ; default : throw " Sorry unknown adapter type . " } k = a . append ( " g " ) , t ( e | | { } ) , this . start = function ( a ) { i . stop ( ) , a & & ( " " ! = = $ ( " . infoField " ) . text ( ) ? _ . each ( p , function ( a ) { _ . each ( f . randomNodes , function ( b ) { a . _id = = = b . _id & & ( a . _expanded = ! 0 ) } ) } ) : _ . each ( p , function ( a ) { a . _expanded = ! 0 } ) ) , g . drawNodes ( p ) , h . drawEdges ( o ) , i . start ( ) } , this . loadGraph = function ( a , b ) { f . loadInitialNode ( a , function ( a ) { return a . errorCode ? void b ( a ) : ( a . _expanded = ! 0 , n . start ( ) , void ( _ . isFunction ( b ) & & b ( ) ) ) } ) } , this . loadGraphWithRandomStart = function ( a , b ) { f . loadRandomNode ( function ( b ) { return b . errorCode & & 404 = = = b . errorCode ? void a ( b ) : ( b . _expanded = ! 0 , n . start ( ! 0 ) , void ( _ . isFunction ( a ) & & a ( ) ) ) } , b ) } , this . loadGraphWithAdditionalNode = function ( a , b , c ) { f . loadAdditionalNodeByAttributeValue ( a , b , function ( a ) { return a . errorCode ? void c ( a ) : ( a . _expanded = ! 0 , n . start ( ) , void ( _ . isFunction ( c ) & & c ( ) ) ) } ) } , this . loadGraphWithAttributeValue = function ( a , b , c ) { f . randomNodes = [ ] , f . definedNodes = [ ] , f . loadInitialNodeByAttributeValue ( a , b , function ( a ) { return a . errorCode ? void c ( a ) : ( a . _expanded = ! 0 , n . start ( ) , void ( _ . isFunction ( c ) & & c ( ) ) ) } ) } , this . cleanUp = function ( ) { g . resetColourMap ( ) , h . resetColourMap ( ) } , this . changeWidth = function ( a ) { i . changeWidth ( a ) , j . changeWidth ( a ) , f . setWidth ( a ) } , this . dispatcherConfig = { expand : { edges : o , nodes : p , startCallback : n . start , adapter : f , reshapeNodes : g . reshapeNodes } , drag : { layouter : i } , nodeEditor : { nodes : p , adapter : f } , edgeEditor : { edges : o , adapter : f } } , this . adapter = f , this . nodeShaper = g , this . edgeShaper = h , this . layouter = i , this . zoomManager = j } EdgeShaper . shapes = Object . freeze ( { NONE : 0 , ARROW : 1 } ) , NodeShaper . shapes = Object . freeze ( { NONE : 0 , CIRCLE : 1 , RECT : 2 , IMAGE : 3 } ) ; var modalDialogHelper = modalDialogHelper | | { } ; ! function ( ) { " use strict " ; var a , b = function ( a ) { $ ( document ) . bind ( " keypress . key13 " , function ( b ) { b . which & & 13 = = = b . which & & $ ( a ) . click ( ) } ) } , c = function ( ) { $ ( document ) . unbind ( " keypress . key13 " ) } , d = function ( a , b , c , d , e ) { var f , g , h = function ( ) { e ( f ) } , i = modalDialogHelper . modalDivTemplate ( a , b , c , h ) , j = document . createElement ( " tr " ) , k = document . createElement ( " th " ) , l = document . createElement ( " th " ) , m = document . createElement ( " th " ) , n = document . createElement ( " button " ) , o = 1 ; f = function ( ) { var a = { } ; return _ . each ( $ ( " # " + c + " table tr : not ( # first_row ) " ) , function ( b ) { var c = $ ( " . keyCell input " , b ) . val ( ) , d = $ ( " . valueCell input " , b ) . val ( ) ; a [ c ] = d } ) , a } , i . appendChild ( j ) , j . id = " first_row " , j . appendChild ( k ) , k . className = " keyCell " , j . appendChild ( l ) , l . className = " valueCell " , j . appendChild ( m ) , m . className = " actionCell " , m . appendChild ( n ) , n . id = c + " new " , n . className = " graphViewer - icon - button gv - icon - small add " , g = function ( a , b ) { var d , e , f , g = / ^ _ ( id | rev | key | from | to ) / , h = document . createElement ( " tr " ) , j = document . createElement ( " th " ) , k = document . createElement ( " th " ) , l = document . createElement ( " th " ) ; g . test ( b ) | | ( i . appendChild ( h ) , h . appendChild ( k ) , k . className = " keyCell " , e = document . createElement ( " input " ) , e . type = " text " , e . id = c + b + " _key " , e . value = b , k . appendChild ( e ) , h . appendChild ( l ) , l . className = " valueCell " , f = document . createElement ( " input " ) , f . type = " text " , f . id = c + b + " _value " , " object " = = typeof a ? f . value = JSON . stringify ( a ) : f . value = a , l . appendChild ( f ) , h . appendChild ( j ) , j . className = " actionCell " , d = document . createElement ( " button " ) , d . id = c + b + " _delete " , d . className = " graphViewer - icon - button gv - icon - small delete " , j . appendChild ( d ) , d . onclick = function ( ) { i . removeChild ( h ) } ) } , n . onclick = function ( ) { g ( " " , " new_ " + o ) , o + + } , _ . each ( d , g ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , e = function ( a , b , c , d , e ) { var f = modalDialogHelper . modalDivTemplate ( a , b , c , e ) , g = document . createElement ( " tr " ) , h = document . createElement ( " th " ) , i = document . createElement ( " pre " ) ; f . appendChild ( g ) , g . appendChild ( h ) , h . appendChild ( i ) , i . className = " gv - object - view " , i . innerHTML = JSON . stringify ( d , null , 2 ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , f = function ( a , b ) { var c = document . createElement ( " input " ) ; return c . type = " text " , c . id = a , c . value = b , c } , g = function ( a , b ) { var c = document . createElement ( " input " ) ; return c . type = " checkbox " , c . id = a , c . checked = b , c } , h = function ( a , b , c ) { var d = document . createElement ( " select " ) ; return d . id = a , _ . each ( _ . sortBy ( b , function ( a ) { return a . toLowerCase ( ) } ) , function ( a ) { var b = document . createElement ( " option " ) ; b . value = a , b . selected = a = = = c , b . appendChild ( document . createTextNode ( a ) ) , d . appendChild ( b ) } ) , d } , i = function ( a ) { var b = $ ( " . decission_ " + a ) , c = $ ( " input [ type = ' radio ' ] [ name = ' " + a + " ' ] : checked " ) . attr ( " id " ) ; b . each ( function ( ) { $ ( this ) . attr ( " decider " ) = = = c ? $ ( this ) . css ( " display " , " " ) : $ ( this ) . css ( " display " , " none " ) } ) } , j = function ( b , c , d , e , f , g , h , j ) { var k = document . createElement ( " input " ) , l = b + c , m = document . createElement ( " label " ) , n = document . createElement ( " tbody " ) ; k . id = l , k . type = " radio " , k . name = d , k . className = " gv - radio - button " , m . className = " radio " , h . appendChild ( m ) , m . appendChild ( k ) , m . appendChild ( document . createTextNode ( e ) ) , j . appendChild ( n ) , $ ( n ) . toggleClass ( " decission_ " + d , ! 0 ) , $ ( n ) . attr ( " decider " , l ) , _ . each ( g , function ( c ) { a ( n , b , c ) } ) , f ? k . checked = ! 0 : k . checked = ! 1 , m . onclick = function ( a ) { i ( d ) , a . stopPropagation ( ) } , i ( d ) } , k = function ( a , b , c , d , e , f ) { var g , h = [ ] , i = a + b , j = 1 , k = document . createElement ( " th " ) , l = document . createElement ( " button " ) , m = document . createElement ( " input " ) , n = function ( a ) { j + + ; var c , d = document . createElement ( " tr " ) , g = document . createElement ( " th " ) , k = document . createElement ( " th " ) , l = document . createElement ( " th " ) , m = document . createElement ( " input " ) , n = document . createElement ( " button " ) ; m . type = " text " , m . id = i + " _ " + j , m . value = a | | " " , c = 0 = = = h . length ? $ ( f ) : $ ( h [ h . length - 1 ] ) , c . after ( d ) , d . appendChild ( g ) , g . className = " collectionTh capitalize " , g . appendChild ( document . createTextNode ( b + " " + j + " : " ) ) , d . appendChild ( k ) , k . className = " collectionTh " , k . appendChild ( m ) , n . id = i + " _ " + j + " _remove " , n . className = " graphViewer - icon - button gv - icon - small delete " , n . onclick = function ( ) { e . removeChild ( d ) , h . splice ( h . indexOf ( d ) , 1 ) } , l . appendChild ( n ) , d . appendChild ( l ) , h . push ( d ) } ; for ( m . type = " text " , m . id = i + " _1 " , d . appendChild ( m ) , k . appendChild ( l ) , f . appendChild ( k ) , l . onclick = function ( ) { n ( ) } , l . id = i + " _addLine " , l . className = " graphViewer - icon - button gv - icon - small add " , " string " = = typeof c & & c . length > 0 & & ( c = [ c ] ) , c . length > 0 & & ( m . value = c [ 0 ] ) , g = 1 ; g < c . length ; g + + ) n ( c [ g ] ) } , l = function ( a , b ) { var d = document . createElement ( " div " ) , e = document . createElement ( " div " ) , f = document . createElement ( " button " ) , g = document . createElement ( " a " ) , h = document . createElement ( " div " ) , i = document . createElement ( " table " ) ; return d . id = b + " modal " , d . className = " modal hide fade createModalDialog " , d . setAttribute ( " tabindex " , " - 1 " ) , d . setAttribute ( " role " , " dialog " ) , d . setAttribute ( " aria - labelledby " , " myModalLabel " ) , d . setAttribute ( " aria - hidden " , ! 0 ) , d . style . display = " none " , d . onhidden = function ( ) { c ( ) , document . body . removeChild ( d ) } , e . className = " modal - header " , g . className = " arangoHeader " , f . id = b + " modal_dismiss " , f . className = " close " , f . dataDismiss = " modal " , f . ariaHidden = " true " , f . appendChild ( document . createTextNode ( " × " ) ) , g . appendChild ( document . createTextNode ( a ) ) , h . className = " modal - body " , i . id = b + " table " , d . appendChild ( e ) , d . appendChild ( h ) , e . appendChild ( f ) , e . appendChild ( g ) , h . appendChild ( i ) , document . body . appendChild ( d ) , f . onclick = function ( ) { c ( ) , $ ( " # " + b + " modal " ) . modal ( " hide " ) } , { div : d , bodyTable : i } } ; a = function ( a , b , c ) { var d = document . createElement ( " tr " ) , e = document . createElement ( " th " ) , i = document . createElement ( " th " ) ; switch ( a . appendChild ( d ) , d . appendChild ( e ) , e . className = " collectionTh " , c . text ? e . appendChild ( document . createTextNode ( c . text + " : " ) ) : ( e . className + = " capitalize " , c . type & & " extenadable " = = = c . type ? e . appendChild ( document . createTextNode ( c . id + " : " ) ) : e . appendChild ( document . createTextNode ( c . id + " : " ) ) ) , d . appendChild ( i ) , i . className = " collectionTh " , c . type ) { case " text " : i . appendChild ( f ( b + c . id , c . value | | " " ) ) ; break ; case " checkbox " : i . appendChild ( g ( b + c . id , c . selected | | ! 1 ) ) ; break ; case " list " : i . appendChild ( h ( b + c . id , c . objects , c . selected | | void 0 ) ) ; break ; case " extendable " : k ( b , c . id , c . objects , i , a , d ) ; break ; case " decission " : j ( b , c . id , c . group , c . text , c . isDefault , c . interior , i , a ) , e . innerHTML = " " ; break ; default : a . removeChild ( d ) } return d } , modalDialogHelper . modalDivTemplate = function ( a , d , e , f ) { d = d | | " Switch " ; var g = document . createElement ( " div " ) , h = document . createElement ( " button " ) , i = document . createElement ( " button " ) , j = l ( a , e ) ; return g . className = " modal - footer " , h . id = e + " cancel " , h . className = " button - close btn - margin " , h . appendChild ( document . createTextNode ( " Close " ) ) , i . id = e + " submit " , i . className = " button - success " , i . style . marginRight = " 8px " , i . appendChild ( document . createTextNode ( d ) ) , j . div . appendChild ( g ) , g . appendChild ( i ) , g . appendChild ( h ) , h . onclick = function ( ) { c ( ) , $ ( " # " + e + " modal " ) . modal ( " hide " ) } , i . onclick = function ( ) { c ( ) , f ( ) , $ ( " # " + e + " modal " ) . modal ( " hide " ) } , b ( i ) , j . bodyTable } , modalDialogHelper . createModalDialog = function ( b , c , d , e , f ) { var g = modalDialogHelper . modalDivTemplate ( b , f , c , e ) ; _ . each ( d , function ( b ) { a ( g , c , b ) } ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , modalDialogHelper . createModalChangeDialog = function ( b , c , d , e ) { var f = modalDialogHelper . modalDivTemplate ( b , " Change " , c , e ) ; _ . each ( d , function ( b ) { a ( f , c , b ) } ) , $ ( " # " + c + " modal " ) . modal ( " show " ) } , modalDialogHelper . createModalEditDialog = function ( a , b , c , e ) { d ( a , " Save " , b , c , e ) } , modalDialogHelper . createModalCreateDialog = function ( a , b , c , e ) { d ( a , " Create " , b , c , e ) } , modalDialogHelper . createModalViewDialog = function ( a , b , c , d ) { e ( a , " Edit " , b , c , d ) } , modalDialogHelper . createModalDeleteDialog = function ( a , d , e , f ) { var g = document . createElement ( " div " ) , h = document . createElement ( " button " ) , i = document . createElement ( " button " ) , j = l ( a , d ) ; g . className = " modal - footer " , h . id = d + " cancel " , h . className = " button - close btn - margin " , h . appendChild ( document . createTextNode ( " Close " ) ) , i . id = d + " submit " , i . className = " button - danger " , i . style . marginRight = " 8px " , i . appendChild ( document . createTextNode ( " Delete " ) ) , j . div . appendChild ( g ) , g . appendChild ( i ) , g . appendChild ( h ) , h . onclick = function ( ) { c ( ) , $ ( " # " + d + " modal " ) . modal ( " hide " ) } , i . onclick = function ( ) { c ( ) , f ( e ) , $ ( " # " + d + " modal " ) . modal ( " hide " ) } , b ( i ) , $ ( " # " + d + " modal " ) . modal ( " show " ) } } ( ) ; var uiComponentsHelper = uiComponentsHelper | | { } ; ! function ( ) { " use strict " ; uiComponentsHelper . createButton = function ( a , b , c , d ) { var e = document . createElement ( " li " ) , f = document . createElement ( " button " ) ; e . className = " graph_control " + c , e . id = c , e . appendChild ( f ) , f . className = " button - primary gv_dropdown_entry " , f . appendChild ( document . createTextNode ( b ) ) , a . appendChild ( e ) , f . id = c + " _button " , f . onclick = d } , uiComponentsHelper . createIconButton = function ( a , b , c ) { var d = document . createElement ( " div " ) , e = document . createElement ( " h6 " ) , f = document . createElement ( " h6 " ) ; return d . className = " gv_action_button " , d . id = b , d . onclick = function ( ) { $ ( " . gv_action_button " ) . each ( function ( a , b ) { $ ( b ) . toggleClass ( " active " , ! 1 ) } ) , " control_event_new_node " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " pointer " ) , $ ( " . gv - background " ) . css ( " cursor " , " copy " ) ) : " control_event_drag " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " - webkit - grabbing " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_expand " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " grabbing " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_view " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " - webkit - zoom - in " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_edit " = = = d . id ? ( $ ( " . gv - background . node " ) . css ( " cursor " , " context - menu " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_connect " = = = d . id ? ( $ ( " . node " ) . css ( " cursor " , " ne - resize " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) : " control_event_delete " = = = d . id & & ( $ ( " . node " ) . css ( " cursor " , " pointer " ) , $ ( " . gv - background " ) . css ( " cursor " , " default " ) ) , $ ( d ) . toggleClass ( " active " , ! 0 ) , c ( ) } , e . className = " fa gv_icon_icon fa - " + a . icon , e . title = a . title , f . className = " gv_button_title " , d . appendChild ( e ) , d . appendChild ( f ) , f . appendChild ( document . createTextNode ( a . title ) ) , d } } ( ) , function ( ) { " use strict " ; var a = null ; window . isCoordinator = function ( b ) { null = = = a ? $ . ajax ( " cluster / amICoordinator " , { async : ! 0 , success : function ( c ) { a = c , b ( ! 1 , c ) } , error : function ( c ) { a = c , b ( ! 0 , c ) } } ) : b ( ! 1 , a ) } , window . versionHelper = { fromString : function ( a ) { var b = a . replace ( / - [ a - zA - Z0 - 9_ \ - ] * $ / g , " " ) . split ( " . " ) ; return { major : parseInt ( b [ 0 ] , 10 ) | | 0 , minor : parseInt ( b [ 1 ] , 10 ) | | 0 , patch : parseInt ( b [ 2 ] , 10 ) | | 0 , toString : function ( ) { return this . major + " . " + this . minor + " . " + this . patch } } } , toString : function ( a ) { return a . major + " . " + a . minor + " . " + a . patch } } , window . arangoHelper = { lastNotificationMessage : null , CollectionTypes : { } , systemAttributes : function ( ) { return { _id : ! 0 , _rev : ! 0 , _key : ! 0 , _bidirectional : ! 0 , _vertices : ! 0 , _from : ! 0 , _to : ! 0 , $ id : ! 0 } } , getCurrentSub : function ( ) { return window . App . naviView . activeSubMenu } , parseError : function ( a , b ) { var c ; try { c = JSON . parse ( b . responseText ) . errorMessage } catch ( d ) { c = d } this . arangoError ( a , c ) } , setCheckboxStatus : function ( a ) { _ . each ( $ ( a ) . find ( " ul " ) . find ( " li " ) , function ( a ) { $ ( a ) . hasClass ( " nav - header " ) | | ( $ ( a ) . find ( " input " ) . attr ( " checked " ) ? $ ( a ) . find ( " i " ) . hasClass ( " css - round - label " ) ? $ ( a ) . find ( " i " ) . addClass ( " fa - dot - circle - o " ) : $ ( a ) . find ( " i " ) . addClass ( " fa - check - square - o " ) : $ ( a ) . find ( " i " ) . hasClass ( " css - round - label " ) ? $ ( a ) . find ( " i " ) . addClass ( " fa - circle - o " ) : $ ( a ) . find ( " i " ) . addClass ( " fa - square - o " ) ) } ) } , parseInput : function ( a ) { var b , c = $ ( a ) . val ( ) ; try { b = JSON . parse ( c ) } catch ( d ) { b = c } return b } , calculateCenterDivHeight : function ( ) { var a = $ ( " . navbar " ) . height ( ) , b = $ ( " . footer " ) . height ( ) , c = $ ( window ) . height ( ) ; return c - b - a - 110 } , fixTooltips : function ( a , b ) { $ ( a ) . tooltip ( { placement : b , hide : ! 1 , show : ! 1 } ) } , currentDatabase : function ( a ) { return frontendConfig . db ? a ( ! 1 , frontendConfig . db ) : a ( ! 0 , void 0 ) , frontendConfig . db } , allHotkeys : { jsoneditor : { name : " AQL editor " , content : [ { label : " Execute Query " , letter : " Ctrl / Cmd + Return " } , { label : " Explain Query " , letter : " Ctrl / Cmd + Shift + Return " } , { label : " Save Query " , letter : " Ctrl / Cmd + Shift + S " } , { label : " Open search " , letter : " Ctrl + Space " } , { label : " Toggle comments " , letter : " Ctrl / Cmd + Shift + C " } , { label : " Undo " , letter : " Ctrl / Cmd + Z " } , { label : " Redo " , letter : " Ctrl / Cmd + Shift + Z " } ] } , doceditor : { name : " Document editor " , content : [ { label : " Insert " , letter : " Ctrl + Insert " } , { label : " Save " , letter : " Ctrl + Return , Cmd + Return " } , { label : " Append " , letter : " Ctrl + Shift + Insert " } , { label : " Duplicate " , letter : " Ctrl + D " } , { label : " Remove " , letter : " Ctrl + Delete " } ] } , modals : { name : " Modal " , content : [ { label : " Submit " , letter : " Return " } , { label : " Close " , letter : " Esc " } , { label : " Navigate buttons " , letter : " Arrow keys " } , { label : " Navigate content " , letter : " Tab " } ] } } , hotkeysFunctions : { scrollDown : function ( ) { window . scrollBy ( 0 , 180 ) } , scrollUp : function ( ) { window . scrollBy ( 0 , - 180 ) } , showHotkeysModal : function ( ) { var a = [ ] , b = window . arangoHelper . allHotkeys ; window . modalView . show ( " modalHotkeys . ejs " , " Keyboard Shortcuts " , a , b ) } } , buildSubNavBar : function ( a ) { $ ( " # subNavigationBar . bottom " ) . html ( " " ) ; var b ; _ . each ( a , function ( a , c ) { b = " " , a . active & & ( b + = " active " ) , a . disabled & & ( b + = " disabled " ) , $ ( " # subNavigationBar . bottom " ) . append ( ' < li class = " subMenuEntry ' + b + ' " > < a > ' + c + " < / a > < / li > " ) , a . disabled | | $ ( " # subNavigationBar . bottom " ) . children ( ) . last ( ) . bind ( " click " , function ( ) { window . App . navigate ( a . route , { trigger : ! 0 } ) } ) } ) } , buildNodeSubNav : function ( a , b , c ) { var d = { Dashboard : { route : " # node / " + encodeURIComponent ( a ) } , Logs : { route : " # nLogs / " + encodeURIComponent ( a ) , disabled : ! 0 } } ; d [ b ] . active = ! 0 , d [ c ] . disabled = ! 0 , this . buildSubNavBar ( d ) } , scaleability : void 0 , buildNodesSubNav : function ( a ) { if ( void 0 = = = this . scaleability ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { null ! = = a . numberOfCoordinators & & null ! = = a . numberOfDBServers ? ( b . scaleability = ! 0 , b . buildNodesSubNav ( ) ) : b . scaleability = ! 1 } } ) } var c = { Coordinators : { route : " # cNodes " } , DBServers : { route : " # dNodes " } } ; c . Scale = { route : " # sNodes " , disabled : ! 0 } , " coordinator " = = = a ? c . Coordinators . active = ! 0 : " scale " = = = a ? this . scaleability = = = ! 0 ? c . Scale . active = ! 0 : window . App . navigate ( " # nodes " , { trigger : ! 0 } ) : c . DBServers . active = ! 0 , this . scaleability = = = ! 0 & & ( c . Scale . disabled = ! 1 ) , this . buildSubNavBar ( c ) } , buildCollectionSubNav : function ( a , b ) { var c = " # collection / " + encodeURIComponent ( a ) , d = { Content : { route : c + " / documents / 1 " } , Indices : { route : " # cIndices / " + encodeURIComponent ( a ) } , Info : { route : " # cInfo / " + encodeURIComponent ( a ) } , Settings : { route : " # cSettings / " + encodeURIComponent ( a ) } } ; d [ b ] . active = ! 0 , this . buildSubNavBar ( d ) } , enableKeyboardHotkeys : function ( a ) { var b = window . arangoHelper . hotkeysFunctions ; a = = = ! 0 & & ( $ ( document ) . on ( " keydown " , null , " j " , b . scrollDown ) , $ ( document ) . on ( " keydown " , null , " k " , b . scrollUp ) ) } , databaseAllowed : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " " , " " ) : $ . ajax ( { type : " GET " , cache : ! 1 , url : this . databaseUrl ( " / _api / database / " , c ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { a ( ! 1 , ! 0 ) } , error : function ( ) { a ( ! 0 , ! 1 ) } } ) } . bind ( this ) ; this . currentDatabase ( b ) } , arangoNotification : function ( a , b , c ) { window . App . notificationList . add ( { title : a , content : b , info : c , type : " success " } ) } , arangoError : function ( a , b , c ) { window . App . notificationList . add ( { title : a , content : b , info : c , type : " error " } ) } , arangoWarning : function ( a , b , c ) { window . App . notificationList . add ( { title : a , content : b , info : c , type : " warning " } ) } , hideArangoNotifications : function ( ) { $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) } , openDocEditor : function ( a , b , c ) { var d = a . split ( " / " ) , e = this , f = new window . DocumentView ( { collection : window . App . arangoDocumentStore } ) ; f . breadcrumb = function ( ) { } , f . colid = d [ 0 ] , f . docid = d [ 1 ] , f . el = " . arangoFrame . innerDiv " , f . render ( ) , f . setType ( b ) , $ ( " . arangoFrame . headerBar " ) . remove ( ) , $ ( " . arangoFrame . outerDiv " ) . prepend ( ' < i class = " fa fa - times " > < / i > ' ) , $ ( " . arangoFrame . outerDiv " ) . click ( function ( ) { e . closeDocEditor ( ) } ) , $ ( " . arangoFrame . innerDiv " ) . click ( function ( a ) { a . stopPropagation ( ) } ) , $ ( " . fa - times " ) . click ( function ( ) { e . closeDocEditor ( ) } ) , $ ( " . arangoFrame " ) . show ( ) , f . customView = ! 0 , f . customDeleteFunction = function ( ) { window . modalView . hide ( ) , $ ( " . arangoFrame " ) . hide ( ) } , $ ( " . arangoFrame # deleteDocumentButton " ) . click ( function ( ) { f . deleteDocumentModal ( ) } ) , $ ( " . arangoFrame # saveDocumentButton " ) . click ( function ( ) { f . saveDocument ( ) } ) , $ ( " . arangoFrame # deleteDocumentButton " ) . css ( " display " , " none " ) } , closeDocEditor : function ( ) { $ ( " . arangoFrame . outerDiv . fa - times " ) . remove ( ) , $ ( " . arangoFrame " ) . hide ( ) } , addAardvarkJob : function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : this . databaseUrl ( " / _admin / aardvark / job " ) , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b & & b ( ! 1 , a ) } , error : function ( a ) { b & & b ( ! 0 , a ) } } ) } , deleteAardvarkJob : function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : this . databaseUrl ( " / _admin / aardvark / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b & & b ( ! 1 , a ) } , error : function ( a ) { b & & b ( ! 0 , a ) } } ) } , deleteAllAardvarkJobs : function ( a ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , url : this . databaseUrl ( " / _admin / aardvark / job " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a & & a ( ! 1 , b ) } , error : function ( b ) { a & & a ( ! 0 , b ) } } ) } , getAardvarkJobs : function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , url : this . databaseUrl ( " / _admin / aardvark / job " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a & & a ( ! 1 , b ) } , error : function ( b ) { console . log ( " error " ) , a & & a ( ! 0 , b ) } } ) } , getPendingJobs : function ( a ) { $ . ajax ( { cache : ! 1 , type : " GET " , url : this . databaseUrl ( " / _api / job / pending " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , syncAndReturnUninishedAardvarkJobs : function ( a , b ) { var c = function ( c , d ) { if ( c ) b ( ! 0 ) ; else { var e = function ( c , e ) { if ( c ) arangoHelper . arangoError ( " " , " " ) ; else { var f = [ ] ; e . length > 0 ? _ . each ( d , function ( b ) { if ( b . type = = = a | | void 0 = = = b . type ) { var c = ! 1 ; _ . each ( e , function ( a ) { b . id = = = a & & ( c = ! 0 ) } ) , c ? f . push ( { collection : b . collection , id : b . id , type : b . type , desc : b . desc } ) : window . arangoHelper . deleteAardvarkJob ( b . id ) } } ) : d . length > 0 & & this . deleteAllAardvarkJobs ( ) , b ( ! 1 , f ) } } . bind ( this ) ; this . getPendingJobs ( e ) } } . bind ( this ) ; this . getAardvarkJobs ( c ) } , getRandomToken : function ( ) { return Math . round ( ( new Date ) . getTime ( ) ) } , isSystemAttribute : function ( a ) { var b = this . systemAttributes ( ) ; return b [ a ] } , isSystemCollection : function ( a ) { return " _ " = = = a . name . substr ( 0 , 1 ) } , setDocumentStore : function ( a ) { this . arangoDocumentStore = a } , collectionApiType : function ( a , b , c ) { if ( b | | void 0 = = = this . CollectionTypes [ a ] ) { var d = function ( b , c , d ) { b ? arangoHelper . arangoError ( " Error " , " Could not detect collection type " ) : ( this . CollectionTypes [ a ] = c . type , 3 = = = this . CollectionTypes [ a ] ? d ( ! 1 , " edge " ) : d ( ! 1 , " document " ) ) } . bind ( this ) ; this . arangoDocumentStore . getCollectionInfo ( a , d , c ) } else c ( ! 1 , this . CollectionTypes [ a ] ) } , collectionType : function ( a ) { if ( ! a | | " " = = = a . name ) return " - " ; var b ; return b = 2 = = = a . type ? " document " : 3 = = = a . type ? " edge " : " unknown " , this . isSystemCollection ( a ) & & ( b + = " ( system ) " ) , b } , formatDT : function ( a ) { var b = function ( a ) { return 10 > a ? " 0 " + a : a } ; return a . getUTCFullYear ( ) + " - " + b ( a . getUTCMonth ( ) + 1 ) + " - " + b ( a . getUTCDate ( ) ) + " " + b ( a . getUTCHours ( ) ) + " : " + b ( a . getUTCMinutes ( ) ) + " : " + b ( a . getUTCSeconds ( ) ) } , escapeHtml : function ( a ) { return String ( a ) . replace ( / & / g , " & amp ; " ) . replace ( / < / g , " & lt ; " ) . replace ( / > / g , " & gt ; " ) . replace ( / " / g , " & quot ; " ) . replace ( / ' / g , " & # 39 ; " ) } , backendUrl : function ( a ) { return frontendConfig . basePath + a } , databaseUrl : function ( a , b ) { if ( " / _db / " = = = a . substr ( 0 , 5 ) ) throw new Error ( " Calling databaseUrl with a databased url ( " + a + " ) doesn ' t make any sense " ) ; return b | | ( b = " _system " , frontendConfig . db & & ( b = frontendConfig . db ) ) , this . backendUrl ( " / _db / " + encodeURIComponent ( b ) + a ) } } } ( ) , function ( ) { " use strict " ; if ( ! window . hasOwnProperty ( " TEST_BUILD " ) ) { var a = function ( ) { var a = { } ; return a . createTemplate = function ( a ) { var b = $ ( " # " + a . replace ( " . " , " \ \ . " ) ) . html ( ) ; return { render : function ( a ) { var c = _ . template ( b ) ; return c = c ( a ) } } } , a } ; window . templateEngine = new a } } ( ) , function ( ) { " use strict " ; window . dygraphConfig = { defaultFrame : 12e5 , zeropad : function ( a ) { return 10 > a ? " 0 " + a : a } , xAxisFormat : function ( a ) { if ( - 1 = = = a ) return " " ; var b = new Date ( a ) ; return this . zeropad ( b . getHours ( ) ) + " : " + this . zeropad ( b . getMinutes ( ) ) + " : " + this . zeropad ( b . getSeconds ( ) ) } , mergeObjects : function ( a , b , c ) { c | | ( c = [ ] ) ; var d , e = { } ; return c . forEach ( function ( c ) { var d = a [ c ] , f = b [ c ] ; void 0 = = = d & & ( d = { } ) , void 0 = = = f & & ( f = { } ) , e [ c ] = _ . extend ( d , f ) } ) , d = _ . extend ( a , b ) , Object . keys ( e ) . forEach ( function ( a ) { d [ a ] = e [ a ] } ) , d } , mapStatToFigure : { residentSize : [ " times " , " residentSizePercent " ] , pageFaults : [ " times " , " majorPageFaultsPerSecond " , " minorPageFaultsPerSecond " ] , systemUserTime : [ " times " , " systemTimePerSecond " , " userTimePerSecond " ] , totalTime : [ " times " , " avgQueueTime " , " avgRequestTime " , " avgIoTime " ] , dataTransfer : [ " times " , " bytesSentPerSecond " , " bytesReceivedPerSecond " ] , requests : [ " times " , " getsPerSecond " , " putsPerSecond " , " postsPerSecond " , " deletesPerSecond " , " patchesPerSecond " , " headsPerSecond " , " optionsPerSecond " , " othersPerSecond " ] } , colors : [ " rgb ( 95 , 194 , 135 ) " , " rgb ( 238 , 190 , 77 ) " , " # 81ccd8 " , " # 7ca530 " , " # 3c3c3c " , " # aa90bd " , " # e1811d " , " # c7d4b2 " , " # d0b2d4 " ] , figureDependedOptions : { clusterRequestsPerSecond : { showLabelsOnHighlight : ! 0 , title : " " , header : " Cluster Requests per Second " , stackedGraph : ! 0 , div : " lineGraphLegend " , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } , residentSize : { header : " Memory " , axes : { y : { labelsKMG2 : ! 1 , axisLabelFormatter : function ( a ) { return parseFloat ( 100 * a . toPrecision ( 3 ) ) + " % " } , valueFormatter : function ( a ) { return parseFloat ( 100 * a . toPrecision ( 3 ) ) + " % " } } } } , pageFaults : { header : " Page Faults " , visibility : [ ! 0 , ! 1 ] , labels : [ " datetime " , " Major Page " , " Minor Page " ] , div : " pageFaultsChart " , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } , systemUserTime : { div : " systemUserTimeChart " , header : " System and User Time " , labels : [ " datetime " , " System Time " , " User Time " ] , stackedGraph : ! 0 , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } , totalTime : { div : " totalTimeChart " , header : " Total Time " , labels : [ " datetime " , " Queue " , " Computation " , " I / O " ] , labelsKMG2 : ! 1 , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } , stackedGraph : ! 0 } , dataTransfer : { header : " Data Transfer " , labels : [ " datetime " , " Bytes sent " , " Bytes received " ] , stackedGraph : ! 0 , div : " dataTransferChart " } , requests : { header : " Requests " , labels : [ " datetime " , " Reads " , " Writes " ] , stackedGraph : ! 0 , div : " requestsChart " , axes : { y : { valueFormatter : function ( a ) { return parseFloat ( a . toPrecision ( 3 ) ) } , axisLabelFormatter : function ( a ) { return 0 = = = a ? 0 : parseFloat ( a . toPrecision ( 3 ) ) } } } } } , getDashBoardFigures : function ( a ) { var b = [ ] , c = this ; return Object . keys ( this . figureDependedOptions ) . forEach ( function ( d ) { " clusterRequestsPerSecond " ! = = d & & ( c . figureDependedOptions [ d ] . div | | a ) & & b . push ( d ) } ) , b } , getDefaultConfig : function ( a ) { var b = this , c = { digitsAfterDecimal : 1 , drawGapPoints : ! 0 , fillGraph : ! 0 , fillAlpha : . 85 , showLabelsOnHighlight : ! 1 , strokeWidth : 0 , lineWidth : 0 , strokeBorderWidth : 0 , includeZero : ! 0 , highlightCircleSize : 2 . 5 , labelsSeparateLines : ! 0 , strokeBorderColor : " rgba ( 0 , 0 , 0 , 0 ) " , interactionModel : { } , maxNumberWidth : 10 , colors : [ this . colors [ 0 ] ] , xAxisLabelWidth : " 50 " , rightGap : 15 , showRangeSelector : ! 1 , rangeSelectorHeight : 50 , rangeSelectorPlotStrokeColor : " # 365300 " , rangeSelectorPlotFillColor : " " , pixelsPerLabel : 50 , labelsKMG2 : ! 0 , dateWindow : [ ( new Date ) . getTime ( ) - this . defaultFrame , ( new Date ) . getTime ( ) ] , axes : { x : { valueFormatter : function ( a ) { return b . xAxisFormat ( a ) } } , y : { ticker : Dygraph . numericLinearTicks } } } ; return this . figureDependedOptions [ a ] & & ( c = this . mergeObjects ( c , this . figureDependedOptions [ a ] , [ " axes " ] ) , c . div & & c . labels & & ( c . colors = this . getColors ( c . labels ) , c . labelsDiv = document . getElementById ( c . div + " Legend " ) , c . legend = " always " , c . showLabelsOnHighlight = ! 0 ) ) , c } , getDetailChartConfig : function ( a ) { var b = _ . extend ( this . getDefaultConfig ( a ) , { showRangeSelector : ! 0 , interactionModel : null , showLabelsOnHighlight : ! 0 , highlightCircleSize : 2 . 5 , legend : " always " , labelsDiv : " div # detailLegend . dashboard - legend - inner " } ) ; return " pageFaults " = = = a & & ( b . visibility = [ ! 0 , ! 0 ] ) , b . labels | | ( b . labels = [ " datetime " , b . header ] , b . colors = this . getColors ( b . labels ) ) , b } , getColors : function ( a ) { var b ; return b = this . colors . concat ( [ ] ) , b . slice ( 0 , a . length - 1 ) } } } ( ) , function ( ) { " use strict " ; window . arangoCollectionModel = Backbone . Model . extend ( { idAttribute : " name " , urlRoot : arangoHelper . databaseUrl ( " / _api / collection " ) , defaults : { id : " " , name : " " , status : " " , type : " " , isSystem : ! 1 , picture : " " , locked : ! 1 , desc : void 0 } , getProperties : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + encodeURIComponent ( this . get ( " id " ) ) + " / properties " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , getFigures : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / figures " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( ) { a ( ! 0 ) } } ) } , getRevision : function ( a , b ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / revision " ) , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a ( ! 1 , c , b ) } , error : function ( ) { a ( ! 0 ) } } ) } , getIndex : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / index / ? collection = " + this . get ( " id " ) ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , createIndex : function ( a , b ) { var c = this ; $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / index ? collection = " + c . get ( " id " ) ) , headers : { " x - arango - async " : " store " } , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) ? ( window . arangoHelper . addAardvarkJob ( { id : e . getResponseHeader ( " x - arango - async - id " ) , type : " index " , desc : " Creating Index " , collection : c . get ( " id " ) } ) , b ( ! 1 , a ) ) : b ( ! 0 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } , deleteIndex : function ( a , b ) { var c = this ; $ . ajax ( { cache : ! 1 , type : " DELETE " , url : arangoHelper . databaseUrl ( " / _api / index / " + this . get ( " name " ) + " / " + encodeURIComponent ( a ) ) , headers : { " x - arango - async " : " store " } , success : function ( a , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) ? ( window . arangoHelper . addAardvarkJob ( { id : e . getResponseHeader ( " x - arango - async - id " ) , type : " index " , desc : " Removing Index " , collection : c . get ( " id " ) } ) , b ( ! 1 , a ) ) : b ( ! 0 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) , b ( ) } , truncateCollection : function ( ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / truncate " ) , success : function ( ) { arangoHelper . arangoNotification ( " Collection truncated . " ) } , error : function ( ) { arangoHelper . arangoError ( " Collection error . " ) } } ) } , loadCollection : function ( a ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / load " ) , success : function ( ) { a ( ! 1 ) } , error : function ( ) { a ( ! 0 ) } } ) , a ( ) } , unloadCollection : function ( a ) { <nl> + $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / unload ? flush = true " ) , success : function ( ) { a ( ! 1 ) } , error : function ( ) { a ( ! 0 ) } } ) , a ( ) } , renameCollection : function ( a , b ) { var c = this ; $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / rename " ) , data : JSON . stringify ( { name : a } ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { c . set ( " name " , a ) , b ( ! 1 ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } , changeCollection : function ( a , b , c , d ) { var e = ! 1 ; " true " = = = a ? a = ! 0 : " false " = = = a & & ( a = ! 1 ) ; var f = { waitForSync : a , journalSize : parseInt ( b ) , indexBuckets : parseInt ( c ) } ; return $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . get ( " id " ) + " / properties " ) , data : JSON . stringify ( f ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { d ( ! 1 ) } , error : function ( a ) { d ( ! 1 , a ) } } ) , e } } ) } ( ) , window . DatabaseModel = Backbone . Model . extend ( { idAttribute : " name " , initialize : function ( ) { " use strict " } , isNew : function ( ) { " use strict " ; return ! 1 } , sync : function ( a , b , c ) { " use strict " ; return " update " = = = a & & ( a = " create " ) , Backbone . sync ( a , b , c ) } , url : arangoHelper . databaseUrl ( " / _api / database " ) , defaults : { } } ) , window . arangoDocumentModel = Backbone . Model . extend ( { initialize : function ( ) { " use strict " } , urlRoot : arangoHelper . databaseUrl ( " / _api / document " ) , defaults : { _id : " " , _rev : " " , _key : " " } , getSorted : function ( ) { " use strict " ; var a = this , b = Object . keys ( a . attributes ) . sort ( function ( a , b ) { var c = arangoHelper . isSystemAttribute ( a ) , d = arangoHelper . isSystemAttribute ( b ) ; return c ! = = d ? c ? - 1 : 1 : b > a ? - 1 : 1 } ) , c = { } ; return _ . each ( b , function ( b ) { c [ b ] = a . attributes [ b ] } ) , c } } ) , function ( ) { " use strict " ; window . ArangoQuery = Backbone . Model . extend ( { urlRoot : arangoHelper . databaseUrl ( " / _api / user " ) , defaults : { name : " " , type : " custom " , value : " " } } ) } ( ) , window . Replication = Backbone . Model . extend ( { defaults : { state : { } , server : { } } , initialize : function ( ) { } } ) , window . Statistics = Backbone . Model . extend ( { defaults : { } , url : function ( ) { " use strict " ; return " / _admin / statistics " } } ) , window . StatisticsDescription = Backbone . Model . extend ( { defaults : { figures : " " , groups : " " } , url : function ( ) { " use strict " ; return " / _admin / statistics - description " } } ) , window . Users = Backbone . Model . extend ( { defaults : { user : " " , active : ! 1 , extra : { } } , idAttribute : " user " , parse : function ( a ) { return this . isNotNew = ! 0 , a } , isNew : function ( ) { return ! this . isNotNew } , url : function ( ) { return this . isNew ( ) ? arangoHelper . databaseUrl ( " / _api / user " ) : " " ! = = this . get ( " user " ) ? arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) : arangoHelper . databaseUrl ( " / _api / user " ) } , checkPassword : function ( a , b ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) , data : JSON . stringify ( { passwd : a } ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b ( ! 1 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } , setPassword : function ( a ) { $ . ajax ( { cache : ! 1 , type : " PATCH " , url : arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) , data : JSON . stringify ( { passwd : a } ) , contentType : " application / json " , processData : ! 1 } ) } , setExtras : function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " PATCH " , url : arangoHelper . databaseUrl ( " / _api / user / " + this . get ( " user " ) ) , data : JSON . stringify ( { extra : { name : a , img : b } } ) , contentType : " application / json " , processData : ! 1 , success : function ( ) { c ( ! 1 ) } , error : function ( ) { c ( ! 0 ) } } ) } } ) , function ( ) { " use strict " ; window . ClusterCoordinator = Backbone . Model . extend ( { defaults : { name : " " , status : " ok " , address : " " , protocol : " " } , idAttribute : " name " , forList : function ( ) { return { name : this . get ( " name " ) , status : this . get ( " status " ) , url : this . get ( " url " ) } } } ) } ( ) , function ( ) { " use strict " ; window . ClusterServer = Backbone . Model . extend ( { defaults : { name : " " , address : " " , role : " " , status : " ok " } , idAttribute : " name " , forList : function ( ) { return { name : this . get ( " name " ) , address : this . get ( " address " ) , status : this . get ( " status " ) } } } ) } ( ) , function ( ) { " use strict " ; window . Coordinator = Backbone . Model . extend ( { defaults : { address : " " , protocol : " " , name : " " , status : " " } } ) } ( ) , function ( ) { " use strict " ; window . CurrentDatabase = Backbone . Model . extend ( { url : arangoHelper . databaseUrl ( " / _api / database / current " , frontendConfig . db ) , parse : function ( a ) { return a . result } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b , c , d , e , f ) { var g = { contentType : " application / json " , processData : ! 1 , type : c } ; b = b | | function ( ) { } , f = _ . extend ( { mount : a . encodedMount ( ) } , f ) ; var h = _ . reduce ( f , function ( a , b , c ) { return a + encodeURIComponent ( c ) + " = " + encodeURIComponent ( b ) + " & " } , " ? " ) ; g . url = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes " + ( d ? " / " + d : " " ) + h . slice ( 0 , h . length - 1 ) ) , void 0 ! = = e & & ( g . data = JSON . stringify ( e ) ) , $ . ajax ( g ) . then ( function ( a ) { b ( null , a ) } , function ( a ) { window . xhr = a , b ( _ . extend ( a . status ? new Error ( a . responseJSON ? a . responseJSON . errorMessage : a . responseText ) : new Error ( " Network Error " ) , { statusCode : a . status } ) ) } ) } ; window . Foxx = Backbone . Model . extend ( { idAttribute : " mount " , defaults : { author : " Unknown Author " , name : " " , version : " Unknown Version " , description : " No description " , license : " Unknown License " , contributors : [ ] , scripts : { } , config : { } , deps : { } , git : " " , system : ! 1 , development : ! 1 } , isNew : function ( ) { return ! 1 } , encodedMount : function ( ) { return encodeURIComponent ( this . get ( " mount " ) ) } , destroy : function ( b , c ) { a ( this , c , " DELETE " , void 0 , void 0 , b ) } , isBroken : function ( ) { return ! 1 } , needsAttention : function ( ) { return this . isBroken ( ) | | this . needsConfiguration ( ) | | this . hasUnconfiguredDependencies ( ) } , needsConfiguration : function ( ) { return _ . any ( this . get ( " config " ) , function ( a ) { return void 0 = = = a . current & & a . required ! = = ! 1 } ) } , hasUnconfiguredDependencies : function ( ) { return _ . any ( this . get ( " deps " ) , function ( a ) { return void 0 = = = a . current & & a . definition . required ! = = ! 1 } ) } , getConfiguration : function ( b ) { a ( this , function ( a , c ) { a | | this . set ( " config " , c ) , " function " = = typeof b & & b ( a , c ) } . bind ( this ) , " GET " , " config " ) } , setConfiguration : function ( b , c ) { a ( this , c , " PATCH " , " config " , b ) } , getDependencies : function ( b ) { a ( this , function ( a , c ) { a | | this . set ( " deps " , c ) , " function " = = typeof b & & b ( a , c ) } . bind ( this ) , " GET " , " deps " ) } , setDependencies : function ( b , c ) { a ( this , c , " PATCH " , " deps " , b ) } , toggleDevelopment : function ( b , c ) { a ( this , function ( a , d ) { a | | this . set ( " development " , b ) , " function " = = typeof c & & c ( a , d ) } . bind ( this ) , " PATCH " , " devel " , b ) } , runScript : function ( b , c , d ) { a ( this , d , " POST " , " scripts / " + b , c ) } , runTests : function ( b , c ) { a ( this , function ( a , b ) { " function " = = typeof c & & c ( a ? a . responseJSON : a , b ) } . bind ( this ) , " POST " , " tests " , b ) } , isSystem : function ( ) { return this . get ( " system " ) } , isDevelopment : function ( ) { return this . get ( " development " ) } , download : function ( ) { window . open ( arangoHelper . databaseUrl ( " / _db / " + arango . getDatabaseName ( ) + " / _admin / aardvark / foxxes / download / zip ? mount = " + this . encodedMount ( ) ) ) } } ) } ( ) , function ( ) { " use strict " ; window . Graph = Backbone . Model . extend ( { idAttribute : " _key " , urlRoot : arangoHelper . databaseUrl ( " / _api / gharial " ) , isNew : function ( ) { return ! this . get ( " _id " ) } , parse : function ( a ) { return a . graph | | a } , addEdgeDefinition : function ( a ) { $ . ajax ( { async : ! 1 , type : " POST " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / edge " , data : JSON . stringify ( a ) } ) } , deleteEdgeDefinition : function ( a ) { $ . ajax ( { async : ! 1 , type : " DELETE " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / edge / " + a } ) } , modifyEdgeDefinition : function ( a ) { $ . ajax ( { async : ! 1 , type : " PUT " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / edge / " + a . collection , data : JSON . stringify ( a ) } ) } , addVertexCollection : function ( a ) { $ . ajax ( { async : ! 1 , type : " POST " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / vertex " , data : JSON . stringify ( { collection : a } ) } ) } , deleteVertexCollection : function ( a ) { $ . ajax ( { async : ! 1 , type : " DELETE " , url : this . urlRoot + " / " + this . get ( " _key " ) + " / vertex / " + a } ) } , defaults : { name : " " , edgeDefinitions : [ ] , orphanCollections : [ ] } } ) } ( ) , function ( ) { " use strict " ; window . newArangoLog = Backbone . Model . extend ( { defaults : { lid : " " , level : " " , timestamp : " " , text : " " , totalAmount : " " } , getLogStatus : function ( ) { switch ( this . get ( " level " ) ) { case 1 : return " Error " ; case 2 : return " Warning " ; case 3 : return " Info " ; case 4 : return " Debug " ; default : return " Unknown " } } } ) } ( ) , function ( ) { " use strict " ; window . Notification = Backbone . Model . extend ( { defaults : { title : " " , date : 0 , content : " " , priority : " " , tags : " " , seen : ! 1 } } ) } ( ) , function ( ) { " use strict " ; window . queryManagementModel = Backbone . Model . extend ( { defaults : { id : " " , query : " " , started : " " , runTime : " " } } ) } ( ) , function ( ) { " use strict " ; window . workMonitorModel = Backbone . Model . extend ( { defaults : { name : " " , number : " " , status : " " , type : " " } } ) } ( ) , function ( ) { " use strict " ; window . AutomaticRetryCollection = Backbone . Collection . extend ( { _retryCount : 0 , checkRetries : function ( ) { var a = this ; return this . updateUrl ( ) , this . _retryCount > 10 ? ( window . setTimeout ( function ( ) { a . _retryCount = 0 } , 1e4 ) , window . App . clusterUnreachable ( ) , ! 1 ) : ! 0 } , successFullTry : function ( ) { this . _retryCount = 0 } , failureTry : function ( a , b , c ) { 401 = = = c . status ? window . App . requestAuth ( ) : ( window . App . clusterPlan . rotateCoordinator ( ) , this . _retryCount + + , a ( ) ) } } ) } ( ) , function ( ) { " use strict " ; window . PaginatedCollection = Backbone . Collection . extend ( { page : 0 , pagesize : 10 , totalAmount : 0 , getPage : function ( ) { return this . page + 1 } , setPage : function ( a ) { return a > = this . getLastPageNumber ( ) ? void ( this . page = this . getLastPageNumber ( ) - 1 ) : 1 > a ? void ( this . page = 0 ) : void ( this . page = a - 1 ) } , getLastPageNumber : function ( ) { return Math . max ( Math . ceil ( this . totalAmount / this . pagesize ) , 1 ) } , getOffset : function ( ) { return this . page * this . pagesize } , getPageSize : function ( ) { return this . pagesize } , setPageSize : function ( a ) { if ( " all " = = = a ) this . pagesize = " all " ; else try { a = parseInt ( a , 10 ) , this . pagesize = a } catch ( b ) { } } , setToFirst : function ( ) { this . page = 0 } , setToLast : function ( ) { this . setPage ( this . getLastPageNumber ( ) ) } , setToPrev : function ( ) { this . setPage ( this . getPage ( ) - 1 ) } , setToNext : function ( ) { this . setPage ( this . getPage ( ) + 1 ) } , setTotal : function ( a ) { this . totalAmount = a } , getTotal : function ( ) { return this . totalAmount } , setTotalMinusOne : function ( ) { this . totalAmount - - } } ) } ( ) , window . ClusterStatisticsCollection = Backbone . Collection . extend ( { model : window . Statistics , url : " / _admin / statistics " , updateUrl : function ( ) { this . url = window . App . getNewRoute ( this . host ) + this . url } , initialize : function ( a , b ) { this . host = b . host , window . App . registerForUpdate ( this ) } } ) , function ( ) { " use strict " ; window . arangoCollections = Backbone . Collection . extend ( { url : arangoHelper . databaseUrl ( " / _api / collection " ) , model : arangoCollectionModel , searchOptions : { searchPhrase : null , includeSystem : ! 1 , includeDocument : ! 0 , includeEdge : ! 0 , includeLoaded : ! 0 , includeUnloaded : ! 0 , sortBy : " name " , sortOrder : 1 } , translateStatus : function ( a ) { switch ( a ) { case 0 : return " corrupted " ; case 1 : return " new born collection " ; case 2 : return " unloaded " ; case 3 : return " loaded " ; case 4 : return " unloading " ; case 5 : return " deleted " ; case 6 : return " loading " ; default : return } } , translateTypePicture : function ( a ) { var b = " " ; switch ( a ) { case " document " : b + = " fa - file - text - o " ; break ; case " edge " : b + = " fa - share - alt " ; break ; case " unknown " : b + = " fa - question " ; break ; default : b + = " fa - cogs " } return b } , parse : function ( a ) { var b = this ; return _ . each ( a . result , function ( a ) { a . isSystem = arangoHelper . isSystemCollection ( a ) , a . type = arangoHelper . collectionType ( a ) , a . status = b . translateStatus ( a . status ) , a . picture = b . translateTypePicture ( a . type ) } ) , a . result } , getPosition : function ( a ) { var b , c = this . getFiltered ( this . searchOptions ) , d = null , e = null ; for ( b = 0 ; b < c . length ; + + b ) c [ b ] . get ( " name " ) = = = a & & ( b > 0 & & ( d = c [ b - 1 ] ) , b < c . length - 1 & & ( e = c [ b + 1 ] ) ) ; return { prev : d , next : e } } , getFiltered : function ( a ) { var b = [ ] , c = [ ] ; if ( null ! = = a . searchPhrase ) { var d = a . searchPhrase . toLowerCase ( ) ; d = d . replace ( / \ s + / g , " " ) . replace ( / ( ^ \ s + | \ s + $ ) / g , " " ) , c = d . split ( " " ) } return this . models . forEach ( function ( d ) { if ( c . length > 0 ) { var e , f = d . get ( " name " ) . toLowerCase ( ) ; for ( e = 0 ; e < c . length ; + + e ) if ( - 1 = = = f . indexOf ( c [ e ] ) ) return } a . includeSystem = = = ! 1 & & d . get ( " isSystem " ) | | a . includeEdge = = = ! 1 & & " edge " = = = d . get ( " type " ) | | a . includeDocument = = = ! 1 & & " document " = = = d . get ( " type " ) | | a . includeLoaded = = = ! 1 & & " loaded " = = = d . get ( " status " ) | | a . includeUnloaded = = = ! 1 & & " unloaded " = = = d . get ( " status " ) | | b . push ( d ) } ) , b . sort ( function ( b , c ) { var d , e ; return " type " = = = a . sortBy ? ( d = b . get ( " type " ) + " " + b . get ( " name " ) . toLowerCase ( ) , e = c . get ( " type " ) + " " + c . get ( " name " ) . toLowerCase ( ) ) : ( d = b . get ( " name " ) . toLowerCase ( ) , e = c . get ( " name " ) . toLowerCase ( ) ) , d ! = = e ? a . sortOrder * ( e > d ? - 1 : 1 ) : 0 } ) , b } , newCollection : function ( a , b ) { var c = { } ; c . name = a . collName , c . waitForSync = a . wfs , a . journalSize > 0 & & ( c . journalSize = a . journalSize ) , c . isSystem = a . isSystem , c . type = parseInt ( a . collType , 10 ) , a . shards & & ( c . numberOfShards = a . shards , c . shardKeys = a . keys ) , a . replicationFactor & & ( c . replicationFactor = JSON . parse ( a . replicationFactor ) ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / collection " ) , data : JSON . stringify ( c ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { b ( ! 1 , a ) } , error : function ( a ) { b ( ! 0 , a ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ArangoDatabase = Backbone . Collection . extend ( { model : window . DatabaseModel , sortOptions : { desc : ! 1 } , url : arangoHelper . databaseUrl ( " / _api / database " ) , comparator : function ( a , b ) { var c = a . get ( " name " ) . toLowerCase ( ) , d = b . get ( " name " ) . toLowerCase ( ) ; return this . sortOptions . desc = = = ! 0 ? d > c ? 1 : c > d ? - 1 : 0 : c > d ? 1 : d > c ? - 1 : 0 } , parse : function ( a ) { return a ? _ . map ( a . result , function ( a ) { return { name : a } } ) : void 0 } , initialize : function ( ) { var a = this ; this . fetch ( ) . done ( function ( ) { a . sort ( ) } ) } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , getDatabases : function ( ) { var a = this ; return this . fetch ( ) . done ( function ( ) { a . sort ( ) } ) , this . models } , getDatabasesForUser : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : this . url + " / user " , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b . result . sort ( ) ) } , error : function ( ) { a ( ! 0 , [ ] ) } } ) } , createDatabaseURL : function ( a , b , c ) { var d = window . location , e = window . location . hash ; b = b ? " SSL " = = = b | | " https : " = = = b ? " https : " : " http : " : d . protocol , c = c | | d . port ; var f = b + " / / " + window . location . hostname + " : " + c + " / _db / " + encodeURIComponent ( a ) + " / _admin / aardvark / standalone . html " ; if ( e ) { var g = e . split ( " / " ) [ 0 ] ; 0 = = = g . indexOf ( " # collection " ) & & ( g = " # collections " ) , 0 = = = g . indexOf ( " # service " ) & & ( g = " # services " ) , f + = g } return f } , getCurrentDatabase : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : this . url + " / current " , contentType : " application / json " , processData : ! 1 , success : function ( b ) { 200 = = = b . code ? a ( ! 1 , b . result . name ) : a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , hasSystemAccess : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " DB " , " Could not fetch databases " ) : a ( ! 1 , _ . contains ( c , " _system " ) ) } . bind ( this ) ; this . getDatabasesForUser ( b ) } } ) } ( ) , window . arangoDocument = Backbone . Collection . extend ( { url : " / _api / document / " , model : arangoDocumentModel , collectionInfo : { } , deleteEdge : function ( a , b , c ) { this . deleteDocument ( a , b , c ) } , deleteDocument : function ( a , b , c ) { $ . ajax ( { cache : ! 1 , type : " DELETE " , contentType : " application / json " , url : arangoHelper . databaseUrl ( " / _api / document / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , success : function ( ) { c ( ! 1 ) } , error : function ( ) { c ( ! 0 ) } } ) } , addDocument : function ( a , b ) { var c = this ; c . createTypeDocument ( a , b ) } , createTypeEdge : function ( a , b , c , d , e ) { var f ; f = d ? JSON . stringify ( { _key : d , _from : b , _to : c } ) : JSON . stringify ( { _from : b , _to : c } ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / document ? collection = " + encodeURIComponent ( a ) ) , data : f , contentType : " application / json " , processData : ! 1 , success : function ( a ) { e ( ! 1 , a ) } , error : function ( a ) { e ( ! 0 , a ) } } ) } , createTypeDocument : function ( a , b , c ) { var d ; d = b ? JSON . stringify ( { _key : b } ) : JSON . stringify ( { } ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / document ? collection = " + encodeURIComponent ( a ) ) , data : d , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( ! 1 , a . _id ) } , error : function ( a ) { c ( ! 0 , a . _id ) } } ) } , getCollectionInfo : function ( a , b , c ) { var d = this ; $ . ajax ( { cache : ! 1 , type : " GET " , url : arangoHelper . databaseUrl ( " / _api / collection / " + a + " ? " + arangoHelper . getRandomToken ( ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d . collectionInfo = a , b ( ! 1 , a , c ) } , error : function ( a ) { b ( ! 0 , a , c ) } } ) } , getEdge : function ( a , b , c ) { this . getDocument ( a , b , c ) } , getDocument : function ( a , b , c ) { var d = this ; this . clearDocument ( ) , $ . ajax ( { cache : ! 1 , type : " GET " , url : arangoHelper . databaseUrl ( " / _api / document / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d . add ( a ) , c ( ! 1 , a , " document " ) } , error : function ( a ) { d . add ( ! 0 , a ) } } ) } , saveEdge : function ( a , b , c , d ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / edge / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , data : c , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d ( ! 1 , a ) } , error : function ( a ) { d ( ! 0 , a ) } } ) } , saveDocument : function ( a , b , c , d ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / document / " + encodeURIComponent ( a ) + " / " + encodeURIComponent ( b ) ) , data : c , contentType : " application / json " , processData : ! 1 , success : function ( a ) { d ( ! 1 , a ) } , error : function ( a ) { d ( ! 0 , a ) } } ) } , updateLocalDocument : function ( a ) { this . clearDocument ( ) , this . add ( a ) } , clearDocument : function ( ) { this . reset ( ) } } ) , function ( ) { " use strict " ; window . arangoDocuments = window . PaginatedCollection . extend ( { collectionID : 1 , filters : [ ] , checkCursorTimer : void 0 , MAX_SORT : 12e3 , lastQuery : { } , sortAttribute : " " , url : arangoHelper . databaseUrl ( " / _api / documents " ) , model : window . arangoDocumentModel , loadTotal : function ( a ) { var b = this ; $ . ajax ( { cache : ! 1 , type : " GET " , url : arangoHelper . databaseUrl ( " / _api / collection / " + this . collectionID + " / count " ) , contentType : " application / json " , processData : ! 1 , success : function ( c ) { b . setTotal ( c . count ) , a ( ! 1 ) } , error : function ( ) { a ( ! 0 ) } } ) } , setCollection : function ( a ) { var b = function ( a ) { a & & arangoHelper . arangoError ( " Documents " , " Could not fetch documents count " ) } . bind ( this ) ; this . resetFilter ( ) , this . collectionID = a , this . setPage ( 1 ) , this . loadTotal ( b ) } , setSort : function ( a ) { this . sortAttribute = a } , getSort : function ( ) { return this . sortAttribute } , addFilter : function ( a , b , c ) { this . filters . push ( { attr : a , op : b , val : c } ) } , setFiltersForQuery : function ( a ) { if ( 0 = = = this . filters . length ) return " " ; var b = " FILTER " , c = " " , d = _ . map ( this . filters , function ( b , d ) { return " LIKE " = = = b . op ? ( c = " " + b . op + " ( x . ` " + b . attr + " ` , @ param " , c + = d , c + = " ) " ) : ( c = " IN " = = = b . op | | " NOT IN " = = = b . op ? " " : " x . ` " , c + = b . attr , c + = " IN " = = = b . op | | " NOT IN " = = = b . op ? " " : " ` " , c + = b . op , c + = " IN " = = = b . op | | " NOT IN " = = = b . op ? " x . @ param " : " @ param " , c + = d ) , a [ " param " + d ] = b . val , c } ) ; return b + d . join ( " & & " ) } , setPagesize : function ( a ) { this . setPageSize ( a ) } , resetFilter : function ( ) { this . filters = [ ] } , moveDocument : function ( a , b , c , d ) { var e , f , g , h , i = { " @ collection " : b , filterid : a } ; e = " FOR x IN @ @ collection " , e + = " FILTER x . _key = = @ filterid " , e + = " INSERT x IN " , e + = c , f = " FOR x in @ @ collection " , f + = " FILTER x . _key = = @ filterid " , f + = " REMOVE x IN @ @ collection " , g = { query : e , bindVars : i } , h = { query : f , bindVars : i } , window . progressView . show ( ) , $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , data : JSON . stringify ( g ) , contentType : " application / json " , success : function ( ) { $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , data : JSON . stringify ( h ) , contentType : " application / json " , success : function ( ) { d & & d ( ) , window . progressView . hide ( ) } , error : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Documents inserted , but could not be removed . " ) } } ) } , error : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Could not move selected documents . " ) } } ) } , getDocuments : function ( a ) { var b , c , d , e , f = this ; c = { " @ collection " : this . collectionID , offset : this . getOffset ( ) , count : this . getPageSize ( ) } , b = " FOR x IN @ @ collection LET att = SLICE ( ATTRIBUTES ( x ) , 0 , 25 ) " , b + = this . setFiltersForQuery ( c ) , this . getTotal ( ) < this . MAX_SORT & & ( " _key " = = = this . getSort ( ) ? b + = " SORT TO_NUMBER ( x . " + this . getSort ( ) + " ) = = 0 ? x . " + this . getSort ( ) + " : TO_NUMBER ( x . " + this . getSort ( ) + " ) " : " " ! = = this . getSort ( ) & & ( b + = " SORT x . " + this . getSort ( ) ) ) , " all " ! = = c . count ? b + = " LIMIT @ offset , @ count RETURN KEEP ( x , att ) " : ( d = { " @ collection " : this . collectionID } , c = d , b + = " RETURN KEEP ( x , att ) " ) , e = { query : b , bindVars : c } ; var g = function ( b ) { $ . ajax ( { cache : ! 1 , type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( b ) ) , contentType : " application / json " , success : function ( c , d , h ) { 201 = = = h . status ? ( window . progressView . toShow = ! 1 , f . clearDocuments ( ) , c . extra & & void 0 ! = = c . extra . stats . fullCount & & f . setTotal ( c . extra . stats . fullCount ) , 0 ! = = f . getTotal ( ) & & _ . each ( c . result , function ( a ) { f . add ( { id : a . _id , rev : a . _rev , key : a . _key , content : a } ) } ) , f . lastQuery = e , a ( ! 1 , c ) ) : 204 = = = h . status & & ( f . checkCursorTimer = window . setTimeout ( function ( ) { g ( b ) } , 500 ) ) } , error : function ( b ) { a ( ! 1 , b ) } } ) } ; $ . ajax ( { cache : ! 1 , type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , data : JSON . stringify ( e ) , headers : { " x - arango - async " : " store " } , contentType : " application / json " , success : function ( b , c , d ) { if ( d . getResponseHeader ( " x - arango - async - id " ) ) { var e = d . getResponseHeader ( " x - arango - async - id " ) , h = function ( ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( e ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( f . checkCursorTimer ) , arangoHelper . arangoNotification ( " Documents " , " Canceled operation . " ) , $ ( " . dataTables_empty " ) . text ( " Canceled . " ) , window . progressView . hide ( ) } } ) } ; window . progressView . showWithDelay ( 300 , " Fetching documents . . . " , h ) , g ( e ) } else a ( ! 0 , b ) } , error : function ( b ) { a ( ! 1 , b ) } } ) } , clearDocuments : function ( ) { this . reset ( ) } , buildDownloadDocumentQuery : function ( ) { var a , b , c ; return c = { " @ collection " : this . collectionID } , a = " FOR x in @ @ collection " , a + = this . setFiltersForQuery ( c ) , this . getTotal ( ) < this . MAX_SORT & & this . getSort ( ) . length > 0 & & ( a + = " SORT x . " + this . getSort ( ) ) , a + = " RETURN x " , b = { query : a , bindVars : c } } , uploadDocuments : function ( a , b ) { $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / import ? type = auto & collection = " + encodeURIComponent ( this . collectionID ) + " & createCollection = false " ) , data : a , processData : ! 1 , contentType : " json " , dataType : " json " , complete : function ( a ) { if ( 4 = = = a . readyState & & 201 = = = a . status ) b ( ! 1 ) ; else try { var c = JSON . parse ( a . responseText ) ; if ( c . errors > 0 ) { var d = " At least one error occurred during upload " ; b ( ! 1 , d ) } } catch ( e ) { console . log ( e ) } } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ArangoLogs = window . PaginatedCollection . extend ( { upto : ! 1 , loglevel : 0 , totalPages : 0 , parse : function ( a ) { var b = [ ] ; return _ . each ( a . lid , function ( c , d ) { b . push ( { level : a . level [ d ] , lid : c , text : a . text [ d ] , timestamp : a . timestamp [ d ] , totalAmount : a . totalAmount } ) } ) , this . totalAmount = a . totalAmount , this . totalPages = Math . ceil ( this . totalAmount / this . pagesize ) , b } , initialize : function ( a ) { a . upto = = = ! 0 & & ( this . upto = ! 0 ) , this . loglevel = a . loglevel } , model : window . newArangoLog , url : function ( ) { var a , b , c , d ; c = this . page * this . pagesize ; var e = this . totalAmount - ( this . page + 1 ) * this . pagesize ; return 0 > e & & this . page = = = this . totalPages - 1 ? ( e = 0 , d = this . totalAmount % this . pagesize ) : d = this . pagesize , 0 = = = this . totalAmount & & ( d = 1 ) , a = this . upto ? " upto " : " level " , b = " / _admin / log ? " + a + " = " + this . loglevel + " & size = " + d + " & offset = " + e , arangoHelper . databaseUrl ( b ) } } ) } ( ) , function ( ) { " use strict " ; window . ArangoQueries = Backbone . Collection . extend ( { initialize : function ( a , b ) { var c = this ; $ . ajax ( " whoAmI ? _ = " + Date . now ( ) , { async : ! 0 } ) . done ( function ( a ) { this . activeUser = = = ! 1 ? c . activeUser = " root " : c . activeUser = a . user } ) } , url : arangoHelper . databaseUrl ( " / _api / user / " ) , model : ArangoQuery , activeUser : null , parse : function ( a ) { var b , c = this ; return this . activeUser = = = ! 1 & & ( this . activeUser = " root " ) , _ . each ( a . result , function ( a ) { if ( a . user = = = c . activeUser ) try { a . extra . queries & & ( b = a . extra . queries ) } catch ( d ) { } } ) , b } , saveCollectionQueries : function ( a ) { if ( 0 = = = this . activeUser ) return ! 1 ; this . activeUser = = = ! 1 & & ( this . activeUser = " root " ) ; var b = [ ] ; this . each ( function ( a ) { b . push ( { value : a . attributes . value , parameter : a . attributes . parameter , name : a . attributes . name } ) } ) , $ . ajax ( { cache : ! 1 , type : " PATCH " , url : arangoHelper . databaseUrl ( " / _api / user / " + encodeURIComponent ( this . activeUser ) ) , data : JSON . stringify ( { extra : { queries : b } } ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( ) { a ( ! 0 ) } } ) } , saveImportQueries : function ( a , b ) { return 0 = = = this . activeUser ? ! 1 : ( window . progressView . show ( " Fetching documents . . . " ) , void $ . ajax ( { cache : ! 1 , type : " POST " , url : " query / upload / " + encodeURIComponent ( this . activeUser ) , data : a , contentType : " application / json " , processData : ! 1 , success : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoNotification ( " Queries successfully imported . " ) , b ( ) } , error : function ( ) { window . progressView . hide ( ) , arangoHelper . arangoError ( " Query error " , " queries could not be imported " ) } } ) ) } } ) } ( ) , window . ArangoReplication = Backbone . Collection . extend ( { model : window . Replication , url : " . . / api / user " , getLogState : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / replication / logger - state " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , getApplyState : function ( a ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / replication / applier - state " ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } } ) , window . StatisticsCollection = Backbone . Collection . extend ( { model : window . Statistics , url : " / _admin / statistics " } ) , window . StatisticsDescriptionCollection = Backbone . Collection . extend ( { model : window . StatisticsDescription , url : " / _admin / statistics - description " , parse : function ( a ) { return a } } ) , window . ArangoUsers = Backbone . Collection . extend ( { model : window . Users , activeUser : null , activeUserSettings : { query : { } , shell : { } , testing : ! 0 } , sortOptions : { desc : ! 1 } , url : frontendConfig . basePath + " / _api / user " , comparator : function ( a , b ) { var c = a . get ( " user " ) . toLowerCase ( ) , d = b . get ( " user " ) . toLowerCase ( ) ; return this . sortOptions . desc = = = ! 0 ? d > c ? 1 : c > d ? - 1 : 0 : c > d ? 1 : d > c ? - 1 : 0 } , login : function ( a , b , c ) { var d = this ; $ . ajax ( " login " , { method : " POST " , data : JSON . stringify ( { username : a , password : b } ) , dataType : " json " } ) . success ( function ( a ) { d . activeUser = a . user , c ( ! 1 , d . activeUser ) } ) . error ( function ( ) { d . activeUser = null , c ( ! 0 , null ) } ) } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , logout : function ( ) { $ . ajax ( " logout " , { method : " POST " } ) , this . activeUser = null , this . reset ( ) , window . App . navigate ( " " ) , window . location . reload ( ) } , setUserSettings : function ( a , b ) { this . activeUserSettings . identifier = b } , loadUserSettings : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : frontendConfig . basePath + " / _api / user / " + encodeURIComponent ( b . activeUser ) , contentType : " application / json " , processData : ! 1 , success : function ( c ) { b . activeUserSettings = c . extra , a ( ! 1 , c ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , saveUserSettings : function ( a ) { var b = this ; $ . ajax ( { cache : ! 1 , type : " PUT " , url : frontendConfig . basePath + " / _api / user / " + encodeURIComponent ( b . activeUser ) , data : JSON . stringify ( { extra : b . activeUserSettings } ) , contentType : " application / json " , processData : ! 1 , success : function ( b ) { a ( ! 1 , b ) } , error : function ( b ) { a ( ! 0 , b ) } } ) } , parse : function ( a ) { var b = [ ] ; return _ . each ( a . result , function ( a ) { b . push ( a ) } ) , b } , whoAmI : function ( a ) { return this . activeUser ? void a ( ! 1 , this . activeUser ) : void $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a ( ! 1 , b . user ) } ) . error ( function ( b ) { a ( ! 0 , null ) } ) } } ) , function ( ) { " use strict " ; window . ClusterCoordinators = window . AutomaticRetryCollection . extend ( { model : window . ClusterCoordinator , url : arangoHelper . databaseUrl ( " / _admin / aardvark / cluster / Coordinators " ) , updateUrl : function ( ) { this . url = window . App . getNewRoute ( " Coordinators " ) } , initialize : function ( ) { } , statusClass : function ( a ) { switch ( a ) { case " ok " : return " success " ; case " warning " : return " warning " ; case " critical " : return " danger " ; case " missing " : return " inactive " ; default : return " danger " } } , getStatuses : function ( a , b ) { if ( this . checkRetries ( ) ) { var c = this ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : c . failureTry . bind ( c , c . getStatuses . bind ( c , a , b ) ) } ) . done ( function ( ) { c . successFullTry ( ) , c . forEach ( function ( b ) { a ( c . statusClass ( b . get ( " status " ) ) , b . get ( " address " ) ) } ) , b ( ) } ) } } , byAddress : function ( a , b ) { if ( this . checkRetries ( ) ) { var c = this ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : c . failureTry . bind ( c , c . byAddress . bind ( c , a , b ) ) } ) . done ( function ( ) { c . successFullTry ( ) , a = a | | { } , c . forEach ( function ( b ) { var c = b . get ( " address " ) ; c = c . split ( " : " ) [ 0 ] , a [ c ] = a [ c ] | | { } , a [ c ] . coords = a [ c ] . coords | | [ ] , a [ c ] . coords . push ( b ) } ) , b ( a ) } ) } } , checkConnection : function ( a ) { var b = this ; this . checkRetries ( ) & & this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : b . failureTry . bind ( b , b . checkConnection . bind ( b , a ) ) } ) . done ( function ( ) { b . successFullTry ( ) , a ( ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . ClusterServers = window . AutomaticRetryCollection . extend ( { model : window . ClusterServer , host : " " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / cluster / DBServers " ) , updateUrl : function ( ) { this . url = window . App . getNewRoute ( this . host ) + this . url } , initialize : function ( a , b ) { this . host = b . host } , statusClass : function ( a ) { switch ( a ) { case " ok " : return " success " ; case " warning " : return " warning " ; case " critical " : return " danger " ; case " missing " : return " inactive " ; default : return " danger " } } , getStatuses : function ( a ) { if ( this . checkRetries ( ) ) { var b = this , c = function ( ) { b . successFullTry ( ) , b . _retryCount = 0 , b . forEach ( function ( c ) { a ( b . statusClass ( c . get ( " status " ) ) , c . get ( " address " ) ) } ) } ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : b . failureTry . bind ( b , b . getStatuses . bind ( b , a ) ) } ) . done ( c ) } } , byAddress : function ( a , b ) { if ( this . checkRetries ( ) ) { var c = this ; this . fetch ( { beforeSend : window . App . addAuth . bind ( window . App ) , error : c . failureTry . bind ( c , c . byAddress . bind ( c , a , b ) ) } ) . done ( function ( ) { c . successFullTry ( ) , a = a | | { } , c . forEach ( function ( b ) { var c = b . get ( " address " ) ; c = c . split ( " : " ) [ 0 ] , a [ c ] = a [ c ] | | { } , a [ c ] . dbs = a [ c ] . dbs | | [ ] , a [ c ] . dbs . push ( b ) } ) , b ( a ) } ) . error ( function ( a ) { console . log ( " error " ) , console . log ( a ) } ) } } , getList : function ( ) { throw " Do not use " } , getOverview : function ( ) { throw " Do not use DbServer . getOverview " } } ) } ( ) , function ( ) { " use strict " ; window . CoordinatorCollection = Backbone . Collection . extend ( { model : window . Coordinator , url : arangoHelper . databaseUrl ( " / _admin / aardvark / cluster / Coordinators " ) } ) } ( ) , function ( ) { " use strict " ; window . FoxxCollection = Backbone . Collection . extend ( { model : window . Foxx , sortOptions : { desc : ! 1 } , url : arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes " ) , comparator : function ( a , b ) { var c , d ; return this . sortOptions . desc = = = ! 0 ? ( c = a . get ( " mount " ) , d = b . get ( " mount " ) , d > c ? 1 : c > d ? - 1 : 0 ) : ( c = a . get ( " mount " ) , d = b . get ( " mount " ) , c > d ? 1 : d > c ? - 1 : 0 ) } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , installFromGithub : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / git ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } , installFromStore : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / store ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } , installFromZip : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / zip ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( { zipFile : a } ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } , generate : function ( a , b , c , d ) { var e = arangoHelper . databaseUrl ( " / _admin / aardvark / foxxes / generate ? mount = " + encodeURIComponent ( b ) ) ; void 0 ! = = d & & ( e + = d ? " & replace = true " : " & upgrade = true " ) , $ . ajax ( { cache : ! 1 , type : " PUT " , url : e , data : JSON . stringify ( a ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c ( a ) } , error : function ( a ) { c ( a ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . GraphCollection = Backbone . Collection . extend ( { model : window . Graph , sortOptions : { desc : ! 1 } , url : frontendConfig . basePath + " / _api / gharial " , dropAndDeleteGraph : function ( a , b ) { $ . ajax ( { type : " DELETE " , url : frontendConfig . basePath + " / _api / gharial / " + encodeURIComponent ( a ) + " ? dropCollections = true " , contentType : " application / json " , processData : ! 0 , success : function ( ) { b ( ! 0 ) } , error : function ( ) { b ( ! 1 ) } } ) } , comparator : function ( a , b ) { var c = a . get ( " _key " ) | | " " , d = b . get ( " _key " ) | | " " ; return c = c . toLowerCase ( ) , d = d . toLowerCase ( ) , this . sortOptions . desc = = = ! 0 ? d > c ? 1 : c > d ? - 1 : 0 : c > d ? 1 : d > c ? - 1 : 0 } , setSortingDesc : function ( a ) { this . sortOptions . desc = a } , parse : function ( a ) { return a . error ? void 0 : a . graphs } } ) } ( ) , function ( ) { " use strict " ; window . NotificationCollection = Backbone . Collection . extend ( { model : window . Notification , url : " " } ) } ( ) , function ( ) { " use strict " ; window . QueryManagementActive = Backbone . Collection . extend ( { model : window . queryManagementModel , url : function ( ) { return frontendConfig . basePath + " / _api / query / current " } , killRunningQuery : function ( a , b ) { $ . ajax ( { url : frontendConfig . basePath + " / _api / query / " + encodeURIComponent ( a ) , type : " DELETE " , success : function ( a ) { b ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . QueryManagementSlow = Backbone . Collection . extend ( { model : window . queryManagementModel , url : " / _api / query / slow " , deleteSlowQueryHistory : function ( a ) { var b = this ; $ . ajax ( { url : b . url , type : " DELETE " , success : function ( b ) { a ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . WorkMonitorCollection = Backbone . Collection . extend ( { model : window . workMonitorModel , url : " / _admin / work - monitor " , parse : function ( a ) { return a . work } } ) } ( ) , function ( ) { " use strict " ; window . PaginationView = Backbone . View . extend ( { <nl> + collection : null , paginationDiv : " " , idPrefix : " " , rerender : function ( ) { } , jumpTo : function ( a ) { this . collection . setPage ( a ) , this . rerender ( ) } , firstPage : function ( ) { this . jumpTo ( 1 ) } , lastPage : function ( ) { this . jumpTo ( this . collection . getLastPageNumber ( ) ) } , firstDocuments : function ( ) { this . jumpTo ( 1 ) } , lastDocuments : function ( ) { this . jumpTo ( this . collection . getLastPageNumber ( ) ) } , prevDocuments : function ( ) { this . jumpTo ( this . collection . getPage ( ) - 1 ) } , nextDocuments : function ( ) { this . jumpTo ( this . collection . getPage ( ) + 1 ) } , renderPagination : function ( ) { $ ( this . paginationDiv ) . html ( " " ) ; var a = this , b = this . collection . getPage ( ) , c = this . collection . getLastPageNumber ( ) , d = $ ( this . paginationDiv ) , e = { page : b , lastPage : c , click : function ( b ) { var c = window . location . hash . split ( " / " ) ; " documents " = = = c [ 2 ] ? ( e . page = b , window . location . hash = c [ 0 ] + " / " + c [ 1 ] + " / " + c [ 2 ] + " / " + b ) : ( a . jumpTo ( b ) , e . page = b ) } } ; d . html ( " " ) , d . pagination ( e ) , $ ( this . paginationDiv ) . prepend ( ' < ul class = " pre - pagi " > < li > < a id = " ' + this . idPrefix + ' _first " class = " pagination - button " > < span > < i class = " fa fa - angle - double - left " / > < / span > < / a > < / li > < / ul > ' ) , $ ( this . paginationDiv ) . append ( ' < ul class = " las - pagi " > < li > < a id = " ' + this . idPrefix + ' _last " class = " pagination - button " > < span > < i class = " fa fa - angle - double - right " / > < / span > < / a > < / li > < / ul > ' ) } } ) } ( ) , function ( ) { " use strict " ; window . ApplicationDetailView = Backbone . View . extend ( { el : " # content " , divs : [ " # readme " , " # swagger " , " # app - info " , " # sideinformation " , " # information " , " # settings " ] , navs : [ " # service - info " , " # service - api " , " # service - readme " , " # service - settings " ] , template : templateEngine . createTemplate ( " applicationDetailView . ejs " ) , events : { " click . open " : " openApp " , " click . delete " : " deleteApp " , " click # app - deps " : " showDepsDialog " , " click # app - switch - mode " : " toggleDevelopment " , " click # app - scripts [ data - script ] " : " runScript " , " click # app - tests " : " runTests " , " click # app - replace " : " replaceApp " , " click # download - app " : " downloadApp " , " click . subMenuEntries li " : " changeSubview " , " mouseenter # app - scripts " : " showDropdown " , " mouseleave # app - scripts " : " hideDropdown " } , changeSubview : function ( a ) { _ . each ( this . navs , function ( a ) { $ ( a ) . removeClass ( " active " ) } ) , $ ( a . currentTarget ) . addClass ( " active " ) , _ . each ( this . divs , function ( a ) { $ ( " . headerButtonBar " ) . hide ( ) , $ ( a ) . hide ( ) } ) , " service - readme " = = = a . currentTarget . id ? $ ( " # readme " ) . show ( ) : " service - api " = = = a . currentTarget . id ? $ ( " # swagger " ) . show ( ) : " service - info " = = = a . currentTarget . id ? ( this . render ( ) , $ ( " # information " ) . show ( ) , $ ( " # sideinformation " ) . show ( ) ) : " service - settings " = = = a . currentTarget . id & & ( this . showConfigDialog ( ) , $ ( " . headerButtonBar " ) . show ( ) , $ ( " # settings " ) . show ( ) ) } , downloadApp : function ( ) { this . model . isSystem ( ) | | this . model . download ( ) } , replaceApp : function ( ) { var a = this . model . get ( " mount " ) ; window . foxxInstallView . upgrade ( a , function ( ) { window . App . applicationDetail ( encodeURIComponent ( a ) ) } ) , $ ( " . createModalDialog . arangoHeader " ) . html ( " Replace Service " ) , $ ( " # infoTab " ) . click ( ) } , updateConfig : function ( ) { this . model . getConfiguration ( function ( ) { $ ( " # app - warning " ) [ this . model . needsAttention ( ) ? " show " : " hide " ] ( ) , $ ( " # app - warning - config " ) [ this . model . needsConfiguration ( ) ? " show " : " hide " ] ( ) , this . model . needsConfiguration ( ) ? $ ( " # app - config " ) . addClass ( " error " ) : $ ( " # app - config " ) . removeClass ( " error " ) } . bind ( this ) ) } , updateDeps : function ( ) { this . model . getDependencies ( function ( ) { $ ( " # app - warning " ) [ this . model . needsAttention ( ) ? " show " : " hide " ] ( ) , $ ( " # app - warning - deps " ) [ this . model . hasUnconfiguredDependencies ( ) ? " show " : " hide " ] ( ) , this . model . hasUnconfiguredDependencies ( ) ? $ ( " # app - deps " ) . addClass ( " error " ) : $ ( " # app - deps " ) . removeClass ( " error " ) } . bind ( this ) ) } , toggleDevelopment : function ( ) { this . model . toggleDevelopment ( ! this . model . isDevelopment ( ) , function ( ) { this . model . isDevelopment ( ) ? ( $ ( " . app - switch - mode " ) . text ( " Set Production " ) , $ ( " # app - development - indicator " ) . css ( " display " , " inline " ) , $ ( " # app - development - path " ) . css ( " display " , " inline " ) ) : ( $ ( " . app - switch - mode " ) . text ( " Set Development " ) , $ ( " # app - development - indicator " ) . css ( " display " , " none " ) , $ ( " # app - development - path " ) . css ( " display " , " none " ) ) } . bind ( this ) ) } , runScript : function ( a ) { a . preventDefault ( ) ; var b = $ ( a . currentTarget ) . attr ( " data - script " ) , c = [ window . modalView . createBlobEntry ( " app_script_arguments " , " Script arguments " , " " , null , " optional " , ! 1 , [ { rule : function ( a ) { return a & & JSON . parse ( a ) } , msg : " Must be well - formed JSON or empty " } ] ) ] , d = [ window . modalView . createSuccessButton ( " Run script " , function ( ) { var a = $ ( " # app_script_arguments " ) . val ( ) ; a = a & & JSON . parse ( a ) , window . modalView . hide ( ) , this . model . runScript ( b , a , function ( a , c ) { var d ; d = a ? " < p > The script failed with an error " + ( a . statusCode ? " ( HTTP " + a . statusCode + " ) " : " " ) + " : < / p > < pre > " + a . message + " < / pre > " : c ? " < p > Script results : < / p > < pre > " + JSON . stringify ( c , null , 2 ) + " < / pre > " : " < p > The script ran successfully . < / p > " , window . modalView . show ( " modalTable . ejs " , ' Result of script " ' + b + ' " ' , void 0 , void 0 , void 0 , d ) } ) } . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , ' Run script " ' + b + ' " on " ' + this . model . get ( " mount " ) + ' " ' , d , c ) } , showSwagger : function ( a ) { a . preventDefault ( ) , this . render ( " swagger " ) } , showReadme : function ( a ) { a . preventDefault ( ) , this . render ( " readme " ) } , runTests : function ( a ) { a . preventDefault ( ) ; var b = " < p > < strong > WARNING : < / strong > Running tests may result in destructive side - effects including data loss . Please make sure not to run tests on a production database . < / p > " ; this . model . isDevelopment ( ) & & ( b + = " < p > < strong > WARNING : < / strong > This app is running in < strong > development mode < / strong > . If any of the tests access the app ' s HTTP API they may become non - deterministic . < / p > " ) ; var c = [ window . modalView . createSuccessButton ( " Run tests " , function ( ) { window . modalView . hide ( ) , this . model . runTests ( { reporter : " suite " } , function ( a , b ) { window . modalView . show ( " modalTestResults . ejs " , " Test results " , void 0 , void 0 , void 0 , a | | b ) } ) } . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , ' Run tests for app " ' + this . model . get ( " mount " ) + ' " ' , c , void 0 , void 0 , b ) } , render : function ( a ) { var b = function ( b , c ) { var d = this ; b ? arangoHelper . arangoError ( " DB " , " Could not get current database " ) : ( $ ( this . el ) . html ( this . template . render ( { app : this . model , db : c , mode : a } ) ) , $ . get ( this . appUrl ( c ) ) . success ( function ( ) { $ ( " . open " , this . el ) . prop ( " disabled " , ! 1 ) } . bind ( this ) ) , this . updateConfig ( ) , this . updateDeps ( ) , " swagger " = = = a & & $ . get ( " . / foxxes / docs / swagger . json ? mount = " + encodeURIComponent ( this . model . get ( " mount " ) ) , function ( a ) { Object . keys ( a . paths ) . length < 1 & & ( d . render ( " readme " ) , $ ( " # app - show - swagger " ) . attr ( " disabled " , " true " ) ) } ) ) , this . breadcrumb ( ) } . bind ( this ) ; return arangoHelper . currentDatabase ( b ) , _ . isEmpty ( this . model . get ( " config " ) ) & & $ ( " # service - settings " ) . attr ( " disabled " , ! 0 ) , $ ( this . el ) } , breadcrumb : function ( ) { var a = " Service : " + this . model . get ( " name " ) + ' < i class = " fa fa - ellipsis - v " aria - hidden = " true " > < / i > ' , b = ' < p class = " mount " > < span > Contributors : < / span > ' ; this . model . get ( " contributors " ) & & this . model . get ( " contributors " ) . length > 0 ? _ . each ( this . model . get ( " contributors " ) , function ( a ) { b + = ' < a href = " mailto : ' + a . email + ' " > ' + a . name + " < / a > " } ) : b + = " No contributors " , b + = " < / p > " , $ ( " . information " ) . append ( b ) , this . model . get ( " author " ) & & $ ( " . information " ) . append ( ' < p class = " mount " > < span > Author : < / span > ' + this . model . get ( " author " ) + " < / p > " ) , this . model . get ( " mount " ) & & $ ( " . information " ) . append ( ' < p class = " mount " > < span > Mount : < / span > ' + this . model . get ( " mount " ) + " < / p > " ) , this . model . get ( " development " ) & & this . model . get ( " path " ) & & $ ( " . information " ) . append ( ' < p class = " path " > < span > Path : < / span > ' + this . model . get ( " path " ) + " < / p > " ) , $ ( " # subNavigationBar . breadcrumb " ) . html ( a ) } , openApp : function ( ) { var a = function ( a , b ) { a ? arangoHelper . arangoError ( " DB " , " Could not get current database " ) : window . open ( this . appUrl ( b ) , this . model . get ( " title " ) ) . focus ( ) } . bind ( this ) ; arangoHelper . currentDatabase ( a ) } , deleteApp : function ( ) { var a = [ window . modalView . createDeleteButton ( " Delete " , function ( ) { var a = { teardown : $ ( " # app_delete_run_teardown " ) . is ( " : checked " ) } ; this . model . destroy ( a , function ( a , b ) { a | | b . error ! = = ! 1 | | ( window . modalView . hide ( ) , window . App . navigate ( " services " , { trigger : ! 0 } ) ) } ) } . bind ( this ) ) ] , b = [ window . modalView . createCheckboxEntry ( " app_delete_run_teardown " , " Run teardown ? " , ! 0 , " Should this app ' s teardown script be executed before removing the app ? " , ! 0 ) ] ; window . modalView . show ( " modalTable . ejs " , ' Delete Foxx App mounted at " ' + this . model . get ( " mount " ) + ' " ' , a , b , void 0 , " < p > Are you sure ? There is no way back . . . < / p > " , ! 0 ) } , appUrl : function ( a ) { return window . location . origin + " / _db / " + encodeURIComponent ( a ) + this . model . get ( " mount " ) } , applyConfig : function ( ) { var a = { } ; _ . each ( this . model . get ( " config " ) , function ( b , c ) { var d = $ ( " # app_config_ " + c ) , e = d . val ( ) ; if ( " boolean " = = = b . type | | " bool " = = = b . type ) return void ( a [ c ] = d . is ( " : checked " ) ) ; if ( " " = = = e & & b . hasOwnProperty ( " default " ) ) return a [ c ] = b [ " default " ] , void ( " json " = = = b . type & & ( a [ c ] = JSON . stringify ( b [ " default " ] ) ) ) ; if ( " number " = = = b . type ) a [ c ] = parseFloat ( e ) ; else if ( " integer " = = = b . type | | " int " = = = b . type ) a [ c ] = parseInt ( e , 10 ) ; else { if ( " json " ! = = b . type ) return void ( a [ c ] = window . arangoHelper . escapeHtml ( e ) ) ; a [ c ] = e & & JSON . stringify ( JSON . parse ( e ) ) } } ) , this . model . setConfiguration ( a , function ( ) { this . updateConfig ( ) , arangoHelper . arangoNotification ( this . model . get ( " name " ) , " Settings applied . " ) } . bind ( this ) ) } , showConfigDialog : function ( ) { if ( _ . isEmpty ( this . model . get ( " config " ) ) ) return void $ ( " # settings . buttons " ) . html ( $ ( " # hidden_buttons " ) . html ( ) ) ; var a = _ . map ( this . model . get ( " config " ) , function ( a , b ) { var c = void 0 = = = a [ " default " ] ? " " : String ( a [ " default " ] ) , d = void 0 = = = a . current ? " " : String ( a . current ) , e = " createTextEntry " , f = ! 1 , g = [ ] ; return " boolean " = = = a . type | | " bool " = = = a . type ? ( e = " createCheckboxEntry " , a [ " default " ] = a [ " default " ] | | ! 1 , c = a [ " default " ] | | ! 1 , d = a . current | | ! 1 ) : " json " = = = a . type ? ( e = " createBlobEntry " , c = void 0 = = = a [ " default " ] ? " " : JSON . stringify ( a [ " default " ] ) , d = void 0 = = = a . current ? " " : a . current , g . push ( { rule : function ( a ) { return a & & JSON . parse ( a ) } , msg : " Must be well - formed JSON or empty . " } ) ) : " integer " = = = a . type | | " int " = = = a . type ? g . push ( { rule : Joi . number ( ) . integer ( ) . optional ( ) . allow ( " " ) , msg : " Has to be an integer . " } ) : " number " = = = a . type ? g . push ( { rule : Joi . number ( ) . optional ( ) . allow ( " " ) , msg : " Has to be a number . " } ) : ( " password " = = = a . type & & ( e = " createPasswordEntry " ) , g . push ( { rule : Joi . string ( ) . optional ( ) . allow ( " " ) , msg : " Has to be a string . " } ) ) , void 0 = = = a [ " default " ] & & a . required ! = = ! 1 & & ( f = ! 0 , g . unshift ( { rule : Joi . any ( ) . required ( ) , msg : " This field is required . " } ) ) , window . modalView [ e ] ( " app_config_ " + b , b , d , a . description , c , f , g ) } ) , b = [ window . modalView . createSuccessButton ( " Apply " , this . applyConfig . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , " Configuration " , b , a , null , null , null , null , null , " settings " ) , $ ( " . modal - footer " ) . prepend ( $ ( " # hidden_buttons " ) . html ( ) ) } , applyDeps : function ( ) { var a = { } ; _ . each ( this . model . get ( " deps " ) , function ( b , c ) { var d = $ ( " # app_deps_ " + c ) ; a [ c ] = window . arangoHelper . escapeHtml ( d . val ( ) ) } ) , this . model . setDependencies ( a , function ( ) { window . modalView . hide ( ) , this . updateDeps ( ) } . bind ( this ) ) } , showDepsDialog : function ( ) { if ( ! _ . isEmpty ( this . model . get ( " deps " ) ) ) { var a = _ . map ( this . model . get ( " deps " ) , function ( a , b ) { var c = void 0 = = = a . current ? " " : String ( a . current ) , d = " " , e = a . definition . name ; " * " ! = = a . definition . version & & ( e + = " @ " + a . definition . version ) ; var f = [ { rule : Joi . string ( ) . optional ( ) . allow ( " " ) , msg : " Has to be a string . " } ] ; return a . definition . required & & f . push ( { rule : Joi . string ( ) . required ( ) , msg : " This value is required . " } ) , window . modalView . createTextEntry ( " app_deps_ " + b , a . title , c , e , d , a . definition . required , f ) } ) , b = [ window . modalView . createSuccessButton ( " Apply " , this . applyDeps . bind ( this ) ) ] ; window . modalView . show ( " modalTable . ejs " , " Dependencies " , b , a ) } } , showDropdown : function ( ) { _ . isEmpty ( this . model . get ( " scripts " ) ) | | $ ( " # scripts_dropdown " ) . show ( 200 ) } , hideDropdown : function ( ) { $ ( " # scripts_dropdown " ) . hide ( ) } } ) } ( ) , function ( ) { " use strict " ; window . ApplicationsView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " applicationsView . ejs " ) , events : { " click # addApp " : " createInstallModal " , " click # foxxToggle " : " slideToggle " , " click # checkDevel " : " toggleDevel " , " click # checkProduction " : " toggleProduction " , " click # checkSystem " : " toggleSystem " } , fixCheckboxes : function ( ) { this . _showDevel ? $ ( " # checkDevel " ) . attr ( " checked " , " checked " ) : $ ( " # checkDevel " ) . removeAttr ( " checked " ) , this . _showSystem ? $ ( " # checkSystem " ) . attr ( " checked " , " checked " ) : $ ( " # checkSystem " ) . removeAttr ( " checked " ) , this . _showProd ? $ ( " # checkProduction " ) . attr ( " checked " , " checked " ) : $ ( " # checkProduction " ) . removeAttr ( " checked " ) , $ ( " # checkDevel " ) . next ( ) . removeClass ( " fa fa - check - square - o fa - square - o " ) . addClass ( " fa " ) , $ ( " # checkSystem " ) . next ( ) . removeClass ( " fa fa - check - square - o fa - square - o " ) . addClass ( " fa " ) , $ ( " # checkProduction " ) . next ( ) . removeClass ( " fa fa - check - square - o fa - square - o " ) . addClass ( " fa " ) , arangoHelper . setCheckboxStatus ( " # foxxDropdown " ) } , toggleDevel : function ( ) { var a = this ; this . _showDevel = ! this . _showDevel , _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " devel " , a . _showDevel ) } ) , this . fixCheckboxes ( ) } , toggleProduction : function ( ) { var a = this ; this . _showProd = ! this . _showProd , _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " production " , a . _showProd ) } ) , this . fixCheckboxes ( ) } , toggleSystem : function ( ) { this . _showSystem = ! this . _showSystem ; var a = this ; _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " system " , a . _showSystem ) } ) , this . fixCheckboxes ( ) } , reload : function ( ) { var a = this ; _ . each ( this . _installedSubViews , function ( a ) { a . undelegateEvents ( ) } ) , this . collection . fetch ( { success : function ( ) { a . createSubViews ( ) , a . render ( ) } } ) } , createSubViews : function ( ) { var a = this ; this . _installedSubViews = { } , a . collection . each ( function ( b ) { var c = new window . FoxxActiveView ( { model : b , appsView : a } ) ; a . _installedSubViews [ b . get ( " mount " ) ] = c } ) } , initialize : function ( ) { this . _installedSubViews = { } , this . _showDevel = ! 0 , this . _showProd = ! 0 , this . _showSystem = ! 1 } , slideToggle : function ( ) { $ ( " # foxxToggle " ) . toggleClass ( " activated " ) , $ ( " # foxxDropdownOut " ) . slideToggle ( 200 ) } , createInstallModal : function ( a ) { a . preventDefault ( ) , window . foxxInstallView . install ( this . reload . bind ( this ) ) } , render : function ( ) { this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { } ) ) , _ . each ( this . _installedSubViews , function ( a ) { $ ( " # installedList " ) . append ( a . render ( ) ) } ) , this . delegateEvents ( ) , $ ( " # checkDevel " ) . attr ( " checked " , this . _showDevel ) , $ ( " # checkProduction " ) . attr ( " checked " , this . _showProd ) , $ ( " # checkSystem " ) . attr ( " checked " , this . _showSystem ) , arangoHelper . setCheckboxStatus ( " # foxxDropdown " ) ; var a = this ; return _ . each ( this . _installedSubViews , function ( b ) { b . toggle ( " devel " , a . _showDevel ) , b . toggle ( " system " , a . _showSystem ) } ) , arangoHelper . fixTooltips ( " icon_arangodb " , " left " ) , this } } ) } ( ) , function ( ) { " use strict " ; window . ClusterView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " clusterView . ejs " ) , events : { } , statsEnabled : ! 1 , historyInit : ! 1 , initDone : ! 1 , interval : 5e3 , maxValues : 100 , knownServers : [ ] , chartData : { } , charts : { } , nvcharts : [ ] , startHistory : { } , startHistoryAccumulated : { } , initialize : function ( a ) { var b = this ; window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , window . setInterval ( function ( ) { if ( " # cluster " = = = window . location . hash | | " " = = = window . location . hash | | " # " = = = window . location . hash ) { var a = function ( a ) { b . rerenderValues ( a ) , b . rerenderGraphs ( a ) } ; b . getCoordStatHistory ( a ) } } , this . interval ) ) } , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) , this . initDone | | ( void 0 ! = = this . coordinators . first ( ) ? this . getServerStatistics ( ) : this . waitForCoordinators ( ) , this . initDone = ! 0 ) , this . initGraphs ( ) } , waitForCoordinators : function ( ) { var a = this ; window . setTimeout ( function ( ) { a . coordinators ? a . getServerStatistics ( ) : a . waitForCoordinators ( ) } , 500 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } , getServerStatistics : function ( ) { var a = this ; this . data = void 0 ; var b = this . coordinators . first ( ) ; this . statCollectCoord = new window . ClusterStatisticsCollection ( [ ] , { host : b . get ( " address " ) } ) , this . statCollectDBS = new window . ClusterStatisticsCollection ( [ ] , { host : b . get ( " address " ) } ) ; var c = [ ] ; _ . each ( this . dbServers , function ( a ) { a . each ( function ( a ) { c . push ( a ) } ) } ) , _ . each ( c , function ( c ) { if ( " ok " = = = c . get ( " status " ) ) { - 1 = = = a . knownServers . indexOf ( c . id ) & & a . knownServers . push ( c . id ) ; var d = new window . Statistics ( { name : c . id } ) ; d . url = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) + " / _admin / clusterStatistics ? DBserver = " + c . get ( " name " ) , a . statCollectDBS . add ( d ) } } ) , this . coordinators . forEach ( function ( b ) { if ( " ok " = = = b . get ( " status " ) ) { - 1 = = = a . knownServers . indexOf ( b . id ) & & a . knownServers . push ( b . id ) ; var c = new window . Statistics ( { name : b . id } ) ; c . url = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) + " / _admin / statistics " , a . statCollectCoord . add ( c ) } } ) ; var d = function ( b ) { a . rerenderValues ( b ) , a . rerenderGraphs ( b ) } . bind ( this ) ; a . getCoordStatHistory ( d ) , a . coordinators . fetch ( { success : function ( ) { a . renderNode ( ! 0 ) } , error : function ( ) { a . renderNode ( ! 1 ) } } ) } , rerenderValues : function ( a ) { var b = this ; this . coordinators . fetch ( { success : function ( ) { b . renderNode ( ! 0 ) } , error : function ( ) { b . renderNode ( ! 1 ) } } ) , this . renderValue ( " # clusterConnections " , Math . round ( a . clientConnectionsCurrent ) ) , this . renderValue ( " # clusterConnectionsAvg " , Math . round ( a . clientConnections15M ) ) ; var c = a . physicalMemory , d = a . residentSizeCurrent ; this . renderValue ( " # clusterRam " , [ d , c ] ) } , renderValue : function ( a , b , c ) { if ( " number " = = typeof b ) $ ( a ) . html ( b ) ; else if ( $ . isArray ( b ) ) { var d = b [ 0 ] , e = b [ 1 ] , f = 1 / ( e / d ) * 100 ; $ ( a ) . html ( f . toFixed ( 1 ) + " % " ) } else " string " = = typeof b & & $ ( a ) . html ( b ) ; c ? ( $ ( a ) . addClass ( " negative " ) , $ ( a ) . removeClass ( " positive " ) ) : ( $ ( a ) . addClass ( " positive " ) , $ ( a ) . removeClass ( " negative " ) ) } , renderNode : function ( a ) { var b = 0 , c = 0 ; if ( a ) if ( this . coordinators . each ( function ( a ) { " ok " = = = a . toJSON ( ) . status ? b + + : c + + } ) , c > 0 ) { var d = c + b ; this . renderValue ( " # clusterNodes " , b + " / " + d , ! 0 ) } else this . renderValue ( " # clusterNodes " , b ) ; else this . renderValue ( " # clusterNodes " , " OFFLINE " , ! 0 ) } , initValues : function ( ) { var a = [ " # clusterNodes " , " # clusterRam " , " # clusterConnections " , " # clusterConnectionsAvg " ] ; _ . each ( a , function ( a ) { $ ( a ) . html ( ' < i class = " fa fa - spin fa - circle - o - notch " style = " color : rgba ( 0 , 0 , 0 , 0 . 64 ) ; " > < / i > ' ) } ) } , graphData : { data : { sent : [ ] , received : [ ] } , http : [ ] , average : [ ] } , checkArraySizes : function ( ) { var a = this ; _ . each ( a . chartsOptions , function ( b , c ) { _ . each ( b . options , function ( b , d ) { b . values . length > a . maxValues - 1 & & a . chartsOptions [ c ] . options [ d ] . values . shift ( ) } ) } ) } , formatDataForGraph : function ( a ) { var b = this ; b . historyInit ? ( b . checkArraySizes ( ) , b . chartsOptions [ 0 ] . options [ 0 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : a . bytesSentPerSecond [ a . bytesSentPerSecond . length - 1 ] } ) , b . chartsOptions [ 0 ] . options [ 1 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : a . bytesReceivedPerSecond [ a . bytesReceivedPerSecond . length - 1 ] } ) , b . chartsOptions [ 1 ] . options [ 0 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : b . calcTotalHttp ( a . http , a . bytesSentPerSecond . length - 1 ) } ) , b . chartsOptions [ 2 ] . options [ 0 ] . values . push ( { x : a . times [ a . times . length - 1 ] , y : a . avgRequestTime [ a . bytesSentPerSecond . length - 1 ] / b . coordinators . length } ) ) : ( _ . each ( a . times , function ( c , d ) { b . chartsOptions [ 0 ] . options [ 0 ] . values . push ( { x : c , y : a . bytesSentPerSecond [ d ] } ) , b . chartsOptions [ 0 ] . options [ 1 ] . values . push ( { x : c , y : a . bytesReceivedPerSecond [ d ] } ) , b . chartsOptions [ 1 ] . options [ 0 ] . values . push ( { x : c , y : b . calcTotalHttp ( a . http , d ) } ) , b . chartsOptions [ 2 ] . options [ 0 ] . values . push ( { x : c , y : a . avgRequestTime [ d ] / b . coordinators . length } ) } ) , b . historyInit = ! 0 ) } , chartsOptions : [ { id : " # clusterData " , type : " bytes " , count : 2 , options : [ { area : ! 0 , values : [ ] , key : " Bytes out " , color : " rgb ( 23 , 190 , 207 ) " , strokeWidth : 2 , fillOpacity : . 1 } , { area : ! 0 , values : [ ] , key : " Bytes in " , color : " rgb ( 188 , 189 , 34 ) " , strokeWidth : 2 , fillOpacity : . 1 } ] } , { id : " # clusterHttp " , type : " bytes " , options : [ { area : ! 0 , values : [ ] , key : " Bytes " , color : " rgb ( 0 , 166 , 90 ) " , fillOpacity : . 1 } ] } , { id : " # clusterAverage " , data : [ ] , type : " seconds " , options : [ { area : ! 0 , values : [ ] , key : " Seconds " , color : " rgb ( 243 , 156 , 18 ) " , fillOpacity : . 1 } ] } ] , initGraphs : function ( ) { var a = this , b = " Fetching data . . . " ; a . statsEnabled = = = ! 1 & & ( b = " Statistics disabled . " ) , _ . each ( a . chartsOptions , function ( c ) { nv . addGraph ( function ( ) { a . charts [ c . id ] = nv . models . stackedAreaChart ( ) . options ( { useInteractiveGuideline : ! 0 , showControls : ! 1 , noData : b , duration : 0 } ) , a . charts [ c . id ] . xAxis . axisLabel ( " " ) . tickFormat ( function ( a ) { var b = new Date ( 1e3 * a ) ; return ( b . getHours ( ) < 10 ? " 0 " : " " ) + b . getHours ( ) + " : " + ( b . getMinutes ( ) < 10 ? " 0 " : " " ) + b . getMinutes ( ) + " : " + ( b . getSeconds ( ) < 10 ? " 0 " : " " ) + b . getSeconds ( ) } ) . staggerLabels ( ! 1 ) , a . charts [ c . id ] . yAxis . axisLabel ( " " ) . tickFormat ( function ( a ) { var b ; return " bytes " = = = c . type ? null = = = a ? " N / A " : ( b = parseFloat ( d3 . format ( " . 2f " ) ( a ) ) , prettyBytes ( b ) ) : " seconds " = = = c . type ? null = = = a ? " N / A " : b = parseFloat ( d3 . format ( " . 3f " ) ( a ) ) : void 0 } ) ; var d , e = a . returnGraphOptions ( c . id ) ; return e . length > 0 ? _ . each ( e , function ( a , b ) { c . options [ b ] . values = a } ) : c . options [ 0 ] . values = [ ] , d = c . options , a . chartData [ c . id ] = d3 . select ( c . id ) . append ( " svg " ) . datum ( d ) . transition ( ) . duration ( 300 ) . call ( a . charts [ c . id ] ) . each ( " start " , function ( ) { window . setTimeout ( function ( ) { d3 . selectAll ( c . id + " * " ) . each ( function ( ) { this . __transition__ & & ( this . __transition__ . duration = 0 ) } ) } , 0 ) } ) , nv . utils . windowResize ( a . charts [ c . id ] . update ) , a . nvcharts . push ( a . charts [ c . id ] ) , a . charts [ c . id ] } ) } ) } , returnGraphOptions : function ( a ) { var b = [ ] ; return b = " # clusterData " = = = a ? [ this . chartsOptions [ 0 ] . options [ 0 ] . values , this . chartsOptions [ 0 ] . options [ 1 ] . values ] : " # clusterHttp " = = = a ? [ this . chartsOptions [ 1 ] . options [ 0 ] . values ] : " # clusterAverage " = = = a ? [ this . chartsOptions [ 2 ] . options [ 0 ] . values ] : [ ] } , rerenderGraphs : function ( a ) { if ( this . statsEnabled ) { var b , c , d = this ; this . formatDataForGraph ( a ) , _ . each ( d . chartsOptions , function ( a ) { c = d . returnGraphOptions ( a . id ) , c . length > 0 ? _ . each ( c , function ( b , c ) { a . options [ c ] . values = b } ) : a . options [ 0 ] . values = [ ] , b = a . options , b [ 0 ] . values . length > 0 & & d . historyInit & & d . charts [ a . id ] & & d . charts [ a . id ] . update ( ) } ) } } , calcTotalHttp : function ( a , b ) { var c = 0 ; return _ . each ( a , function ( a ) { c + = a [ b ] } ) , c } , getCoordStatHistory : function ( a ) { var b , c = this , d = [ ] , e = { http : { } } , f = function ( a ) { return $ . get ( a , { count : c . statCollectCoord . size ( ) } , null , " json " ) } , g = function ( a ) { var b , d = [ " times " ] , f = [ " physicalMemory " , " residentSizeCurrent " , " clientConnections15M " , " clientConnectionsCurrent " ] , g = [ " optionsPerSecond " , " putsPerSecond " , " headsPerSecond " , " postsPerSecond " , " getsPerSecond " , " deletesPerSecond " , " othersPerSecond " , " patchesPerSecond " ] , h = [ " bytesSentPerSecond " , " bytesReceivedPerSecond " , " avgRequestTime " ] , i = 0 ; _ . each ( a , function ( a ) { a . enabled ? c . statsEnabled = ! 0 : c . statsEnabled = ! 1 , " object " = = typeof a & & ( 0 = = = i ? ( _ . each ( d , function ( b ) { e [ b ] = a [ b ] } ) , _ . each ( f , function ( b ) { e [ b ] = a [ b ] } ) , _ . each ( g , function ( b ) { e . http [ b ] = a [ b ] } ) , _ . each ( h , function ( b ) { e [ b ] = a [ b ] } ) ) : ( _ . each ( f , function ( b ) { e [ b ] = e [ b ] + a [ b ] } ) , _ . each ( g , function ( c ) { b = 0 , _ . each ( a [ c ] , function ( a ) { e . http [ c ] [ i ] = e . http [ c ] [ i ] + a , b + + } ) } ) , _ . each ( h , function ( c ) { b = 0 , _ . each ( a [ c ] , function ( a ) { e [ c ] [ i ] = e [ c ] [ i ] + a , b + + } ) } ) ) , i + + ) } ) } ; this . statCollectCoord . each ( function ( a ) { b = a . url + " / short " , d . push ( f ( b ) ) } ) , $ . when . apply ( $ , d ) . done ( function ( ) { var b = [ ] ; _ . each ( d , function ( a ) { b . push ( a . responseJSON ) } ) , g ( b ) , a ( e ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . CollectionListItemView = Backbone . View . extend ( { tagName : " div " , className : " tile pure - u - 1 - 1 pure - u - sm - 1 - 2 pure - u - md - 1 - 3 pure - u - lg - 1 - 4 pure - u - xl - 1 - 6 " , template : templateEngine . createTemplate ( " collectionsItemView . ejs " ) , initialize : function ( a ) { this . collectionsView = a . collectionsView } , events : { " click . iconSet . icon_arangodb_settings2 " : " createEditPropertiesModal " , " click . pull - left " : " noop " , " click . icon_arangodb_settings2 " : " editProperties " , " click . spanInfo " : " showProperties " , click : " selectCollection " } , render : function ( ) { return this . model . get ( " locked " ) ? ( $ ( this . el ) . addClass ( " locked " ) , $ ( this . el ) . addClass ( this . model . get ( " lockType " ) ) ) : $ ( this . el ) . removeClass ( " locked " ) , " loading " ! = = this . model . get ( " status " ) & & " unloading " ! = = this . model . get ( " status " ) | | $ ( this . el ) . addClass ( " locked " ) , $ ( this . el ) . html ( this . template . render ( { model : this . model } ) ) , $ ( this . el ) . attr ( " id " , " collection_ " + this . model . get ( " name " ) ) , this } , editProperties : function ( a ) { return this . model . get ( " locked " ) ? 0 : ( a . stopPropagation ( ) , void this . createEditPropertiesModal ( ) ) } , showProperties : function ( a ) { return this . model . get ( " locked " ) ? 0 : ( a . stopPropagation ( ) , void this . createInfoModal ( ) ) } , selectCollection : function ( a ) { return $ ( a . target ) . hasClass ( " disabled " ) ? 0 : this . model . get ( " locked " ) ? 0 : " loading " = = = this . model . get ( " status " ) ? 0 : void ( " unloaded " = = = this . model . get ( " status " ) ? this . loadCollection ( ) : window . App . navigate ( " collection / " + encodeURIComponent ( this . model . get ( " name " ) ) + " / documents / 1 " , { trigger : ! 0 } ) ) } , noop : function ( a ) { a . stopPropagation ( ) } , unloadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be unloaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " unloading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " unloaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " unloaded . " ) } . bind ( this ) ; this . model . unloadCollection ( a ) , window . modalView . hide ( ) } , loadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be loaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " loading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " loaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " loaded . " ) } . bind ( this ) ; this . model . loadCollection ( a ) , window . modalView . hide ( ) } , truncateCollection : function ( ) { this . model . truncateCollection ( ) , window . modalView . hide ( ) } , deleteCollection : function ( ) { this . model . destroy ( { error : function ( ) { arangoHelper . arangoError ( " Could not delete collection . " ) } , success : function ( ) { window . modalView . hide ( ) } } ) , this . collectionsView . render ( ) } , saveModifiedCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c ; c = b ? this . model . get ( " name " ) : $ ( " # change - collection - name " ) . val ( ) ; var d = this . model . get ( " status " ) ; if ( " loaded " = = = d ) { var e ; try { e = JSON . parse ( 1024 * $ ( " # change - collection - size " ) . val ( ) * 1024 ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } var g ; try { if ( g = JSON . parse ( $ ( " # change - index - buckets " ) . val ( ) ) , 1 > g | | parseInt ( g ) ! = = Math . pow ( 2 , Math . log2 ( g ) ) ) throw " invalid indexBuckets value " } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number of index buckets " ) , 0 } var h = function ( a ) { a ? arangoHelper . arangoError ( " Collection error : " + a . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) , i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Collection error : " + a . responseText ) ; else { var b = $ ( " # change - collection - sync " ) . val ( ) ; this . model . changeCollection ( b , e , g , h ) } } . bind ( this ) ; this . model . renameCollection ( c , i ) } else if ( " unloaded " = = = d ) if ( this . model . get ( " name " ) ! = = c ) { var j = function ( a , b ) { a ? arangoHelper . arangoError ( " Collection error : " + b . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) ; this . model . renameCollection ( c , j ) } else window . modalView . hide ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , createEditPropertiesModal : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c = ! 1 ; " loaded " = = = this . model . get ( " status " ) & & ( c = ! 0 ) ; var d = [ ] , e = [ ] ; b | | e . push ( window . modalView . createTextEntry ( " change - collection - name " , " Name " , this . model . get ( " name " ) , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) ; var f = function ( ) { e . push ( window . modalView . createReadOnlyEntry ( " change - collection - id " , " ID " , this . model . get ( " id " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - type " , " Type " , this . model . get ( " type " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - status " , " Status " , this . model . get ( " status " ) , " " ) ) , d . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteCollection . bind ( this ) ) ) , d . push ( window . modalView . createDeleteButton ( " Truncate " , this . truncateCollection . bind ( this ) ) ) , c ? d . push ( window . modalView . createNotificationButton ( " Unload " , this . unloadCollection . bind ( this ) ) ) : d . push ( window . modalView . createNotificationButton ( " Load " , this . loadCollection . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . saveModifiedCollection . bind ( this ) ) ) ; var a = [ " General " , " Indices " ] , b = [ " modalTable . ejs " , " indicesView . ejs " ] ; window . modalView . show ( b , " Modify Collection " , d , e , null , null , this . events , null , a ) , " loaded " = = = this . model . get ( " status " ) ? this . getIndex ( ) : $ ( $ ( " # infoTab " ) . children ( ) [ 1 ] ) . remove ( ) } . bind ( this ) ; if ( c ) { var g = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Collection " , " Could not fetch properties " ) ; else { var c = b . journalSize / 1048576 , d = b . indexBuckets , g = b . waitForSync ; e . push ( window . modalView . createTextEntry ( " change - collection - size " , " Journal size " , c , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , e . push ( window . modalView . createTextEntry ( " change - index - buckets " , " Index buckets " , d , " The number of index buckets for this collection . Must be at least 1 and a power of 2 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 1 - 9 ] [ 0 - 9 ] * $ / ) , msg : " Must be a number greater than 1 and a power of 2 . " } ] ) ) , e . push ( window . modalView . createSelectEntry ( " change - collection - sync " , " Wait for sync " , g , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) } f ( ) } . bind ( this ) ; this . model . getProperties ( g ) } else f ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , bindIndexEvents : function ( ) { this . unbindIndexEvents ( ) ; var a = this ; $ ( " # indexEditView # addIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) , $ ( " # cancelIndex " ) . unbind ( " click " ) , $ ( " # cancelIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) } ) , $ ( " # createIndex " ) . unbind ( " click " ) , $ ( " # createIndex " ) . bind ( " click " , function ( ) { a . createIndex ( ) } ) } ) , $ ( " # newIndexType " ) . bind ( " change " , function ( ) { a . selectIndexType ( ) } ) , $ ( " . deleteIndex " ) . bind ( " click " , function ( b ) { a . prepDeleteIndex ( b ) } ) , $ ( " # infoTab a " ) . bind ( " click " , function ( a ) { if ( $ ( " # indexDeleteModal " ) . remove ( ) , " Indices " ! = = $ ( a . currentTarget ) . html ( ) | | $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) | | ( $ ( " # newIndexView " ) . hide ( ) , $ ( " # indexEditView " ) . show ( ) , $ ( " # modal - dialog . modal - footer . button - danger " ) . hide ( ) , $ ( " # modal - dialog . modal - footer . button - success " ) . hide ( ) , $ ( " # modal - dialog . modal - footer . button - notification " ) . hide ( ) ) , " General " = = = $ ( a . currentTarget ) . html ( ) & & ! $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) ) { $ ( " # modal - dialog . modal - footer . button - danger " ) . show ( ) , $ ( " # modal - dialog . modal - footer . button - success " ) . show ( ) , $ ( " # modal - dialog . modal - footer . button - notification " ) . show ( ) ; var b = ( $ ( " . index - button - bar " ) [ 0 ] , $ ( " . index - button - bar2 " ) [ 0 ] ) ; $ ( " # cancelIndex " ) . is ( " : visible " ) & & ( $ ( " # cancelIndex " ) . detach ( ) . appendTo ( b ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( b ) ) } } ) } , unbindIndexEvents : function ( ) { $ ( " # indexEditView # addIndex " ) . unbind ( " click " ) , $ ( " # newIndexType " ) . unbind ( " change " ) , $ ( " # infoTab a " ) . unbind ( " click " ) , $ ( " . deleteIndex " ) . unbind ( " click " ) } , createInfoModal : function ( ) { var a = function ( a , b , c ) { if ( a ) arangoHelper . arangoError ( " Figures " , " Could not get revision . " ) ; else { var d = [ ] , e = { figures : c , revision : b , model : this . model } ; window . modalView . show ( " modalCollectionInfo . ejs " , " Collection : " + this . model . get ( " name " ) , d , e ) } } . bind ( this ) , b = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Figures " , " Could not get figures . " ) ; else { var d = c ; this . model . getRevision ( a , d ) } } . bind ( this ) ; this . model . getFigures ( b ) } , resetIndexForms : function ( ) { $ ( " # indexHeader input " ) . val ( " " ) . prop ( " checked " , ! 1 ) , $ ( " # newIndexType " ) . val ( " Geo " ) . prop ( " selected " , ! 0 ) , this . selectIndexType ( ) } , createIndex : function ( ) { var a , b , c , d = this , e = $ ( " # newIndexType " ) . val ( ) , f = { } ; switch ( e ) { case " Geo " : a = $ ( " # newGeoFields " ) . val ( ) ; var g = d . checkboxToValue ( " # newGeoJson " ) , h = d . checkboxToValue ( " # newGeoConstraint " ) , i = d . checkboxToValue ( " # newGeoIgnoreNull " ) ; f = { type : " geo " , fields : d . stringToArray ( a ) , geoJson : g , constraint : h , ignoreNull : i } ; break ; case " Hash " : a = $ ( " # newHashFields " ) . val ( ) , b = d . checkboxToValue ( " # newHashUnique " ) , c = d . checkboxToValue ( " # newHashSparse " ) , f = { type : " hash " , fields : d . stringToArray ( a ) , unique : b , sparse : c } ; break ; case " Fulltext " : a = $ ( " # newFulltextFields " ) . val ( ) ; var j = parseInt ( $ ( " # newFulltextMinLength " ) . val ( ) , 10 ) | | 0 ; f = { type : " fulltext " , fields : d . stringToArray ( a ) , minLength : j } ; break ; case " Skiplist " : a = $ ( " # newSkiplistFields " ) . val ( ) , b = d . checkboxToValue ( " # newSkiplistUnique " ) , c = d . checkboxToValue ( " # newSkiplistSparse " ) , f = { type : " skiplist " , fields : d . stringToArray ( a ) , unique : b , sparse : c } } var k = function ( a , b ) { if ( a ) if ( b ) { var c = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " Document error " , c . errorMessage ) } else arangoHelper . arangoError ( " Document error " , " Could not create index . " ) ; d . refreshCollectionsView ( ) } ; window . modalView . hide ( ) , d . model . createIndex ( f , k ) } , lastTarget : null , prepDeleteIndex : function ( a ) { var b = this ; this . lastTarget = a , this . lastId = $ ( this . lastTarget . currentTarget ) . parent ( ) . parent ( ) . first ( ) . children ( ) . first ( ) . text ( ) , <nl> + $ ( " # modal - dialog . modal - footer " ) . after ( ' < div id = " indexDeleteModal " style = " display : block ; " class = " alert alert - error modal - delete - confirmation " > < strong > Really delete ? < / strong > < button id = " indexConfirmDelete " class = " button - danger pull - right modal - confirm - delete " > Yes < / button > < button id = " indexAbortDelete " class = " button - neutral pull - right " > No < / button > < / div > ' ) , $ ( " # indexConfirmDelete " ) . unbind ( " click " ) , $ ( " # indexConfirmDelete " ) . bind ( " click " , function ( ) { $ ( " # indexDeleteModal " ) . remove ( ) , b . deleteIndex ( ) } ) , $ ( " # indexAbortDelete " ) . unbind ( " click " ) , $ ( " # indexAbortDelete " ) . bind ( " click " , function ( ) { $ ( " # indexDeleteModal " ) . remove ( ) } ) } , refreshCollectionsView : function ( ) { window . App . arangoCollectionsStore . fetch ( { success : function ( ) { window . App . collectionsView . render ( ) } } ) } , deleteIndex : function ( ) { var a = function ( a ) { a ? ( arangoHelper . arangoError ( " Could not delete index " ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' ) , this . model . set ( " locked " , ! 1 ) , this . refreshCollectionsView ( ) ) : a | | void 0 = = = a | | ( $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . remove ( ) , this . model . set ( " locked " , ! 1 ) , this . refreshCollectionsView ( ) ) , this . refreshCollectionsView ( ) } . bind ( this ) ; this . model . set ( " locked " , ! 0 ) , this . model . deleteIndex ( this . lastId , a ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < i class = " fa fa - circle - o - notch fa - spin " > < / i > ' ) } , selectIndexType : function ( ) { $ ( " . newIndexClass " ) . hide ( ) ; var a = $ ( " # newIndexType " ) . val ( ) ; $ ( " # newIndexType " + a ) . show ( ) } , getIndex : function ( ) { var a = function ( a , b ) { a ? window . arangoHelper . arangoError ( " Index " , b . errorMessage ) : this . renderIndex ( b ) } . bind ( this ) ; this . model . getIndex ( a ) } , renderIndex : function ( a ) { this . index = a ; var b = " collectionInfoTh modal - text " ; if ( this . index ) { var c = " " , d = " " ; _ . each ( this . index . indexes , function ( a ) { d = " primary " = = = a . type | | " edge " = = = a . type ? ' < span class = " icon_arangodb_locked " data - original - title = " No action " > < / span > ' : ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' , void 0 ! = = a . fields & & ( c = a . fields . join ( " , " ) ) ; var e = a . id . indexOf ( " / " ) , f = a . id . substr ( e + 1 , a . id . length ) , g = a . hasOwnProperty ( " selectivityEstimate " ) ? ( 100 * a . selectivityEstimate ) . toFixed ( 2 ) + " % " : " n / a " , h = a . hasOwnProperty ( " sparse " ) ? a . sparse : " n / a " ; $ ( " # collectionEditIndexTable " ) . append ( " < tr > < th class = " + JSON . stringify ( b ) + " > " + f + " < / th > < th class = " + JSON . stringify ( b ) + " > " + a . type + " < / th > < th class = " + JSON . stringify ( b ) + " > " + a . unique + " < / th > < th class = " + JSON . stringify ( b ) + " > " + h + " < / th > < th class = " + JSON . stringify ( b ) + " > " + g + " < / th > < th class = " + JSON . stringify ( b ) + " > " + c + " < / th > < th class = " + JSON . stringify ( b ) + " > " + d + " < / th > < / tr > " ) } ) } this . bindIndexEvents ( ) } , toggleNewIndexView : function ( ) { var a = $ ( " . index - button - bar2 " ) [ 0 ] ; $ ( " # indexEditView " ) . is ( " : visible " ) ? ( $ ( " # indexEditView " ) . hide ( ) , $ ( " # newIndexView " ) . show ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( " # modal - dialog . modal - footer " ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( " # modal - dialog . modal - footer " ) ) : ( $ ( " # indexEditView " ) . show ( ) , $ ( " # newIndexView " ) . hide ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( a ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( a ) ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " right " ) , this . resetIndexForms ( ) } , stringToArray : function ( a ) { var b = [ ] ; return a . split ( " , " ) . forEach ( function ( a ) { a = a . replace ( / ( ^ \ s + | \ s + $ ) / g , " " ) , " " ! = = a & & b . push ( a ) } ) , b } , checkboxToValue : function ( a ) { return $ ( a ) . prop ( " checked " ) } } ) } ( ) , function ( ) { " use strict " ; window . CollectionsView = Backbone . View . extend ( { el : " # content " , el2 : " # collectionsThumbnailsIn " , searchTimeout : null , refreshRate : 1e4 , template : templateEngine . createTemplate ( " collectionsView . ejs " ) , refetchCollections : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . checkLockedCollections ( ) } } ) } , checkLockedCollections : function ( ) { var a = function ( a , b ) { var c = this ; a ? console . log ( " Could not check locked collections " ) : ( this . collection . each ( function ( a ) { a . set ( " locked " , ! 1 ) } ) , _ . each ( b , function ( a ) { var b = c . collection . findWhere ( { id : a . collection } ) ; b . set ( " locked " , ! 0 ) , b . set ( " lockType " , a . type ) , b . set ( " desc " , a . desc ) } ) , this . collection . each ( function ( a ) { a . get ( " locked " ) | | ( $ ( " # collection_ " + a . get ( " name " ) ) . find ( " . corneredBadge " ) . removeClass ( " loaded unloaded " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . addClass ( a . get ( " status " ) ) ) , a . get ( " locked " ) | | " loading " = = = a . get ( " status " ) ? ( $ ( " # collection_ " + a . get ( " name " ) ) . addClass ( " locked " ) , a . get ( " locked " ) ? ( $ ( " # collection_ " + a . get ( " name " ) ) . find ( " . corneredBadge " ) . removeClass ( " loaded unloaded " ) , $ ( " # collection_ " + a . get ( " name " ) ) . find ( " . corneredBadge " ) . addClass ( " inProgress " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " desc " ) ) ) : $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) ) : ( $ ( " # collection_ " + a . get ( " name " ) ) . removeClass ( " locked " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . hasClass ( " inProgress " ) & & ( $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . text ( a . get ( " status " ) ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . removeClass ( " inProgress " ) , $ ( " # collection_ " + a . get ( " name " ) + " . corneredBadge " ) . addClass ( " loaded " ) ) , " unloaded " = = = a . get ( " status " ) & & $ ( " # collection_ " + a . get ( " name " ) + " . icon_arangodb_info " ) . addClass ( " disabled " ) ) } ) ) } . bind ( this ) ; window . arangoHelper . syncAndReturnUninishedAardvarkJobs ( " index " , a ) } , initialize : function ( ) { var a = this ; window . setInterval ( function ( ) { " # collections " = = = window . location . hash & & window . VISIBLE & & a . refetchCollections ( ) } , a . refreshRate ) } , render : function ( ) { this . checkLockedCollections ( ) ; var a = ! 1 ; $ ( " # collectionsDropdown " ) . is ( " : visible " ) & & ( a = ! 0 ) , $ ( this . el ) . html ( this . template . render ( { } ) ) , this . setFilterValues ( ) , a = = = ! 0 & & $ ( " # collectionsDropdown2 " ) . show ( ) ; var b = this . collection . searchOptions ; this . collection . getFiltered ( b ) . forEach ( function ( a ) { $ ( " # collectionsThumbnailsIn " , this . el ) . append ( new window . CollectionListItemView ( { model : a , collectionsView : this } ) . render ( ) . el ) } , this ) , " none " = = = $ ( " # collectionsDropdown2 " ) . css ( " display " ) ? $ ( " # collectionsToggle " ) . removeClass ( " activated " ) : $ ( " # collectionsToggle " ) . addClass ( " activated " ) ; var c ; arangoHelper . setCheckboxStatus ( " # collectionsDropdown " ) ; try { c = b . searchPhrase . length } catch ( d ) { } return $ ( " # searchInput " ) . val ( b . searchPhrase ) , $ ( " # searchInput " ) . focus ( ) , $ ( " # searchInput " ) [ 0 ] . setSelectionRange ( c , c ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " left " ) , this } , events : { " click # createCollection " : " createCollection " , " keydown # searchInput " : " restrictToSearchPhraseKey " , " change # searchInput " : " restrictToSearchPhrase " , " click # searchSubmit " : " restrictToSearchPhrase " , " click . checkSystemCollections " : " checkSystem " , " click # checkLoaded " : " checkLoaded " , " click # checkUnloaded " : " checkUnloaded " , " click # checkDocument " : " checkDocument " , " click # checkEdge " : " checkEdge " , " click # sortName " : " sortName " , " click # sortType " : " sortType " , " click # sortOrder " : " sortOrder " , " click # collectionsToggle " : " toggleView " , " click . css - label " : " checkBoxes " } , updateCollectionsView : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , toggleView : function ( ) { $ ( " # collectionsToggle " ) . toggleClass ( " activated " ) , $ ( " # collectionsDropdown2 " ) . slideToggle ( 200 ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , checkSystem : function ( ) { var a = this . collection . searchOptions , b = a . includeSystem ; a . includeSystem = $ ( " . checkSystemCollections " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeSystem & & this . render ( ) } , checkEdge : function ( ) { var a = this . collection . searchOptions , b = a . includeEdge ; a . includeEdge = $ ( " # checkEdge " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeEdge & & this . render ( ) } , checkDocument : function ( ) { var a = this . collection . searchOptions , b = a . includeDocument ; a . includeDocument = $ ( " # checkDocument " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeDocument & & this . render ( ) } , checkLoaded : function ( ) { var a = this . collection . searchOptions , b = a . includeLoaded ; a . includeLoaded = $ ( " # checkLoaded " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeLoaded & & this . render ( ) } , checkUnloaded : function ( ) { var a = this . collection . searchOptions , b = a . includeUnloaded ; a . includeUnloaded = $ ( " # checkUnloaded " ) . is ( " : checked " ) = = = ! 0 , b ! = = a . includeUnloaded & & this . render ( ) } , sortName : function ( ) { var a = this . collection . searchOptions , b = a . sortBy ; a . sortBy = $ ( " # sortName " ) . is ( " : checked " ) = = = ! 0 ? " name " : " type " , b ! = = a . sortBy & & this . render ( ) } , sortType : function ( ) { var a = this . collection . searchOptions , b = a . sortBy ; a . sortBy = $ ( " # sortType " ) . is ( " : checked " ) = = = ! 0 ? " type " : " name " , b ! = = a . sortBy & & this . render ( ) } , sortOrder : function ( ) { var a = this . collection . searchOptions , b = a . sortOrder ; a . sortOrder = $ ( " # sortOrder " ) . is ( " : checked " ) = = = ! 0 ? - 1 : 1 , b ! = = a . sortOrder & & this . render ( ) } , setFilterValues : function ( ) { var a = this . collection . searchOptions ; $ ( " # checkLoaded " ) . attr ( " checked " , a . includeLoaded ) , $ ( " # checkUnloaded " ) . attr ( " checked " , a . includeUnloaded ) , $ ( " . checkSystemCollections " ) . attr ( " checked " , a . includeSystem ) , $ ( " # checkEdge " ) . attr ( " checked " , a . includeEdge ) , $ ( " # checkDocument " ) . attr ( " checked " , a . includeDocument ) , $ ( " # sortName " ) . attr ( " checked " , " type " ! = = a . sortBy ) , $ ( " # sortType " ) . attr ( " checked " , " type " = = = a . sortBy ) , $ ( " # sortOrder " ) . attr ( " checked " , 1 ! = = a . sortOrder ) } , search : function ( ) { var a = this . collection . searchOptions , b = $ ( " # searchInput " ) . val ( ) ; b ! = = a . searchPhrase & & ( a . searchPhrase = b , this . render ( ) ) } , resetSearch : function ( ) { this . searchTimeout & & ( clearTimeout ( this . searchTimeout ) , this . searchTimeout = null ) ; var a = this . collection . searchOptions ; a . searchPhrase = null } , restrictToSearchPhraseKey : function ( ) { var a = this ; this . resetSearch ( ) , a . searchTimeout = setTimeout ( function ( ) { a . search ( ) } , 200 ) } , restrictToSearchPhrase : function ( ) { this . resetSearch ( ) , this . search ( ) } , createCollection : function ( a ) { a . preventDefault ( ) , this . createNewCollectionModal ( ) } , submitCreateCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " DB " , " Could not check coordinator state " ) ; else { var c = $ ( " # new - collection - name " ) . val ( ) , d = $ ( " # new - collection - size " ) . val ( ) , e = $ ( " # new - replication - factor " ) . val ( ) , f = $ ( " # new - collection - type " ) . val ( ) , g = $ ( " # new - collection - sync " ) . val ( ) , h = 1 , i = [ ] ; if ( " " = = = e & & ( e = 1 ) , b ) { if ( h = $ ( " # new - collection - shards " ) . val ( ) , " " = = = h & & ( h = 1 ) , h = parseInt ( h , 10 ) , 1 > h ) return arangoHelper . arangoError ( " Number of shards has to be an integer value greater or equal 1 " ) , 0 ; i = _ . pluck ( $ ( " # new - collection - shardBy " ) . select2 ( " data " ) , " text " ) , 0 = = = i . length & & i . push ( " _key " ) } if ( " _ " = = = c . substr ( 0 , 1 ) ) return arangoHelper . arangoError ( ' No " _ " allowed as first character ! ' ) , 0 ; var j = ! 1 , k = " true " = = = g ; if ( d > 0 ) try { d = 1024 * JSON . parse ( d ) * 1024 } catch ( l ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } if ( " " = = = c ) return arangoHelper . arangoError ( " No collection name entered ! " ) , 0 ; var m = function ( a , b ) { if ( a ) try { b = JSON . parse ( b . responseText ) , arangoHelper . arangoError ( " Error " , b . errorMessage ) } catch ( c ) { console . log ( c ) } else this . updateCollectionsView ( ) ; window . modalView . hide ( ) } . bind ( this ) ; this . collection . newCollection ( { collName : c , wfs : k , isSystem : j , collSize : d , replicationFactor : e , collType : f , shards : h , shardBy : i } , m ) } } . bind ( this ) ; window . isCoordinator ( a ) } , createNewCollectionModal : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " DB " , " Could not check coordinator state " ) ; else { var c = [ ] , d = [ ] , e = { } , f = [ ] ; d . push ( window . modalView . createTextEntry ( " new - collection - name " , " Name " , " " , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) , d . push ( window . modalView . createSelectEntry ( " new - collection - type " , " Type " , " " , " The type of the collection to create . " , [ { value : 2 , label : " Document " } , { value : 3 , label : " Edge " } ] ) ) , b & & ( d . push ( window . modalView . createTextEntry ( " new - collection - shards " , " Shards " , " " , " The number of shards to create . You cannot change this afterwards . Recommended : DBServers squared " , " " , ! 0 ) ) , d . push ( window . modalView . createSelect2Entry ( " new - collection - shardBy " , " shardBy " , " " , " The keys used to distribute documents on shards . Type the key and press return to add it . " , " _key " , ! 1 ) ) ) , c . push ( window . modalView . createSuccessButton ( " Save " , this . submitCreateCollection . bind ( this ) ) ) , f . push ( window . modalView . createTextEntry ( " new - collection - size " , " Journal size " , " " , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , window . App . isCluster & & f . push ( window . modalView . createTextEntry ( " new - replication - factor " , " Replication factor " , " " , " Numeric value . Must be at least 1 . Description : TODO " , " " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , f . push ( window . modalView . createSelectEntry ( " new - collection - sync " , " Wait for sync " , " " , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) , e . header = " Advanced " , e . content = f , window . modalView . show ( " modalTable . ejs " , " New Collection " , c , d , e ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; function a ( a , b ) { return void 0 ! = = a & & null ! = = a | | ( a = 0 ) , a . toFixed ( b ) } window . DashboardView = Backbone . View . extend ( { el : " # content " , interval : 1e4 , defaultTimeFrame : 12e5 , defaultDetailFrame : 1728e5 , history : { } , graphs : { } , events : { " click . subViewNavbar . subMenuEntry " : " toggleViews " } , tendencies : { asyncPerSecondCurrent : [ " asyncPerSecondCurrent " , " asyncPerSecondPercentChange " ] , syncPerSecondCurrent : [ " syncPerSecondCurrent " , " syncPerSecondPercentChange " ] , clientConnectionsCurrent : [ " clientConnectionsCurrent " , " clientConnectionsPercentChange " ] , clientConnectionsAverage : [ " clientConnections15M " , " clientConnections15MPercentChange " ] , numberOfThreadsCurrent : [ " numberOfThreadsCurrent " , " numberOfThreadsPercentChange " ] , numberOfThreadsAverage : [ " numberOfThreads15M " , " numberOfThreads15MPercentChange " ] , virtualSizeCurrent : [ " virtualSizeCurrent " , " virtualSizePercentChange " ] , virtualSizeAverage : [ " virtualSize15M " , " virtualSize15MPercentChange " ] } , barCharts : { totalTimeDistribution : [ " queueTimeDistributionPercent " , " requestTimeDistributionPercent " ] , dataTransferDistribution : [ " bytesSentDistributionPercent " , " bytesReceivedDistributionPercent " ] } , barChartsElementNames : { queueTimeDistributionPercent : " Queue " , requestTimeDistributionPercent : " Computation " , bytesSentDistributionPercent : " Bytes sent " , bytesReceivedDistributionPercent : " Bytes received " } , getDetailFigure : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) . replace ( / ChartButton / g , " " ) ; return b } , showDetail : function ( a ) { var b , c = this , d = this . getDetailFigure ( a ) ; b = this . dygraphConfig . getDetailChartConfig ( d ) , this . getHistoryStatistics ( d ) , this . detailGraphFigure = d , window . modalView . hideFooter = ! 0 , window . modalView . hide ( ) , window . modalView . show ( " modalGraph . ejs " , b . header , void 0 , void 0 , void 0 , void 0 , this . events ) , window . modalView . hideFooter = ! 1 , $ ( " # modal - dialog " ) . on ( " hidden " , function ( ) { c . hidden ( ) } ) , $ ( " # modal - dialog " ) . toggleClass ( " modal - chart - detail " , ! 0 ) , b . height = . 7 * $ ( window ) . height ( ) , b . width = $ ( " . modal - inner - detail " ) . width ( ) , b . labelsDiv = $ ( b . labelsDiv ) [ 0 ] , this . detailGraph = new Dygraph ( document . getElementById ( " lineChartDetail " ) , this . history [ this . server ] [ d ] , b ) } , hidden : function ( ) { this . detailGraph . destroy ( ) , delete this . detailGraph , delete this . detailGraphFigure } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , prepareDygraphs : function ( ) { var a , b = this ; this . dygraphConfig . getDashBoardFigures ( ) . forEach ( function ( c ) { a = b . dygraphConfig . getDefaultConfig ( c ) ; var d = b . getCurrentSize ( a . div ) ; a . height = d . height , a . width = d . width , b . graphs [ c ] = new Dygraph ( document . getElementById ( a . div ) , b . history [ b . server ] [ c ] | | [ ] , a ) } ) } , initialize : function ( a ) { this . options = a , this . dygraphConfig = a . dygraphConfig , this . d3NotInitialized = ! 0 , this . events [ " click . dashboard - sub - bar - menu - sign " ] = this . showDetail . bind ( this ) , this . events [ " mousedown . dygraph - rangesel - zoomhandle " ] = this . stopUpdating . bind ( this ) , this . events [ " mouseup . dygraph - rangesel - zoomhandle " ] = this . startUpdating . bind ( this ) , this . serverInfo = a . serverToShow , this . serverInfo ? this . server = this . serverInfo . target : this . server = " - local - " , this . history [ this . server ] = { } } , toggleViews : function ( a ) { var b = a . currentTarget . id . split ( " - " ) [ 0 ] , c = this , d = [ " replication " , " requests " , " system " ] ; _ . each ( d , function ( a ) { b ! = = a ? $ ( " # " + a ) . hide ( ) : ( $ ( " # " + a ) . show ( ) , c . resize ( ) , $ ( window ) . resize ( ) ) } ) , $ ( " . subMenuEntries " ) . children ( ) . removeClass ( " active " ) , $ ( " # " + b + " - statistics " ) . addClass ( " active " ) , window . setTimeout ( function ( ) { c . resize ( ) , $ ( window ) . resize ( ) } , 200 ) } , cleanupHistory : function ( a ) { if ( this . history [ this . server ] . hasOwnProperty ( a ) & & this . history [ this . server ] [ a ] . length > this . defaultTimeFrame / this . interval ) for ( ; this . history [ this . server ] [ a ] . length > this . defaultTimeFrame / this . interval ; ) this . history [ this . server ] [ a ] . shift ( ) } , updateCharts : function ( ) { var a = this ; return this . detailGraph ? void this . updateLineChart ( this . detailGraphFigure , ! 0 ) : ( this . prepareD3Charts ( this . isUpdating ) , this . prepareResidentSize ( this . isUpdating ) , this . updateTendencies ( ) , void Object . keys ( this . graphs ) . forEach ( function ( b ) { a . updateLineChart ( b , ! 1 ) } ) ) } , updateTendencies : function ( ) { var a = this , b = this . tendencies , c = " " ; Object . keys ( b ) . forEach ( function ( b ) { var d = " " , e = 0 ; a . history . hasOwnProperty ( a . server ) & & a . history [ a . server ] . hasOwnProperty ( b ) & & ( e = a . history [ a . server ] [ b ] [ 1 ] ) , 0 > e ? c = " # d05448 " : ( c = " # 7da817 " , d = " + " ) , a . history . hasOwnProperty ( a . server ) & & a . history [ a . server ] . hasOwnProperty ( b ) ? $ ( " # " + b ) . html ( a . history [ a . server ] [ b ] [ 0 ] + ' < br / > < span class = " dashboard - figurePer " style = " color : ' + c + ' ; " > ' + d + e + " % < / span > " ) : $ ( " # " + b ) . html ( ' < br / > < span class = " dashboard - figurePer " style = " color : # 000 ; " > < p class = " dataNotReadyYet " > data not ready yet < / p > < / span > ' ) } ) } , updateDateWindow : function ( a , b ) { var c , d , e = ( new Date ) . getTime ( ) ; return b & & a . dateWindow_ ? ( c = a . dateWindow_ [ 0 ] , d = e - a . dateWindow_ [ 1 ] - 5 * this . interval > 0 ? a . dateWindow_ [ 1 ] : e , [ c , d ] ) : [ e - this . defaultTimeFrame , e ] } , updateLineChart : function ( a , b ) { var c = b ? this . detailGraph : this . graphs [ a ] , d = { file : this . history [ this . server ] [ a ] , dateWindow : this . updateDateWindow ( c , b ) } , e = 0 , f = [ ] ; _ . each ( d . file , function ( a ) { var b = a [ 0 ] . getSeconds ( ) - a [ 0 ] . getSeconds ( ) % 10 ; d . file [ e ] [ 0 ] . setSeconds ( b ) , f . push ( d . file [ e ] [ 0 ] ) , e + + } ) ; for ( var g = new Date ( Math . max . apply ( null , f ) ) , h = new Date ( Math . min . apply ( null , f ) ) , i = new Date ( h . getTime ( ) ) , j = [ ] , k = [ ] ; g > i ; ) i = new Date ( i . setSeconds ( i . getSeconds ( ) + 10 ) ) , k . push ( i ) ; _ . each ( k , function ( a ) { var b = ! 1 ; _ . each ( d . file , function ( c ) { Math . floor ( a . getTime ( ) / 1e3 ) = = = Math . floor ( c [ 0 ] . getTime ( ) / 1e3 ) & & ( b = ! 0 ) } ) , b = = = ! 1 & & a < new Date & & j . push ( a ) } ) , _ . each ( j , function ( b ) { " systemUserTime " ! = = a & & " requests " ! = = a & & " pageFaults " ! = = a & & " dataTransfer " ! = = a | | d . file . push ( [ b , 0 , 0 ] ) , " totalTime " = = = a & & d . file . push ( [ b , 0 , 0 , 0 ] ) } ) , void 0 = = = d . file ? ( $ ( " # loadingScreen span " ) . text ( " Statistics not ready yet . Waiting . " ) , $ ( " # loadingScreen " ) . show ( ) , $ ( " # content " ) . hide ( ) ) : ( $ ( " # content " ) . show ( ) , $ ( " # loadingScreen " ) . hide ( ) , d . file . sort ( function ( a , b ) { return new Date ( b [ 0 ] ) - new Date ( a [ 0 ] ) } ) , c . updateOptions ( d ) , this . history [ this . server ] . hasOwnProperty ( a ) & & this . cleanupHistory ( a ) ) , $ ( window ) . trigger ( " resize " ) , this . resize ( ) } , mergeDygraphHistory : function ( a , b ) { var c , d = this ; this . dygraphConfig . getDashBoardFigures ( ! 0 ) . forEach ( function ( e ) { if ( d . dygraphConfig . mapStatToFigure [ e ] & & ( d . history [ d . server ] [ e ] | | ( d . history [ d . server ] [ e ] = [ ] ) , c = [ ] , d . dygraphConfig . mapStatToFigure [ e ] . forEach ( function ( d ) { a [ d ] & & ( " times " = = = d ? c . push ( new Date ( 1e3 * a [ d ] [ b ] ) ) : c . push ( a [ d ] [ b ] ) ) } ) , c . length > 1 ) ) { var f = 0 , g = 0 ; 9 = = = c . length & & ( f + = c [ 1 ] , f + = c [ 6 ] , f + = c [ 7 ] , f + = c [ 8 ] , g + = c [ 2 ] , g + = c [ 3 ] , g + = c [ 4 ] , g + = c [ 5 ] , c = [ c [ 0 ] , f , g ] ) , d . history [ d . server ] [ e ] . push ( c ) } } ) } , cutOffHistory : function ( a , b ) { for ( var c , d = this ; 0 ! = = d . history [ d . server ] [ a ] . length & & ( c = d . history [ d . server ] [ a ] [ 0 ] [ 0 ] , ! ( c > = b ) ) ; ) d . history [ d . server ] [ a ] . shift ( ) } , cutOffDygraphHistory : function ( a ) { var b = this , c = new Date ( a ) ; this . dygraphConfig . getDashBoardFigures ( ! 0 ) . forEach ( function ( a ) { b . dygraphConfig . mapStatToFigure [ a ] & & b . history [ b . server ] [ a ] & & b . cutOffHistory ( a , c ) } ) } , mergeHistory : function ( b ) { var c , d = this ; for ( c = 0 ; c < b . times . length ; + + c ) this . mergeDygraphHistory ( b , c ) ; this . cutOffDygraphHistory ( ( new Date ) . getTime ( ) - this . defaultTimeFrame ) , Object . keys ( this . tendencies ) . forEach ( function ( c ) { var e = 1 , f = 1 ; " virtualSizeCurrent " = = = c | | " virtualSizeAverage " = = = c ? ( b [ d . tendencies [ c ] [ 0 ] ] / = 1073741824 , e = 2 ) : " clientConnectionsCurrent " = = = c ? e = 0 : " numberOfThreadsCurrent " = = = c & & ( e = 0 ) , d . history [ d . server ] [ c ] = [ a ( b [ d . tendencies [ c ] [ 0 ] ] , e ) , a ( 100 * b [ d . tendencies [ c ] [ 1 ] ] , f ) ] } ) , Object . keys ( this . barCharts ) . forEach ( function ( a ) { d . history [ d . server ] [ a ] = d . mergeBarChartData ( d . barCharts [ a ] , b ) } ) , d . history [ d . server ] . physicalMemory = b . physicalMemory , d . history [ d . server ] . residentSizeCurrent = b . residentSizeCurrent , d . history [ d . server ] . residentSizePercent = b . residentSizePercent , d . history [ d . server ] . residentSizeChart = [ { key : " " , color : this . dygraphConfig . colors [ 1 ] , values : [ { label : " used " , value : 100 * b . residentSizePercent } ] } , { key : " " , color : this . dygraphConfig . colors [ 2 ] , values : [ { label : " used " , value : 100 - 100 * b . residentSizePercent } ] } ] , this . nextStart = b . nextStart } , mergeBarChartData : function ( a , b ) { var c , d = { key : this . barChartsElementNames [ a [ 0 ] ] , color : this . dygraphConfig . colors [ 1 ] , values : [ ] } , e = { key : this . barChartsElementNames [ a [ 1 ] ] , color : this . dygraphConfig . colors [ 2 ] , values : [ ] } ; for ( c = b [ a [ 0 ] ] . values . length - 1 ; c > = 0 ; - - c ) d . values . push ( { label : this . getLabel ( b [ a [ 0 ] ] . cuts , c ) , value : b [ a [ 0 ] ] . values [ c ] } ) , e . values . push ( { label : this . getLabel ( b [ a [ 1 ] ] . cuts , c ) , value : b [ a [ 1 ] ] . values [ c ] } ) ; return [ d , e ] } , getLabel : function ( a , b ) { return a [ b ] ? 0 = = = b ? " 0 - " + a [ b ] : a [ b - 1 ] + " - " + a [ b ] : " > " + a [ b - 1 ] } , renderReplicationStatistics : function ( a ) { $ ( " # repl - numbers table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalEvents ) , $ ( " # repl - numbers table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalRequests ) , $ ( " # repl - numbers table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . totalFailedConnects ) , a . state . lastAppliedContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastAppliedContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , a . state . lastProcessedContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastProcessedContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , a . state . lastAvailableContinuousTick ? $ ( " # repl - ticks table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . lastAvailableContinuousTick ) : $ ( " # repl - ticks table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( " no data available " ) . addClass ( " no - data " ) , $ ( " # repl - progress table tr : nth - child ( 1 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . message ) , $ ( " # repl - progress table tr : nth - child ( 2 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . time ) , $ ( " # repl - progress table tr : nth - child ( 3 ) > td : nth - child ( 2 ) " ) . html ( a . state . progress . failedConnects ) } , getReplicationStatistics : function ( ) { var a = this ; $ . ajax ( arangoHelper . databaseUrl ( " / _api / replication / applier - state " ) , { async : ! 0 } ) . done ( function ( b ) { if ( b . hasOwnProperty ( " state " ) ) { var c ; c = b . state . running ? " active " : " inactive " , c = ' < span class = " state " > ' + c + " < / span > " , $ ( " # replication - chart . dashboard - sub - bar " ) . html ( " Replication " + c ) , a . renderReplicationStatistics ( b ) } } ) } , getStatistics : function ( a , b ) { var c = this , d = arangoHelper . databaseUrl ( " / _admin / aardvark / statistics / short " , " _system " ) , e = " ? start = " ; e + = c . nextStart ? c . nextStart : ( ( new Date ) . getTime ( ) - c . defaultTimeFrame ) / 1e3 , " - local - " ! = = c . server & & ( e + = " & type = short & DBserver = " + c . serverInfo . target , c . history . hasOwnProperty ( c . server ) | | ( c . history [ c . server ] = { } ) ) , $ . ajax ( d + e , { async : ! 0 , xhrFields : { withCredentials : ! 0 } , crossDomain : ! 0 } ) . done ( function ( d ) { d . times . length > 0 & & ( c . isUpdating = ! 0 , c . mergeHistory ( d ) ) , c . isUpdating ! = = ! 1 & & ( a & & a ( d . enabled , b ) , c . updateCharts ( ) ) } ) . error ( function ( a ) { console . log ( " stat fetch req error " ) , console . log ( a ) } ) , this . getReplicationStatistics ( ) } , getHistoryStatistics : function ( a ) { var b = this , c = " statistics / long " , d = " ? filter = " + this . dygraphConfig . mapStatToFigure [ a ] . join ( ) ; " - local - " ! = = b . server & & ( c = b . server . endpoint + arangoHelper . databaseUrl ( " / _admin / aardvark / statistics / cluster " ) , d + = " & type = long & DBserver = " + b . server . target , b . history . hasOwnProperty ( b . server ) | | ( b . history [ b . server ] = { } ) ) ; var e = window . location . href . split ( " / " ) , f = e [ 0 ] + " / / " + e [ 2 ] + " / " + e [ 3 ] + " / _system / " + e [ 5 ] + " / " + e [ 6 ] + " / " ; $ . ajax ( f + c + d , { async : ! 0 } ) . done ( function ( c ) { var d ; for ( b . history [ b . server ] [ a ] = [ ] , d = 0 ; d < c . times . length ; + + d ) b . mergeDygraphHistory ( c , d , ! 0 ) } ) } , addEmptyDataLabels : function ( ) { 0 = = = $ ( " . dataNotReadyYet " ) . length & & ( $ ( " # dataTransferDistribution " ) . prepend ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) , $ ( " # totalTimeDistribution " ) . prepend ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) , $ ( " . dashboard - bar - chart - title " ) . append ( ' < p class = " dataNotReadyYet " > data not ready yet < / p > ' ) ) } , removeEmptyDataLabels : function ( ) { $ ( " . dataNotReadyYet " ) . remove ( ) } , prepareResidentSize : function ( b ) { var c = this , d = this . getCurrentSize ( " # residentSizeChartContainer " ) , e = c . history [ c . server ] . residentSizeCurrent / 1024 / 1024 , f = " " ; f = 1025 > e ? a ( e , 2 ) + " MB " : a ( e / 1024 , 2 ) + " GB " ; var g = a ( 100 * c . history [ c . server ] . residentSizePercent , 2 ) , h = [ a ( c . history [ c . server ] . physicalMemory / 1024 / 1024 / 1024 , 0 ) + " GB " ] ; return void 0 = = = c . history [ c . server ] . residentSizeChart ? void this . addEmptyDataLabels ( ) : ( this . removeEmptyDataLabels ( ) , void nv . addGraph ( function ( ) { var a = nv . models . multiBarHorizontalChart ( ) . x ( function ( a ) { return a . label } ) . y ( function ( a ) { return a . value } ) . width ( d . width ) . height ( d . height ) . margin ( { top : ( $ ( " residentSizeChartContainer " ) . outerHeight ( ) - $ ( " residentSizeChartContainer " ) . height ( ) ) / 2 , right : 1 , bottom : ( $ ( " residentSizeChartContainer " ) . outerHeight ( ) - $ ( " residentSizeChartContainer " ) . height ( ) ) / 2 , left : 1 } ) . showValues ( ! 1 ) . showYAxis ( ! 1 ) . showXAxis ( ! 1 ) . showLegend ( ! 1 ) . showControls ( ! 1 ) . stacked ( ! 0 ) ; return a . yAxis . tickFormat ( function ( a ) { return a + " % " } ) . showMaxMin ( ! 1 ) , a . xAxis . showMaxMin ( ! 1 ) , d3 . select ( " # residentSizeChart svg " ) . datum ( c . history [ c . server ] . residentSizeChart ) . call ( a ) , d3 . select ( " # residentSizeChart svg " ) . select ( " . nv - zeroLine " ) . remove ( ) , b & & ( d3 . select ( " # residentSizeChart svg " ) . select ( " # total " ) . remove ( ) , d3 . select ( " # residentSizeChart svg " ) . select ( " # percentage " ) . remove ( ) ) , d3 . select ( " . dashboard - bar - chart - title . percentage " ) . html ( f + " ( " + g + " % ) " ) , d3 . select ( " . dashboard - bar - chart - title . absolut " ) . html ( h [ 0 ] ) , nv . utils . windowResize ( a . update ) , a } , function ( ) { d3 . selectAll ( " # residentSizeChart . nv - bar " ) . on ( " click " , function ( ) { } ) } ) ) } , prepareD3Charts : function ( b ) { var c = this , d = { totalTimeDistribution : [ " queueTimeDistributionPercent " , " requestTimeDistributionPercent " ] , dataTransferDistribution : [ " bytesSentDistributionPercent " , " bytesReceivedDistributionPercent " ] } ; this . d3NotInitialized & & ( b = ! 1 , this . d3NotInitialized = ! 1 ) , _ . each ( Object . keys ( d ) , function ( b ) { var d = c . getCurrentSize ( " # " + b + " Container . dashboard - interior - chart " ) , e = " # " + b + " Container svg " ; return void 0 = = = c . history [ c . server ] . residentSizeChart ? void c . addEmptyDataLabels ( ) : ( c . removeEmptyDataLabels ( ) , void nv . addGraph ( function ( ) { var f = [ 0 , . 25 , . 5 , . 75 , 1 ] , g = 75 , h = 23 , i = 6 ; d . width < 219 ? ( f = [ 0 , . 5 , 1 ] , g = 72 , h = 21 , i = 5 ) : d . width < 299 ? ( f = [ 0 , . 3334 , . 6667 , 1 ] , g = 77 ) : d . width < 379 ? g = 87 : d . width < 459 ? g = 95 : d . width < 539 ? g = 100 : d . width < 619 & & ( g = 105 ) ; var j = nv . models . multiBarHorizontalChart ( ) . x ( function ( a ) { return a . label } ) . y ( function ( a ) { return a . value } ) . width ( d . width ) . height ( d . height ) . margin ( { top : 5 , right : 20 , bottom : h , left : g } ) . showValues ( ! 1 ) . showYAxis ( ! 0 ) . showXAxis ( ! 0 ) . showLegend ( ! 1 ) . showControls ( ! 1 ) . forceY ( [ 0 , 1 ] ) ; j . yAxis . showMaxMin ( ! 1 ) ; d3 . select ( " . nv - y . nv - axis " ) . selectAll ( " text " ) . attr ( " transform " , " translate ( 0 , " + i + " ) " ) ; return j . yAxis . tickValues ( f ) . tickFormat ( function ( b ) { return a ( 100 * b * 100 / 100 , 0 ) + " % " } ) , d3 . select ( e ) . datum ( c . history [ c . server ] [ b ] ) . call ( j ) , nv . utils . windowResize ( j . update ) , j } , function ( ) { d3 . selectAll ( e + " . nv - bar " ) . on ( " click " , function ( ) { } ) } ) ) } ) } , stopUpdating : function ( ) { this . isUpdating = ! 1 } , startUpdating : function ( ) { var a = this ; a . timer | | ( a . timer = window . setInterval ( function ( ) { window . App . isCluster ? window . location . hash . indexOf ( a . serverInfo . target ) > - 1 & & a . getStatistics ( ) : a . getStatistics ( ) } , a . interval ) ) } , resize : function ( ) { if ( this . isUpdating ) { var a , b = this ; _ . each ( this . graphs , function ( c ) { a = b . getCurrentSize ( c . maindiv_ . id ) , c . resize ( a . width , a . height ) } ) , this . detailGraph & & ( a = this . getCurrentSize ( this . detailGraph . maindiv_ . id ) , this . detailGraph . resize ( a . width , a . height ) ) , this . prepareD3Charts ( ! 0 ) , this . prepareResidentSize ( ! 0 ) } } , template : templateEngine . createTemplate ( " dashboardView . ejs " ) , render : function ( a ) { var b = function ( a , b ) { return b | | $ ( this . el ) . html ( this . template . render ( ) ) , a & & " _system " = = = frontendConfig . db ? ( this . prepareDygraphs ( ) , this . isUpdating & & ( this . prepareD3Charts ( ) , this . prepareResidentSize ( ) , this . updateTendencies ( ) , $ ( window ) . trigger ( " resize " ) ) , this . startUpdating ( ) , void $ ( window ) . resize ( ) ) : ( $ ( this . el ) . html ( " " ) , void ( this . server ? $ ( this . el ) . append ( ' < div style = " color : red " > Server statistics ( ' + this . server + " ) are disabled . < / div > " ) : $ ( this . el ) . append ( ' < div style = " color : red " > Server statistics are disabled . < / div > ' ) ) ) } . bind ( this ) , c = function ( ) { $ ( this . el ) . html ( " " ) , $ ( " . contentDiv " ) . remove ( ) , $ ( " . headerBar " ) . remove ( ) , $ ( " . dashboard - headerbar " ) . remove ( ) , $ ( " . dashboard - row " ) . remove ( ) , $ ( this . el ) . append ( ' < div style = " color : red " > You do not have permission to view this page . < / div > ' ) , $ ( this . el ) . append ( " < div style = \ " color : red \ " > You can switch to ' _system ' to see the dashboard . < / div > " ) } . bind ( this ) ; if ( " _system " ! = = frontendConfig . db ) return void c ( ) ; var d = function ( d , e ) { d | | ( e ? this . getStatistics ( b , a ) : c ( ) ) } . bind ( this ) ; void 0 = = = window . App . currentDB . get ( " name " ) ? window . setTimeout ( function ( ) { return " _system " ! = = window . App . currentDB . get ( " name " ) ? void c ( ) : void this . options . database . hasSystemAccess ( d ) } . bind ( this ) , 300 ) : this . options . database . hasSystemAccess ( d ) } } ) } ( ) , function ( ) { " use strict " ; window . databaseView = Backbone . View . extend ( { users : null , el : " # content " , template : templateEngine . createTemplate ( " databaseView . ejs " ) , dropdownVisible : ! 1 , currentDB : " " , events : { " click # createDatabase " : " createDatabase " , " click # submitCreateDatabase " : " submitCreateDatabase " , " click . editDatabase " : " editDatabase " , " click . icon " : " editDatabase " , " click # selectDatabase " : " updateDatabase " , " click # submitDeleteDatabase " : " submitDeleteDatabase " , " click . contentRowInactive a " : " changeDatabase " , " keyup # databaseSearchInput " : " search " , " click # databaseSearchSubmit " : " search " , " click # databaseToggle " : " toggleSettingsDropdown " , " click . css - label " : " checkBoxes " , " click # dbSortDesc " : " sorting " } , sorting : function ( ) { $ ( " # dbSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # databaseDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , initialize : function ( ) { this . collection . fetch ( { async : ! 0 } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , render : function ( ) { var a = function ( a , b ) { a ? arangoHelper . arangoError ( " DB " , " Could not get current db properties " ) : ( this . currentDB = b , this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " , currentDB : this . currentDB } ) ) , this . dropdownVisible = = = ! 0 & & ( $ ( " # dbSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # databaseToggle " ) . toggleClass ( " activated " ) , $ ( " # databaseDropdown2 " ) . show ( ) ) , arangoHelper . setCheckboxStatus ( " # databaseDropdown " ) , this . replaceSVGs ( ) ) } . bind ( this ) ; return this . collection . getCurrentDatabase ( a ) , this } , toggleSettingsDropdown : function ( ) { $ ( " # dbSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # databaseToggle " ) . toggleClass ( " activated " ) , $ ( " # databaseDropdown2 " ) . slideToggle ( 200 ) } , selectedDatabase : function ( ) { return $ ( " # selectDatabases " ) . val ( ) } , handleError : function ( a , b , c ) { return 409 = = = a ? void arangoHelper . arangoError ( " DB " , " Database " + c + " already exists . " ) : 400 = = = a ? void arangoHelper . arangoError ( " DB " , " Invalid Parameters " ) : 403 = = = a ? void arangoHelper . arangoError ( " DB " , " Insufficent rights . Execute this from _system database " ) : void 0 } , validateDatabaseInfo : function ( a , b ) { return " " = = = b ? ( arangoHelper . arangoError ( " DB " , " You have to define an owner for the new database " ) , ! 1 ) : " " = = = a ? ( arangoHelper . arangoError ( " DB " , " You have to define a name for the new database " ) , ! 1 ) : 0 = = = a . indexOf ( " _ " ) ? ( arangoHelper . arangoError ( " DB " , " Databasename should not start with _ " ) , ! 1 ) : a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ \ - ] * $ / ) ? ! 0 : ( arangoHelper . arangoError ( " DB " , " Databasename may only contain numbers , letters , _ and - " ) , ! 1 ) } , createDatabase : function ( a ) { a . preventDefault ( ) , this . createAddDatabaseModal ( ) } , switchDatabase : function ( a ) { if ( ! $ ( a . target ) . parent ( ) . hasClass ( " iconSet " ) ) { var b = $ ( a . currentTarget ) . find ( " h5 " ) . text ( ) ; if ( " " ! = = b ) { var c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) ; <nl> + } } } , submitCreateDatabase : function ( ) { var a , b = this , c = $ ( " # newDatabaseName " ) . val ( ) , d = $ ( " # newUser " ) . val ( ) ; if ( a = " true " = = = $ ( " # useDefaultPassword " ) . val ( ) ? " ARANGODB_DEFAULT_ROOT_PASSWORD " : $ ( " # newPassword " ) . val ( ) , this . validateDatabaseInfo ( c , d , a ) ) { var e = { name : c , users : [ { username : d , passwd : a , active : ! 0 } ] } ; this . collection . create ( e , { wait : ! 0 , error : function ( a , d ) { b . handleError ( d . status , d . statusText , c ) } , success : function ( ) { b . updateDatabases ( ) , window . modalView . hide ( ) , window . App . naviView . dbSelectionView . render ( $ ( " # dbSelect " ) ) } } ) } } , submitDeleteDatabase : function ( a ) { var b = this . collection . where ( { name : a } ) ; b [ 0 ] . destroy ( { wait : ! 0 , url : arangoHelper . databaseUrl ( " / _api / database / " + a ) } ) , this . updateDatabases ( ) , window . App . naviView . dbSelectionView . render ( $ ( " # dbSelect " ) ) , window . modalView . hide ( ) } , changeDatabase : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) , c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } , updateDatabases : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) , window . App . handleSelectDatabase ( ) } } ) } , editDatabase : function ( a ) { var b = this . evaluateDatabaseName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - database " ) , c = ! 0 ; b = = = this . currentDB & & ( c = ! 1 ) , this . createEditDatabaseModal ( b , c ) } , search : function ( ) { var a , b , c , d ; a = $ ( " # databaseSearchInput " ) , b = $ ( " # databaseSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return - 1 ! = = a . get ( " name " ) . indexOf ( b ) } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b , currentDB : this . currentDB } ) ) , this . replaceSVGs ( ) , a = $ ( " # databaseSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " tile - icon - svg " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , evaluateDatabaseName : function ( a , b ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } , createEditDatabaseModal : function ( a , b ) { var c = [ ] , d = [ ] ; d . push ( window . modalView . createReadOnlyEntry ( " id_name " , " Name " , a , " " ) ) , b ? c . push ( window . modalView . createDeleteButton ( " Delete " , this . submitDeleteDatabase . bind ( this , a ) ) ) : c . push ( window . modalView . createDisabledButton ( " Delete " ) ) , window . modalView . show ( " modalTable . ejs " , " Delete database " , c , d ) } , createAddDatabaseModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newDatabaseName " , " Name " , " " , ! 1 , " Database Name " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Database name must start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No database name given . " } ] ) ) , b . push ( window . modalView . createTextEntry ( " newUser " , " Username " , null ! = = this . users ? this . users . whoAmI ( ) : " root " , " Please define the owner of this database . This will be the only user having initial access to this database if authentication is turned on . Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it . Specifying a username is mandatory even with authentication turned off . If there is a failure you will be informed . " , " Database Owner " , ! 0 , [ { rule : Joi . string ( ) . required ( ) , msg : " No username given . " } ] ) ) , b . push ( window . modalView . createSelectEntry ( " useDefaultPassword " , " Use default password " , ! 0 , " Read the password from the environment variable ARANGODB_DEFAULT_ROOT_PASSWORD . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) , b . push ( window . modalView . createPasswordEntry ( " newPassword " , " Password " , " " , ! 1 , " " , ! 1 ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateDatabase . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create Database " , a , b ) , $ ( " # useDefaultPassword " ) . change ( function ( ) { " true " = = = $ ( " # useDefaultPassword " ) . val ( ) ? $ ( " # row_newPassword " ) . hide ( ) : $ ( " # row_newPassword " ) . show ( ) } ) , $ ( " # row_newPassword " ) . hide ( ) } } ) } ( ) , function ( ) { " use strict " ; window . DBSelectionView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " dbSelectionView . ejs " ) , events : { " click . dbSelectionLink " : " changeDatabase " } , initialize : function ( a ) { this . current = a . current } , changeDatabase : function ( a ) { var b = $ ( a . currentTarget ) . closest ( " . dbSelectionLink . tab " ) . attr ( " id " ) , c = this . collection . createDatabaseURL ( b ) ; window . location . replace ( c ) } , render : function ( a ) { var b = function ( b , c ) { b ? arangoHelper . arangoError ( " DB " , " Could not fetch databases " ) : ( this . $ el = a , this . $ el . html ( this . template . render ( { list : c , current : this . current . get ( " name " ) } ) ) , this . delegateEvents ( ) ) } . bind ( this ) ; return this . collection . getDatabasesForUser ( b ) , this . el } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a ) { var b = a . split ( " / " ) ; return " collection / " + encodeURIComponent ( b [ 0 ] ) + " / " + encodeURIComponent ( b [ 1 ] ) } ; window . DocumentView = Backbone . View . extend ( { el : " # content " , colid : 0 , docid : 0 , customView : ! 1 , defaultMode : " tree " , template : templateEngine . createTemplate ( " documentView . ejs " ) , events : { " click # saveDocumentButton " : " saveDocument " , " click # deleteDocumentButton " : " deleteDocumentModal " , " click # confirmDeleteDocument " : " deleteDocument " , " click # document - from " : " navigateToDocument " , " click # document - to " : " navigateToDocument " , " keydown # documentEditor . ace_editor " : " keyPress " , " keyup . jsoneditor . search input " : " checkSearchBox " , " click . jsoneditor . modes " : " storeMode " } , checkSearchBox : function ( a ) { " " = = = $ ( a . currentTarget ) . val ( ) & & this . editor . expandAll ( ) } , storeMode : function ( ) { var a = this ; $ ( " . type - modes " ) . on ( " click " , function ( b ) { a . defaultMode = $ ( b . currentTarget ) . text ( ) . toLowerCase ( ) } ) } , keyPress : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? ( a . preventDefault ( ) , this . saveDocument ( ) ) : a . metaKey & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . saveDocument ( ) ) } , editor : 0 , setType : function ( a ) { a = 2 = = = a ? " document " : " edge " ; var b = function ( a , b , c ) { if ( a ) console . log ( b ) , arangoHelper . arangoError ( " Error " , " Could not fetch data . " ) ; else { var d = c + " : " ; this . type = c , this . fillInfo ( d ) , this . fillEditor ( ) } } . bind ( this ) ; " edge " = = = a ? this . collection . getEdge ( this . colid , this . docid , b ) : " document " = = = a & & this . collection . getDocument ( this . colid , this . docid , b ) } , deleteDocumentModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " doc - delete - button " , " Delete " , " Delete this " + this . type + " ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Document " , a , b ) } , deleteDocument : function ( ) { var a = function ( ) { if ( this . customView ) this . customDeleteFunction ( ) ; else { var a = " collection / " + encodeURIComponent ( this . colid ) + " / documents / 1 " ; window . modalView . hide ( ) , window . App . navigate ( a , { trigger : ! 0 } ) } } . bind ( this ) ; if ( " document " = = = this . type ) { var b = function ( b ) { b ? arangoHelper . arangoError ( " Error " , " Could not delete document " ) : a ( ) } . bind ( this ) ; this . collection . deleteDocument ( this . colid , this . docid , b ) } else if ( " edge " = = = this . type ) { var c = function ( b ) { b ? arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) : a ( ) } . bind ( this ) ; this . collection . deleteEdge ( this . colid , this . docid , c ) } } , navigateToDocument : function ( a ) { var b = $ ( a . target ) . attr ( " documentLink " ) ; b & & window . App . navigate ( b , { trigger : ! 0 } ) } , fillInfo : function ( b ) { var c = this . collection . first ( ) , d = c . get ( " _id " ) , e = c . get ( " _key " ) , f = c . get ( " _rev " ) , g = c . get ( " _from " ) , h = c . get ( " _to " ) ; if ( $ ( " # document - type " ) . text ( b ) , $ ( " # document - id " ) . text ( d ) , $ ( " # document - key " ) . text ( e ) , $ ( " # document - rev " ) . text ( f ) , g & & h ) { var i = a ( g ) , j = a ( h ) ; $ ( " # document - from " ) . text ( g ) , $ ( " # document - from " ) . attr ( " documentLink " , i ) , $ ( " # document - to " ) . text ( h ) , $ ( " # document - to " ) . attr ( " documentLink " , j ) } else $ ( " . edge - info - container " ) . hide ( ) } , fillEditor : function ( ) { var a = this . removeReadonlyKeys ( this . collection . first ( ) . attributes ) ; $ ( " . disabledBread " ) . last ( ) . text ( this . collection . first ( ) . get ( " _key " ) ) , this . editor . set ( a ) , $ ( " . ace_content " ) . attr ( " font - size " , " 11pt " ) } , jsonContentChanged : function ( ) { this . enableSaveButton ( ) } , resize : function ( ) { $ ( " # documentEditor " ) . height ( $ ( " . centralRow " ) . height ( ) - 300 ) } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " # documentEditor " ) . height ( $ ( " . centralRow " ) . height ( ) - 300 ) , this . disableSaveButton ( ) , this . breadcrumb ( ) ; var a = this , b = document . getElementById ( " documentEditor " ) , c = { change : function ( ) { a . jsonContentChanged ( ) } , search : ! 0 , mode : " tree " , modes : [ " tree " , " code " ] , iconlib : " fontawesome4 " } ; return this . editor = new JSONEditor ( b , c ) , this . editor . setMode ( this . defaultMode ) , this } , removeReadonlyKeys : function ( a ) { return _ . omit ( a , [ " _key " , " _id " , " _from " , " _to " , " _rev " ] ) } , saveDocument : function ( ) { if ( void 0 = = = $ ( " # saveDocumentButton " ) . attr ( " disabled " ) ) if ( " _ " = = = this . collection . first ( ) . attributes . _id . substr ( 0 , 1 ) ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( " doc - save - system - button " , " Caution " , " You are modifying a system collection . Really continue ? " , void 0 , void 0 , ! 1 , / [ < > & ' " ] / ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . confirmSaveDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Modify System Collection " , a , b ) } else this . confirmSaveDocument ( ) } , confirmSaveDocument : function ( ) { window . modalView . hide ( ) ; var a ; try { a = this . editor . get ( ) } catch ( b ) { return this . errorConfirmation ( b ) , void this . disableSaveButton ( ) } if ( a = JSON . stringify ( a ) , " document " = = = this . type ) { var c = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not save document . " ) : ( this . successConfirmation ( ) , this . disableSaveButton ( ) ) } . bind ( this ) ; this . collection . saveDocument ( this . colid , this . docid , a , c ) } else if ( " edge " = = = this . type ) { var d = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not save edge . " ) : ( this . successConfirmation ( ) , this . disableSaveButton ( ) ) } . bind ( this ) ; this . collection . saveEdge ( this . colid , this . docid , a , d ) } } , successConfirmation : function ( ) { arangoHelper . arangoNotification ( " Document saved . " ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # C6FFB0 " } , 500 ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # C6FFB0 " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) } , errorConfirmation : function ( a ) { arangoHelper . arangoError ( " Document editor : " , a ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # FFB0B0 " } , 500 ) , $ ( " # documentEditor . tree " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # FFB0B0 " } , 500 ) , $ ( " # documentEditor . ace_content " ) . animate ( { backgroundColor : " # FFFFF " } , 500 ) } , enableSaveButton : function ( ) { $ ( " # saveDocumentButton " ) . prop ( " disabled " , ! 1 ) , $ ( " # saveDocumentButton " ) . addClass ( " button - success " ) , $ ( " # saveDocumentButton " ) . removeClass ( " button - close " ) } , disableSaveButton : function ( ) { $ ( " # saveDocumentButton " ) . prop ( " disabled " , ! 0 ) , $ ( " # saveDocumentButton " ) . addClass ( " button - close " ) , $ ( " # saveDocumentButton " ) . removeClass ( " button - success " ) } , breadcrumb : function ( ) { var a = window . location . hash . split ( " / " ) ; $ ( " # subNavigationBar . breadcrumb " ) . html ( ' < a href = " # collection / ' + a [ 1 ] + ' / documents / 1 " > Collection : ' + a [ 1 ] + ' < / a > < i class = " fa fa - chevron - right " > < / i > Document : ' + a [ 2 ] ) } , escaped : function ( a ) { return a . replace ( / & / g , " & amp ; " ) . replace ( / < / g , " & lt ; " ) . replace ( / > / g , " & gt ; " ) . replace ( / " / g , " & quot ; " ) . replace ( / ' / g , " & # 39 ; " ) } } ) } ( ) , function ( ) { " use strict " ; window . DocumentsView = window . PaginationView . extend ( { filters : { 0 : ! 0 } , filterId : 0 , paginationDiv : " # documentsToolbarF " , idPrefix : " documents " , addDocumentSwitch : ! 0 , activeFilter : ! 1 , lastCollectionName : void 0 , restoredFilters : [ ] , editMode : ! 1 , allowUpload : ! 1 , el : " # content " , table : " # documentsTableID " , template : templateEngine . createTemplate ( " documentsView . ejs " ) , collectionContext : { prev : null , next : null } , editButtons : [ " # deleteSelected " , " # moveSelected " ] , initialize : function ( a ) { this . documentStore = a . documentStore , this . collectionsStore = a . collectionsStore , this . tableView = new window . TableView ( { el : this . table , collection : this . collection } ) , this . tableView . setRowClick ( this . clicked . bind ( this ) ) , this . tableView . setRemoveClick ( this . remove . bind ( this ) ) } , resize : function ( ) { $ ( " # docPureTable " ) . height ( $ ( " . centralRow " ) . height ( ) - 210 ) , $ ( " # docPureTable . pure - table - body " ) . css ( " max - height " , $ ( " # docPureTable " ) . height ( ) - 47 ) } , setCollectionId : function ( a , b ) { this . collection . setCollection ( a ) , this . collection . setPage ( b ) , this . page = b ; var c = function ( b , c ) { b ? arangoHelper . arangoError ( " Error " , " Could not get collection properties . " ) : ( this . type = c , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . collectionModel = this . collectionsStore . get ( a ) ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , c ) } , getDocsCallback : function ( a ) { $ ( " # documents_last " ) . css ( " visibility " , " hidden " ) , $ ( " # documents_first " ) . css ( " visibility " , " hidden " ) , a ? ( window . progressView . hide ( ) , arangoHelper . arangoError ( " Document error " , " Could not fetch requested documents . " ) ) : a & & void 0 = = = a | | ( window . progressView . hide ( ) , this . drawTable ( ) , this . renderPaginationElements ( ) ) } , events : { " click # collectionPrev " : " prevCollection " , " click # collectionNext " : " nextCollection " , " click # filterCollection " : " filterCollection " , " click # markDocuments " : " editDocuments " , " click # importCollection " : " importCollection " , " click # exportCollection " : " exportCollection " , " click # filterSend " : " sendFilter " , " click # addFilterItem " : " addFilterItem " , " click . removeFilterItem " : " removeFilterItem " , " click # deleteSelected " : " deleteSelectedDocs " , " click # moveSelected " : " moveSelectedDocs " , " click # addDocumentButton " : " addDocumentModal " , " click # documents_first " : " firstDocuments " , " click # documents_last " : " lastDocuments " , " click # documents_prev " : " prevDocuments " , " click # documents_next " : " nextDocuments " , " click # confirmDeleteBtn " : " confirmDelete " , " click . key " : " nop " , keyup : " returnPressedHandler " , " keydown . queryline input " : " filterValueKeydown " , " click # importModal " : " showImportModal " , " click # resetView " : " resetView " , " click # confirmDocImport " : " startUpload " , " click # exportDocuments " : " startDownload " , " change # documentSize " : " setPagesize " , " change # docsSort " : " setSorting " } , showSpinner : function ( ) { $ ( " # uploadIndicator " ) . show ( ) } , hideSpinner : function ( ) { $ ( " # uploadIndicator " ) . hide ( ) } , showImportModal : function ( ) { $ ( " # docImportModal " ) . modal ( " show " ) } , hideImportModal : function ( ) { $ ( " # docImportModal " ) . modal ( " hide " ) } , setPagesize : function ( ) { var a = $ ( " # documentSize " ) . find ( " : selected " ) . val ( ) ; this . collection . setPagesize ( a ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) } , setSorting : function ( ) { var a = $ ( " # docsSort " ) . val ( ) ; " " ! = = a & & void 0 ! = = a & & null ! = = a | | ( a = " _key " ) , this . collection . setSort ( a ) } , returnPressedHandler : function ( a ) { 13 = = = a . keyCode & & $ ( a . target ) . is ( $ ( " # docsSort " ) ) & & this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , 13 = = = a . keyCode & & $ ( " # confirmDeleteBtn " ) . attr ( " disabled " ) = = = ! 1 & & this . confirmDelete ( ) } , nop : function ( a ) { a . stopPropagation ( ) } , resetView : function ( ) { var a = function ( a ) { a & & arangoHelper . arangoError ( " Document " , " Could not fetch documents count " ) } . bind ( this ) ; $ ( " input " ) . val ( " " ) , $ ( " select " ) . val ( " = = " ) , this . removeAllFilterItems ( ) , $ ( " # documentSize " ) . val ( this . collection . getPageSize ( ) ) , $ ( " # documents_last " ) . css ( " visibility " , " visible " ) , $ ( " # documents_first " ) . css ( " visibility " , " visible " ) , this . addDocumentSwitch = ! 0 , this . collection . resetFilter ( ) , this . collection . loadTotal ( a ) , this . restoredFilters = [ ] , this . allowUpload = ! 1 , this . files = void 0 , this . file = void 0 , $ ( " # confirmDocImport " ) . attr ( " disabled " , ! 0 ) , this . markFilterToggle ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) } , startDownload : function ( ) { var a = this . collection . buildDownloadDocumentQuery ( ) ; " " ! = = a | | void 0 ! = = a | | null ! = = a ? window . open ( encodeURI ( " query / result / download / " + btoa ( JSON . stringify ( a ) ) ) ) : arangoHelper . arangoError ( " Document error " , " could not download documents " ) } , startUpload : function ( ) { var a = function ( a , b ) { a ? ( arangoHelper . arangoError ( " Upload " , b ) , this . hideSpinner ( ) ) : ( this . hideSpinner ( ) , this . hideImportModal ( ) , this . resetView ( ) ) } . bind ( this ) ; this . allowUpload = = = ! 0 & & ( this . showSpinner ( ) , this . collection . uploadDocuments ( this . file , a ) ) } , uploadSetup : function ( ) { var a = this ; $ ( " # importDocuments " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , $ ( " # confirmDocImport " ) . attr ( " disabled " , ! 1 ) , a . allowUpload = ! 0 } ) } , buildCollectionLink : function ( a ) { return " collection / " + encodeURIComponent ( a . get ( " name " ) ) + " / documents / 1 " } , markFilterToggle : function ( ) { this . restoredFilters . length > 0 ? $ ( " # filterCollection " ) . addClass ( " activated " ) : $ ( " # filterCollection " ) . removeClass ( " activated " ) } , editDocuments : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , this . markFilterToggle ( ) , $ ( " # markDocuments " ) . toggleClass ( " activated " ) , this . changeEditMode ( ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # importHeader " ) . hide ( ) , $ ( " # editHeader " ) . slideToggle ( 200 ) , $ ( " # exportHeader " ) . hide ( ) } , filterCollection : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , this . markFilterToggle ( ) , this . activeFilter = ! 0 , $ ( " # importHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) , $ ( " # exportHeader " ) . hide ( ) , $ ( " # filterHeader " ) . slideToggle ( 200 ) ; var a ; for ( a in this . filters ) if ( this . filters . hasOwnProperty ( a ) ) return void $ ( " # attribute_name " + a ) . focus ( ) } , exportCollection : function ( ) { $ ( " # importCollection " ) . removeClass ( " activated " ) , $ ( " # filterHeader " ) . removeClass ( " activated " ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , $ ( " # exportCollection " ) . toggleClass ( " activated " ) , this . markFilterToggle ( ) , $ ( " # exportHeader " ) . slideToggle ( 200 ) , $ ( " # importHeader " ) . hide ( ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) } , importCollection : function ( ) { this . markFilterToggle ( ) , $ ( " # markDocuments " ) . removeClass ( " activated " ) , this . changeEditMode ( ! 1 ) , $ ( " # importCollection " ) . toggleClass ( " activated " ) , $ ( " # exportCollection " ) . removeClass ( " activated " ) , $ ( " # importHeader " ) . slideToggle ( 200 ) , $ ( " # filterHeader " ) . hide ( ) , $ ( " # editHeader " ) . hide ( ) , $ ( " # exportHeader " ) . hide ( ) } , changeEditMode : function ( a ) { a = = = ! 1 | | this . editMode = = = ! 0 ? ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) . css ( " cursor " , " default " ) , $ ( " . deleteButton " ) . fadeIn ( ) , $ ( " . addButton " ) . fadeIn ( ) , $ ( " . selected - row " ) . removeClass ( " selected - row " ) , this . editMode = ! 1 , this . tableView . setRowClick ( this . clicked . bind ( this ) ) ) : ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) . css ( " cursor " , " copy " ) , $ ( " . deleteButton " ) . fadeOut ( ) , $ ( " . addButton " ) . fadeOut ( ) , $ ( " . selectedCount " ) . text ( 0 ) , this . editMode = ! 0 , this . tableView . setRowClick ( this . editModeClick . bind ( this ) ) ) } , getFilterContent : function ( ) { var a , b , c = [ ] ; for ( a in this . filters ) if ( this . filters . hasOwnProperty ( a ) ) { b = $ ( " # attribute_value " + a ) . val ( ) ; try { b = JSON . parse ( b ) } catch ( d ) { b = String ( b ) } " " ! = = $ ( " # attribute_name " + a ) . val ( ) & & c . push ( { attribute : $ ( " # attribute_name " + a ) . val ( ) , operator : $ ( " # operator " + a ) . val ( ) , value : b } ) } return c } , sendFilter : function ( ) { this . restoredFilters = this . getFilterContent ( ) ; var a = this ; this . collection . resetFilter ( ) , this . addDocumentSwitch = ! 1 , _ . each ( this . restoredFilters , function ( b ) { void 0 ! = = b . operator & & a . collection . addFilter ( b . attribute , b . operator , b . value ) } ) , this . collection . setToFirst ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . markFilterToggle ( ) } , restoreFilter : function ( ) { var a = this , b = 0 ; this . filterId = 0 , $ ( " # docsSort " ) . val ( this . collection . getSort ( ) ) , _ . each ( this . restoredFilters , function ( c ) { 0 ! = = b & & a . addFilterItem ( ) , void 0 ! = = c . operator & & ( $ ( " # attribute_name " + b ) . val ( c . attribute ) , $ ( " # operator " + b ) . val ( c . operator ) , $ ( " # attribute_value " + b ) . val ( c . value ) ) , b + + , a . collection . addFilter ( c . attribute , c . operator , c . value ) } ) } , addFilterItem : function ( ) { var a = + + this . filterId ; $ ( " # filterHeader " ) . append ( ' < div class = " queryline querylineAdd " > < input id = " attribute_name ' + a + ' " type = " text " placeholder = " Attribute name " > < select name = " operator " id = " operator ' + a + ' " class = " filterSelect " > < option value = " = = " > = = < / option > < option value = " ! = " > ! = < / option > < option value = " & lt ; " > & lt ; < / option > < option value = " & lt ; = " > & lt ; = < / option > < option value = " & gt ; = " > & gt ; = < / option > < option value = " & gt ; " > & gt ; < / option > < / select > < input id = " attribute_value ' + a + ' " type = " text " placeholder = " Attribute value " class = " filterValue " > < a class = " removeFilterItem " id = " removeFilter ' + a + ' " > < i class = " icon icon - minus arangoicon " > < / i > < / a > < / div > ' ) , this . filters [ a ] = ! 0 } , filterValueKeydown : function ( a ) { 13 = = = a . keyCode & & this . sendFilter ( ) } , removeFilterItem : function ( a ) { var b = a . currentTarget , c = b . id . replace ( / ^ removeFilter / , " " ) ; delete this . filters [ c ] , delete this . restoredFilters [ c ] , $ ( b . parentElement ) . remove ( ) } , removeAllFilterItems : function ( ) { var a , b = $ ( " # filterHeader " ) . children ( ) . length ; for ( a = 1 ; b > = a ; a + + ) $ ( " # removeFilter " + a ) . parent ( ) . remove ( ) ; this . filters = { 0 : ! 0 } , this . filterId = 0 } , addDocumentModal : function ( ) { var a = window . location . hash . split ( " / " ) [ 1 ] , b = [ ] , c = [ ] , d = function ( a , d ) { a ? arangoHelper . arangoError ( " Error " , " Could not fetch collection type " ) : " edge " = = = d ? ( c . push ( window . modalView . createTextEntry ( " new - edge - from - attr " , " _from " , " " , " document _id : document handle of the linked vertex ( incoming relation ) " , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No _from attribute given . " } ] ) ) , c . push ( window . modalView . createTextEntry ( " new - edge - to " , " _to " , " " , " document _id : document handle of the linked vertex ( outgoing relation ) " , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No _to attribute given . " } ] ) ) , c . push ( window . modalView . createTextEntry ( " new - edge - key - attr " , " _key " , void 0 , " the edges unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSuccessButton ( " Create " , this . addEdge . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create edge " , b , c ) ) : ( c . push ( window . modalView . createTextEntry ( " new - document - key - attr " , " _key " , void 0 , " the documents unique key ( optional attribute , leave empty for autogenerated key " , " is optional : leave empty for autogenerated key " , ! 1 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) , msg : " " } ] ) ) , b . push ( window . modalView . createSuccessButton ( " Create " , this . addDocument . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create document " , b , c ) ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , ! 0 , d ) } , addEdge : function ( ) { var a , b = window . location . hash . split ( " / " ) [ 1 ] , c = $ ( " . modal - body # new - edge - from - attr " ) . last ( ) . val ( ) , d = $ ( " . modal - body # new - edge - to " ) . last ( ) . val ( ) , e = $ ( " . modal - body # new - edge - key - attr " ) . last ( ) . val ( ) , f = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Error " , " Could not create edge " ) ; else { window . modalView . hide ( ) , c = c . _id . split ( " / " ) ; try { a = " collection / " + c [ 0 ] + " / " + c [ 1 ] , decodeURI ( a ) } catch ( d ) { a = " collection / " + c [ 0 ] + " / " + encodeURIComponent ( c [ 1 ] ) } window . location . hash = a } } . bind ( this ) ; " " ! = = e | | void 0 ! = = e ? this . documentStore . createTypeEdge ( b , c , d , e , f ) : this . documentStore . createTypeEdge ( b , c , d , null , f ) } , addDocument : function ( ) { var a , b = window . location . hash . split ( " / " ) [ 1 ] , c = $ ( " . modal - body # new - document - key - attr " ) . last ( ) . val ( ) , d = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Error " , " Could not create document " ) ; else { window . modalView . hide ( ) , c = c . split ( " / " ) ; try { a = " collection / " + c [ 0 ] + " / " + c [ 1 ] , decodeURI ( a ) } catch ( d ) { a = " collection / " + c [ 0 ] + " / " + encodeURIComponent ( c [ 1 ] ) } window . location . hash = a } } . bind ( this ) ; " " ! = = c | | void 0 ! = = c ? this . documentStore . createTypeDocument ( b , c , d ) : this . documentStore . createTypeDocument ( b , null , d ) } , moveSelectedDocs : function ( ) { var a = [ ] , b = [ ] , c = this . getSelectedDocs ( ) ; 0 ! = = c . length & & ( b . push ( window . modalView . createTextEntry ( " move - documents - to " , " Move to " , " " , ! 1 , " collection - name " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Move " , this . confirmMoveSelectedDocs . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Move documents " , a , b ) ) } , confirmMoveSelectedDocs : function ( ) { var a = this . getSelectedDocs ( ) , b = this , c = $ ( " . modal - body " ) . last ( ) . find ( " # move - documents - to " ) . val ( ) , d = function ( ) { this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) } . bind ( this ) ; _ . each ( a , function ( a ) { b . collection . moveDocument ( a , b . collection . collectionID , c , d ) } ) } , deleteSelectedDocs : function ( ) { var a = [ ] , b = [ ] , c = this . getSelectedDocs ( ) ; 0 ! = = c . length & & ( b . push ( window . modalView . createReadOnlyEntry ( void 0 , c . length + " documents selected " , " Do you want to delete all selected documents ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . confirmDeleteSelectedDocs . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete documents " , a , b ) ) } , confirmDeleteSelectedDocs : function ( ) { var a = this . getSelectedDocs ( ) , b = [ ] , c = this ; _ . each ( a , function ( a ) { if ( " document " = = = c . type ) { var d = function ( a ) { a ? ( b . push ( ! 1 ) , arangoHelper . arangoError ( " Document error " , " Could not delete document . " ) ) : ( b . push ( ! 0 ) , c . collection . setTotalMinusOne ( ) , c . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) ) } . bind ( c ) ; c . documentStore . deleteDocument ( c . collection . collectionID , a , d ) } else if ( " edge " = = = c . type ) { var e = function ( a ) { a ? ( b . push ( ! 1 ) , arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) ) : ( c . collection . setTotalMinusOne ( ) , b . push ( ! 0 ) , c . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # markDocuments " ) . click ( ) , window . modalView . hide ( ) ) } . bind ( c ) ; c . documentStore . deleteEdge ( c . collection . collectionID , a , e ) } } ) } , getSelectedDocs : function ( ) { var a = [ ] ; return _ . each ( $ ( " # docPureTable . pure - table - body . pure - table - row " ) , function ( b ) { $ ( b ) . hasClass ( " selected - row " ) & & a . push ( $ ( $ ( b ) . children ( ) [ 1 ] ) . find ( " . key " ) . text ( ) ) } ) , a } , remove : function ( a ) { this . docid = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . find ( " . key " ) . text ( ) , $ ( " # confirmDeleteBtn " ) . attr ( " disabled " , ! 1 ) , $ ( " # docDeleteModal " ) . modal ( " show " ) } , confirmDelete : function ( ) { $ ( " # confirmDeleteBtn " ) . attr ( " disabled " , ! 0 ) ; var a = window . location . hash . split ( " / " ) , b = a [ 3 ] ; " source " ! = = b & & this . reallyDelete ( ) } , reallyDelete : function ( ) { if ( " document " = = = this . type ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Error " , " Could not delete document " ) : ( this . collection . setTotalMinusOne ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # docDeleteModal " ) . modal ( " hide " ) ) } . bind ( this ) ; this . documentStore . deleteDocument ( this . collection . collectionID , this . docid , a ) } else if ( " edge " = = = this . type ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Edge error " , " Could not delete edge " ) : ( this . collection . setTotalMinusOne ( ) , this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , $ ( " # docDeleteModal " ) . modal ( " hide " ) ) } . bind ( this ) ; this . documentStore . deleteEdge ( this . collection . collectionID , this . docid , b ) } } , editModeClick : function ( a ) { var b = $ ( a . currentTarget ) ; b . hasClass ( " selected - row " ) ? b . removeClass ( " selected - row " ) : b . addClass ( " selected - row " ) , console . log ( b ) ; var c = this . getSelectedDocs ( ) ; $ ( " . selectedCount " ) . text ( c . length ) , _ . each ( this . editButtons , function ( a ) { c . length > 0 ? ( $ ( a ) . prop ( " disabled " , ! 1 ) , $ ( a ) . removeClass ( " button - neutral " ) , $ ( a ) . removeClass ( " disabled " ) , " # moveSelected " = = = a ? $ ( a ) . addClass ( " button - success " ) : $ ( a ) . addClass ( " button - danger " ) ) : ( $ ( a ) . prop ( " disabled " , ! 0 ) , $ ( a ) . addClass ( " disabled " ) , $ ( a ) . addClass ( " button - neutral " ) , " # moveSelected " = = = a ? $ ( a ) . removeClass ( " button - success " ) : $ ( a ) . removeClass ( " button - danger " ) ) } ) } , clicked : function ( a ) { var b , c = a . currentTarget , d = $ ( c ) . attr ( " id " ) . substr ( 4 ) ; try { b = " collection / " + this . collection . collectionID + " / " + d , decodeURI ( d ) } catch ( e ) { b = " collection / " + this . collection . collectionID + " / " + encodeURIComponent ( d ) } window . location . hash = b } , drawTable : function ( ) { this . tableView . setElement ( $ ( " # docPureTable " ) ) . render ( ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " top " ) , $ ( " . prettify " ) . snippet ( " javascript " , { style : " nedit " , menu : ! 1 , startText : ! 1 , transparent : ! 0 , showNum : ! 1 } ) , this . resize ( ) } , checkCollectionState : function ( ) { this . lastCollectionName = = = this . collectionName ? this . activeFilter & & ( this . filterCollection ( ) , this . restoreFilter ( ) ) : void 0 ! = = this . lastCollectionName & & ( this . collection . resetFilter ( ) , this . collection . setSort ( " " ) , this . restoredFilters = [ ] , this . activeFilter = ! 1 ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , 2 = = = this . type ? this . type = " document " : 3 = = = this . type & & ( this . type = " edge " ) , this . tableView . setElement ( $ ( this . table ) ) . drawLoading ( ) , this . collectionContext = this . collectionsStore . getPosition ( this . collection . collectionID ) , this . collectionName = window . location . hash . split ( " / " ) [ 1 ] , this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Content " ) , this . checkCollectionState ( ) , this . lastCollectionName = this . collectionName , this . uploadSetup ( ) , $ ( " [ data - toggle = tooltip ] " ) . tooltip ( ) , $ ( " . upload - info " ) . tooltip ( ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " top " ) , this . renderPaginationElements ( ) , this . selectActivePagesize ( ) , this . markFilterToggle ( ) , this . resize ( ) , this } , rerender : function ( ) { this . collection . getDocuments ( this . getDocsCallback . bind ( this ) ) , this . resize ( ) } , selectActivePagesize : function ( ) { $ ( " # documentSize " ) . val ( this . collection . getPageSize ( ) ) } , renderPaginationElements : function ( ) { this . renderPagination ( ) ; var a = $ ( " # totalDocuments " ) ; 0 = = = a . length & & ( $ ( " # documentsToolbarFL " ) . append ( ' < a id = " totalDocuments " class = " totalDocuments " > < / a > ' ) , a = $ ( " # totalDocuments " ) ) , " document " = = = this . type & & a . html ( numeral ( this . collection . getTotal ( ) ) . format ( " 0 , 0 " ) + " document ( s ) " ) , " edge " = = = this . type & & a . html ( numeral ( this . collection . getTotal ( ) ) . format ( " 0 , 0 " ) + " edge ( s ) " ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } } ) } ( ) , function ( ) { " use strict " ; window . EditListEntryView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " editListEntryView . ejs " ) , initialize : function ( a ) { this . key = a . key , this . value = a . value , this . render ( ) } , events : { " click . deleteAttribute " : " removeRow " } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { key : this . key , value : JSON . stringify ( this . value ) , isReadOnly : this . isReadOnly ( ) } ) ) } , isReadOnly : function ( ) { return 0 = = = this . key . indexOf ( " _ " ) } , getKey : function ( ) { return $ ( " . key " ) . val ( ) } , getValue : function ( ) { var val = $ ( " . val " ) . val ( ) ; try { val = JSON . parse ( val ) } catch ( e ) { try { return eval ( " val = " + val ) , val } catch ( e2 ) { return $ ( " . val " ) . val ( ) } } return val } , removeRow : function ( ) { this . remove ( ) } } ) } ( ) , function ( ) { " use strict " ; window . FooterView = Backbone . View . extend ( { el : " # footerBar " , system : { } , isOffline : ! 0 , isOfflineCounter : 0 , firstLogin : ! 0 , timer : 15e3 , lap : 0 , timerFunction : null , events : { " click . footer - center p " : " showShortcutModal " } , initialize : function ( ) { var a = this ; window . setInterval ( function ( ) { a . getVersion ( ) } , a . timer ) , a . getVersion ( ) , window . VISIBLE = ! 0 , document . addEventListener ( " visibilitychange " , function ( ) { window . VISIBLE = ! window . VISIBLE } ) , $ ( " # offlinePlaceholder button " ) . on ( " click " , function ( ) { a . getVersion ( ) } ) } , template : templateEngine . createTemplate ( " footerView . ejs " ) , showServerStatus : function ( a ) { var b = this ; window . App . isCluster ? b . collection . fetch ( { success : function ( ) { b . renderClusterState ( ! 0 ) } , error : function ( ) { b . renderClusterState ( ! 1 ) } } ) : a = = = ! 0 ? ( $ ( " # healthStatus " ) . removeClass ( " negative " ) , $ ( " # healthStatus " ) . addClass ( " positive " ) , $ ( " . health - state " ) . html ( " GOOD " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - check - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . hide ( ) ) : ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , $ ( " . health - state " ) . html ( " UNKNOWN " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . show ( ) , this . reconnectAnimation ( 0 ) ) } , reconnectAnimation : function ( a ) { var b = this ; 0 = = = a & & ( b . lap = a , $ ( " # offlineSeconds " ) . text ( b . timer / 1e3 ) , clearTimeout ( b . timerFunction ) ) , b . lap < this . timer / 1e3 & & ( b . lap + + , $ ( " # offlineSeconds " ) . text ( b . timer / 1e3 - b . lap ) , b . timerFunction = window . setTimeout ( function ( ) { b . timer / 1e3 - b . lap = = = 0 ? b . getVersion ( ) : b . reconnectAnimation ( b . lap ) } , 1e3 ) ) } , renderClusterState : function ( a ) { var b = 0 ; a ? ( $ ( " # offlinePlaceholder " ) . hide ( ) , this . collection . each ( function ( a ) { " ok " ! = = a . toJSON ( ) . status & & b + + } ) , b > 0 ? ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , 1 = = = b ? $ ( " . health - state " ) . html ( b + " NODE ERROR " ) : $ ( " . health - state " ) . html ( b + " NODES ERROR " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) ) : ( $ ( " # healthStatus " ) . removeClass ( " negative " ) , $ ( " # healthStatus " ) . addClass ( " positive " ) , $ ( " . health - state " ) . html ( " NODES OK " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - check - circle " > < / i > ' ) ) ) : ( $ ( " # healthStatus " ) . removeClass ( " positive " ) , $ ( " # healthStatus " ) . addClass ( " negative " ) , $ ( " . health - state " ) . html ( window . location . host + " OFFLINE " ) , $ ( " . health - icon " ) . html ( ' < i class = " fa fa - exclamation - circle " > < / i > ' ) , $ ( " # offlinePlaceholder " ) . show ( ) , this . reconnectAnimation ( 0 ) ) } , showShortcutModal : function ( ) { window . arangoHelper . hotkeysFunctions . showHotkeysModal ( ) } , getVersion : function ( ) { var a = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / version " ) , <nl> contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { a . showServerStatus ( ! 0 ) , a . isOffline = = = ! 0 & & ( a . isOffline = ! 1 , a . isOfflineCounter = 0 , a . firstLogin ? a . firstLogin = ! 1 : window . setTimeout ( function ( ) { a . showServerStatus ( ! 0 ) } , 1e3 ) , a . system . name = b . server , a . system . version = b . version , a . render ( ) ) } , error : function ( ) { a . isOffline = ! 0 , a . isOfflineCounter + + , a . isOfflineCounter > = 1 & & a . showServerStatus ( ! 1 ) } } ) , a . system . hasOwnProperty ( " database " ) | | $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / database / current " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { var c = b . result . name ; a . system . database = c ; var d = window . setInterval ( function ( ) { var b = $ ( " # databaseNavi " ) ; b & & ( window . clearTimeout ( d ) , d = null , a . render ( ) ) } , 50 ) } } ) } , renderVersion : function ( ) { this . system . hasOwnProperty ( " database " ) & & this . system . hasOwnProperty ( " name " ) & & $ ( this . el ) . html ( this . template . render ( { name : this . system . name , version : this . system . version , database : this . system . database } ) ) } , render : function ( ) { return this . system . version | | this . getVersion ( ) , $ ( this . el ) . html ( this . template . render ( { name : this . system . name , version : this . system . version } ) ) , this } } ) } ( ) , function ( ) { " use strict " ; window . FoxxActiveView = Backbone . View . extend ( { tagName : " div " , className : " tile pure - u - 1 - 1 pure - u - sm - 1 - 2 pure - u - md - 1 - 3 pure - u - lg - 1 - 4 pure - u - xl - 1 - 6 " , template : templateEngine . createTemplate ( " foxxActiveView . ejs " ) , _show : ! 0 , events : { click : " openAppDetailView " } , openAppDetailView : function ( ) { window . App . navigate ( " service / " + encodeURIComponent ( this . model . get ( " mount " ) ) , { trigger : ! 0 } ) } , toggle : function ( a , b ) { switch ( a ) { case " devel " : this . model . isDevelopment ( ) & & ( this . _show = b ) ; break ; case " production " : this . model . isDevelopment ( ) | | this . model . isSystem ( ) | | ( this . _show = b ) ; break ; case " system " : this . model . isSystem ( ) & & ( this . _show = b ) } this . _show ? $ ( this . el ) . show ( ) : $ ( this . el ) . hide ( ) } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { model : this . model } ) ) ; var a = function ( ) { this . model . needsConfiguration ( ) & & ( $ ( this . el ) . find ( " . warning - icons " ) . length > 0 ? $ ( this . el ) . find ( " . warning - icons " ) . append ( ' < span class = " fa fa - cog " title = " Needs configuration " > < / span > ' ) : $ ( this . el ) . find ( " img " ) . after ( ' < span class = " warning - icons " > < span class = " fa fa - cog " title = " Needs configuration " > < / span > < / span > ' ) ) } . bind ( this ) , b = function ( ) { this . model . hasUnconfiguredDependencies ( ) & & ( $ ( this . el ) . find ( " . warning - icons " ) . length > 0 ? $ ( this . el ) . find ( " . warning - icons " ) . append ( ' < span class = " fa fa - cubes " title = " Unconfigured dependencies " > < / span > ' ) : $ ( this . el ) . find ( " img " ) . after ( ' < span class = " warning - icons " > < span class = " fa fa - cubes " title = " Unconfigured dependencies " > < / span > < / span > ' ) ) } . bind ( this ) ; return this . model . getConfiguration ( a ) , this . model . getDependencies ( b ) , $ ( this . el ) } } ) } ( ) , function ( ) { " use strict " ; var a = { ERROR_APPLICATION_DOWNLOAD_FAILED : { code : 1752 , message : " application download failed " } } , b = templateEngine . createTemplate ( " applicationListView . ejs " ) , c = function ( a ) { this . collection = a . collection } , d = function ( b ) { var c = this ; if ( b . error = = = ! 1 ) this . collection . fetch ( { success : function ( ) { window . modalView . hide ( ) , c . reload ( ) } } ) ; else { var d = b ; switch ( b . hasOwnProperty ( " responseJSON " ) & & ( d = b . responseJSON ) , d . errorNum ) { case a . ERROR_APPLICATION_DOWNLOAD_FAILED . code : arangoHelper . arangoError ( " Services " , " Unable to download application from the given repository . " ) ; break ; default : arangoHelper . arangoError ( " Services " , d . errorNum + " . " + d . errorMessage ) } } } , e = function ( ) { window . modalView . modalBindValidation ( { id : " new - app - mount " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . regex ( / ^ ( \ / ( APP [ ^ \ / ] + | ( ? ! APP ) [ a - zA - Z0 - 9_ \ - % ] + ) ) + $ / i ) , msg : " May not contain / APP " } , { rule : Joi . string ( ) . regex ( / ^ ( \ / [ a - zA - Z0 - 9_ \ - % ] + ) + $ / ) , msg : " Can only contain [ a - zA - Z0 - 9_ - % ] " } , { rule : Joi . string ( ) . regex ( / ^ \ / ( [ ^ _ ] | _open \ / ) / ) , msg : " Mountpoints with _ are reserved for internal use " } , { rule : Joi . string ( ) . regex ( / [ ^ \ / ] $ / ) , msg : " May not end with / " } , { rule : Joi . string ( ) . regex ( / ^ \ / / ) , msg : " Has to start with / " } , { rule : Joi . string ( ) . required ( ) . min ( 2 ) , msg : " Has to be non - empty " } ] } } ) } , f = function ( ) { window . modalView . modalBindValidation ( { id : " repository " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . regex ( / ^ [ a - zA - Z0 - 9_ \ - ] + \ / [ a - zA - Z0 - 9_ \ - ] + $ / ) , msg : " No valid Github account and repository . " } ] } } ) } , g = function ( ) { window . modalView . modalBindValidation ( { id : " new - app - author " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . min ( 1 ) , msg : " Has to be non empty . " } ] } } ) , window . modalView . modalBindValidation ( { id : " new - app - name " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . regex ( / ^ [ a - zA - Z \ - _ ] [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : " Can only contain a to z , A to Z , 0 - 9 , ' - ' and ' _ ' . " } ] } } ) , window . modalView . modalBindValidation ( { id : " new - app - description " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . min ( 1 ) , msg : " Has to be non empty . " } ] } } ) , window . modalView . modalBindValidation ( { id : " new - app - license " , validateInput : function ( ) { return [ { rule : Joi . string ( ) . required ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ . , ; \ - ] + $ / ) , msg : " Has to be non empty . " } ] } } ) , window . modalView . modalTestAll ( ) } , h = function ( a ) { window . modalView . clearValidators ( ) ; var b = $ ( " # modalButton1 " ) ; switch ( this . _upgrade | | e ( ) , a ) { case " newApp " : b . html ( " Generate " ) , b . prop ( " disabled " , ! 1 ) , g ( ) ; break ; case " appstore " : b . html ( " Install " ) , b . prop ( " disabled " , ! 0 ) ; break ; case " github " : f ( ) , b . html ( " Install " ) , b . prop ( " disabled " , ! 1 ) ; break ; case " zip " : b . html ( " Install " ) , b . prop ( " disabled " , ! 1 ) } b . prop ( " disabled " ) | | window . modalView . modalTestAll ( ) | | b . prop ( " disabled " , ! 0 ) } , i = function ( a ) { var b = $ ( a . currentTarget ) . attr ( " href " ) . substr ( 1 ) ; h . call ( this , b ) } , j = function ( a ) { if ( h . call ( this , " appstore " ) , window . modalView . modalTestAll ( ) ) { var b , c ; this . _upgrade ? ( b = this . mount , c = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : b = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) ; var e = $ ( a . currentTarget ) . attr ( " appId " ) , f = $ ( a . currentTarget ) . attr ( " appVersion " ) ; void 0 ! = = c ? this . collection . installFromStore ( { name : e , version : f } , b , d . bind ( this ) , c ) : this . collection . installFromStore ( { name : e , version : f } , b , d . bind ( this ) ) } } , k = function ( a , b ) { if ( void 0 = = = b ? b = this . _uploadData : this . _uploadData = b , b & & window . modalView . modalTestAll ( ) ) { var c , e ; this . _upgrade ? ( c = this . mount , e = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : c = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) , void 0 ! = = e ? this . collection . installFromZip ( b . filename , c , d . bind ( this ) , e ) : this . collection . installFromZip ( b . filename , c , d . bind ( this ) ) } } , l = function ( ) { if ( window . modalView . modalTestAll ( ) ) { var a , b , c , e ; this . _upgrade ? ( c = this . mount , e = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : c = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) , a = window . arangoHelper . escapeHtml ( $ ( " # repository " ) . val ( ) ) , b = window . arangoHelper . escapeHtml ( $ ( " # tag " ) . val ( ) ) , " " = = = b & & ( b = " master " ) ; var f = { url : window . arangoHelper . escapeHtml ( $ ( " # repository " ) . val ( ) ) , version : window . arangoHelper . escapeHtml ( $ ( " # tag " ) . val ( ) ) } ; try { Joi . assert ( a , Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9_ \ - ] + \ / [ a - zA - Z0 - 9_ \ - ] + $ / ) ) } catch ( g ) { return } void 0 ! = = e ? this . collection . installFromGithub ( f , c , d . bind ( this ) , e ) : this . collection . installFromGithub ( f , c , d . bind ( this ) ) } } , m = function ( ) { if ( window . modalView . modalTestAll ( ) ) { var a , b ; this . _upgrade ? ( a = this . mount , b = $ ( " # new - app - teardown " ) . prop ( " checked " ) ) : a = window . arangoHelper . escapeHtml ( $ ( " # new - app - mount " ) . val ( ) ) ; var c = { name : window . arangoHelper . escapeHtml ( $ ( " # new - app - name " ) . val ( ) ) , documentCollections : _ . map ( $ ( " # new - app - document - collections " ) . select2 ( " data " ) , function ( a ) { return window . arangoHelper . escapeHtml ( a . text ) } ) , edgeCollections : _ . map ( $ ( " # new - app - edge - collections " ) . select2 ( " data " ) , function ( a ) { return window . arangoHelper . escapeHtml ( a . text ) } ) , author : window . arangoHelper . escapeHtml ( $ ( " # new - app - author " ) . val ( ) ) , license : window . arangoHelper . escapeHtml ( $ ( " # new - app - license " ) . val ( ) ) , description : window . arangoHelper . escapeHtml ( $ ( " # new - app - description " ) . val ( ) ) } ; void 0 ! = = b ? this . collection . generate ( c , a , d . bind ( this ) , b ) : this . collection . generate ( c , a , d . bind ( this ) ) } } , n = function ( ) { var a = $ ( " . modal - body . tab - pane . active " ) . attr ( " id " ) ; switch ( a ) { case " newApp " : m . apply ( this ) ; break ; case " github " : l . apply ( this ) ; break ; case " zip " : k . apply ( this ) } } , o = function ( a , c ) { var d = [ ] , e = { " click # infoTab a " : i . bind ( a ) , " click . install - app " : j . bind ( a ) } ; d . push ( window . modalView . createSuccessButton ( " Generate " , n . bind ( a ) ) ) , window . modalView . show ( " modalApplicationMount . ejs " , " Install Service " , d , c , void 0 , void 0 , e ) , $ ( " # new - app - document - collections " ) . select2 ( { tags : [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " } ) , $ ( " # new - app - edge - collections " ) . select2 ( { tags : [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " } ) ; var f = function ( ) { var a = $ ( " # modalButton1 " ) ; a . prop ( " disabled " ) | | window . modalView . modalTestAll ( ) ? a . prop ( " disabled " , ! 1 ) : a . prop ( " disabled " , ! 0 ) } ; $ ( " . select2 - search - field input " ) . focusout ( function ( ) { f ( ) , window . setTimeout ( function ( ) { $ ( " . select2 - drop " ) . is ( " : visible " ) & & ( $ ( " # select2 - search - field input " ) . is ( " : focus " ) | | ( $ ( " # s2id_new - app - document - collections " ) . select2 ( " close " ) , $ ( " # s2id_new - app - edge - collections " ) . select2 ( " close " ) , f ( ) ) ) } , 80 ) } ) , $ ( " . select2 - search - field input " ) . focusin ( function ( ) { if ( $ ( " . select2 - drop " ) . is ( " : visible " ) ) { var a = $ ( " # modalButton1 " ) ; a . prop ( " disabled " , ! 0 ) } } ) , $ ( " # upload - foxx - zip " ) . uploadFile ( { url : arangoHelper . databaseUrl ( " / _api / upload ? multipart = true " ) , allowedTypes : " zip " , multiple : ! 1 , onSuccess : k . bind ( a ) } ) , $ . get ( " foxxes / fishbowl " , function ( a ) { var c = $ ( " # appstore - content " ) ; c . html ( " " ) , _ . each ( _ . sortBy ( a , " name " ) , function ( a ) { c . append ( b . render ( a ) ) } ) } ) . fail ( function ( ) { var a = $ ( " # appstore - content " ) ; a . append ( " < tr > < td > Store is not available . ArangoDB is not able to connect to github . com < / td > < / tr > " ) } ) } ; c . prototype . install = function ( a ) { this . reload = a , this . _upgrade = ! 1 , this . _uploadData = void 0 , delete this . mount , o ( this , ! 1 ) , window . modalView . clearValidators ( ) , e ( ) , g ( ) } , c . prototype . upgrade = function ( a , b ) { this . reload = b , this . _upgrade = ! 0 , this . _uploadData = void 0 , this . mount = a , o ( this , ! 0 ) , window . modalView . clearValidators ( ) , g ( ) } , window . FoxxInstallView = c } ( ) , function ( ) { " use strict " ; window . GraphManagementView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " graphManagementView . ejs " ) , edgeDefintionTemplate : templateEngine . createTemplate ( " edgeDefinitionTable . ejs " ) , eCollList : [ ] , removedECollList : [ ] , dropdownVisible : ! 1 , initialize : function ( a ) { this . options = a } , events : { " click # deleteGraph " : " deleteGraph " , " click . icon_arangodb_settings2 . editGraph " : " editGraph " , " click # createGraph " : " addNewGraph " , " keyup # graphManagementSearchInput " : " search " , " click # graphManagementSearchSubmit " : " search " , " click . tile - graph " : " redirectToGraphViewer " , " click # graphManagementToggle " : " toggleGraphDropdown " , " click . css - label " : " checkBoxes " , " change # graphSortDesc " : " sorting " } , toggleTab : function ( a ) { var b = a . currentTarget . id ; b = b . replace ( " tab - " , " " ) , $ ( " # tab - content - create - graph . tab - pane " ) . removeClass ( " active " ) , $ ( " # tab - content - create - graph # " + b ) . addClass ( " active " ) , " exampleGraphs " = = = b ? $ ( " # modal - dialog . modal - footer . button - success " ) . css ( " display " , " none " ) : $ ( " # modal - dialog . modal - footer . button - success " ) . css ( " display " , " initial " ) } , redirectToGraphViewer : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " id " ) ; b = b . substr ( 0 , b . length - 5 ) , window . location = window . location + " / " + encodeURIComponent ( b ) } , loadGraphViewer : function ( a , b ) { var c = function ( b ) { if ( b ) arangoHelper . arangoError ( " " , " " ) ; else { var c = this . collection . get ( a ) . get ( " edgeDefinitions " ) ; if ( ! c | | 0 = = = c . length ) return ; var d = { type : " gharial " , graphName : a , baseUrl : arangoHelper . databaseUrl ( " / " ) } , e = $ ( " # content " ) . width ( ) - 75 ; $ ( " # content " ) . html ( " " ) ; var f = arangoHelper . calculateCenterDivHeight ( ) ; this . ui = new GraphViewerUI ( $ ( " # content " ) [ 0 ] , d , e , $ ( " . centralRow " ) . height ( ) - 135 , { nodeShaper : { label : " _key " , color : { type : " attribute " , key : " _key " } } } , ! 0 ) , $ ( " . contentDiv " ) . height ( f ) } } . bind ( this ) ; b ? this . collection . fetch ( { success : function ( ) { c ( ) } } ) : c ( ) } , handleResize : function ( a ) { this . width & & this . width = = = a | | ( this . width = a , this . ui & & this . ui . changeWidth ( a ) ) } , addNewGraph : function ( a ) { a . preventDefault ( ) , this . createEditGraphModal ( ) } , deleteGraph : function ( ) { var a = this , b = $ ( " # editGraphName " ) [ 0 ] . value ; if ( $ ( " # dropGraphCollections " ) . is ( " : checked " ) ) { var c = function ( c ) { c ? ( a . collection . remove ( a . collection . get ( b ) ) , a . updateGraphManagementView ( ) , window . modalView . hide ( ) ) : ( window . modalView . hide ( ) , arangoHelper . arangoError ( " Graph " , " Could not delete Graph . " ) ) } . bind ( this ) ; this . collection . dropAndDeleteGraph ( b , c ) } else this . collection . get ( b ) . destroy ( { success : function ( ) { a . updateGraphManagementView ( ) , window . modalView . hide ( ) } , error : function ( a , b ) { var c = JSON . parse ( b . responseText ) , d = c . errorMessage ; arangoHelper . arangoError ( d ) , window . modalView . hide ( ) } } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , toggleGraphDropdown : function ( ) { $ ( " # graphSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # graphManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # graphManagementDropdown2 " ) . slideToggle ( 200 ) } , sorting : function ( ) { $ ( " # graphSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # graphManagementDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , createExampleGraphs : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " graph - id " ) , c = this ; $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / graph - examples / create / " + encodeURIComponent ( b ) ) , success : function ( ) { window . modalView . hide ( ) , c . updateGraphManagementView ( ) , arangoHelper . arangoNotification ( " Example Graphs " , " Graph : " + b + " created . " ) } , error : function ( a ) { if ( window . modalView . hide ( ) , console . log ( a ) , a . responseText ) try { var c = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " Example Graphs " , c . errorMessage ) } catch ( d ) { arangoHelper . arangoError ( " Example Graphs " , " Could not create example graph : " + b ) } else arangoHelper . arangoError ( " Example Graphs " , " Could not create example graph : " + b ) } } ) } , render : function ( a , b ) { var c = this ; return this . collection . fetch ( { success : function ( ) { c . collection . sort ( ) , $ ( c . el ) . html ( c . template . render ( { graphs : c . collection , searchString : " " } ) ) , c . dropdownVisible = = = ! 0 & & ( $ ( " # graphManagementDropdown2 " ) . show ( ) , $ ( " # graphSortDesc " ) . attr ( " checked " , c . collection . sortOptions . desc ) , $ ( " # graphManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # graphManagementDropdown " ) . show ( ) ) , c . events [ " click . tableRow " ] = c . showHideDefinition . bind ( c ) , c . events [ ' change tr [ id * = " newEdgeDefinitions " ] ' ] = c . setFromAndTo . bind ( c ) , c . events [ " click . graphViewer - icon - button " ] = c . addRemoveDefinition . bind ( c ) , c . events [ " click # graphTab a " ] = c . toggleTab . bind ( c ) , c . events [ " click . createExampleGraphs " ] = c . createExampleGraphs . bind ( c ) , c . events [ " focusout . select2 - search - field input " ] = function ( a ) { $ ( " . select2 - drop " ) . is ( " : visible " ) & & ( $ ( " # select2 - search - field input " ) . is ( " : focus " ) | | window . setTimeout ( function ( ) { $ ( a . currentTarget ) . parent ( ) . parent ( ) . parent ( ) . select2 ( " close " ) } , 80 ) ) } . bind ( c ) , arangoHelper . setCheckboxStatus ( " # graphManagementDropdown " ) } } ) , a & & this . loadGraphViewer ( a , b ) , this } , setFromAndTo : function ( a ) { a . stopPropagation ( ) ; var b , c = this . calculateEdgeDefinitionMap ( ) ; if ( a . added ) { if ( - 1 = = = this . eCollList . indexOf ( a . added . id ) & & - 1 ! = = this . removedECollList . indexOf ( a . added . id ) ) return b = a . currentTarget . id . split ( " row_newEdgeDefinitions " ) [ 1 ] , $ ( ' input [ id * = " newEdgeDefinitions ' + b + ' " ] ' ) . select2 ( " val " , null ) , void $ ( ' input [ id * = " newEdgeDefinitions ' + b + ' " ] ' ) . attr ( " placeholder " , " The collection " + a . added . id + " is already used . " ) ; this . removedECollList . push ( a . added . id ) , this . eCollList . splice ( this . eCollList . indexOf ( a . added . id ) , 1 ) } else this . eCollList . push ( a . removed . id ) , this . removedECollList . splice ( this . removedECollList . indexOf ( a . removed . id ) , 1 ) ; c [ a . val ] ? ( b = a . currentTarget . id . split ( " row_newEdgeDefinitions " ) [ 1 ] , $ ( " # s2id_fromCollections " + b ) . select2 ( " val " , c [ a . val ] . from ) , $ ( " # fromCollections " + b ) . attr ( " disabled " , ! 0 ) , $ ( " # s2id_toCollections " + b ) . select2 ( " val " , c [ a . val ] . to ) , $ ( " # toCollections " + b ) . attr ( " disabled " , ! 0 ) ) : ( b = a . currentTarget . id . split ( " row_newEdgeDefinitions " ) [ 1 ] , $ ( " # s2id_fromCollections " + b ) . select2 ( " val " , null ) , $ ( " # fromCollections " + b ) . attr ( " disabled " , ! 1 ) , $ ( " # s2id_toCollections " + b ) . select2 ( " val " , null ) , $ ( " # toCollections " + b ) . attr ( " disabled " , ! 1 ) ) } , editGraph : function ( a ) { a . stopPropagation ( ) , this . collection . fetch ( ) , this . graphToEdit = this . evaluateGraphName ( $ ( a . currentTarget ) . attr ( " id " ) , " _settings " ) ; var b = this . collection . findWhere ( { _key : this . graphToEdit } ) ; this . createEditGraphModal ( b ) } , saveEditedGraph : function ( ) { var a , b , c , d , e , f = $ ( " # editGraphName " ) [ 0 ] . value , g = _ . pluck ( $ ( " # newVertexCollections " ) . select2 ( " data " ) , " text " ) , h = [ ] , i = { } ; if ( e = $ ( " [ id ^ = s2id_newEdgeDefinitions ] " ) . toArray ( ) , e . forEach ( function ( e ) { if ( d = $ ( e ) . attr ( " id " ) , d = d . replace ( " s2id_newEdgeDefinitions " , " " ) , a = _ . pluck ( $ ( " # s2id_newEdgeDefinitions " + d ) . select2 ( " data " ) , " text " ) [ 0 ] , a & & " " ! = = a & & ( b = _ . pluck ( $ ( " # s2id_fromCollections " + d ) . select2 ( " data " ) , " text " ) , c = _ . pluck ( $ ( " # s2id_toCollections " + d ) . select2 ( " data " ) , " text " ) , 0 ! = = b . length & & 0 ! = = c . length ) ) { var f = { collection : a , from : b , to : c } ; h . push ( f ) , i [ a ] = f } } ) , 0 = = = h . length ) return $ ( " # s2id_newEdgeDefinitions0 . select2 - choices " ) . css ( " border - color " , " red " ) , $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) , void $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) ; var j = this . collection . findWhere ( { _key : f } ) , k = j . get ( " edgeDefinitions " ) , l = j . get ( " orphanCollections " ) , m = [ ] ; l . forEach ( function ( a ) { - 1 = = = g . indexOf ( a ) & & j . deleteVertexCollection ( a ) } ) , g . forEach ( function ( a ) { - 1 = = = l . indexOf ( a ) & & j . addVertexCollection ( a ) } ) ; var n = [ ] , o = [ ] , p = [ ] ; k . forEach ( function ( a ) { var b = a . collection ; m . push ( b ) ; var c = i [ b ] ; void 0 = = = c ? p . push ( b ) : JSON . stringify ( c ) ! = = JSON . stringify ( a ) & & o . push ( b ) } ) , h . forEach ( function ( a ) { var b = a . collection ; - 1 = = = m . indexOf ( b ) & & n . push ( b ) } ) , n . forEach ( function ( a ) { j . addEdgeDefinition ( i [ a ] ) } ) , o . forEach ( function ( a ) { j . modifyEdgeDefinition ( i [ a ] ) } ) , p . forEach ( function ( a ) { j . deleteEdgeDefinition ( a ) } ) , this . updateGraphManagementView ( ) , window . modalView . hide ( ) } , evaluateGraphName : function ( a , b ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } , search : function ( ) { var a , b , c , d ; a = $ ( " # graphManagementSearchInput " ) , b = $ ( " # graphManagementSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return - 1 ! = = a . get ( " _key " ) . indexOf ( b ) } ) , $ ( this . el ) . html ( this . template . render ( { graphs : d , searchString : b } ) ) , a = $ ( " # graphManagementSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , updateGraphManagementView : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , createNewGraph : function ( ) { var a , b , c , d , e , f = $ ( " # createNewGraphName " ) . val ( ) , g = _ . pluck ( $ ( " # newVertexCollections " ) . select2 ( " data " ) , " text " ) , h = [ ] , i = this ; return f ? this . collection . findWhere ( { _key : f } ) ? ( arangoHelper . arangoError ( " The graph ' " + f + " ' already exists . " ) , 0 ) : ( e = $ ( " [ id ^ = s2id_newEdgeDefinitions ] " ) . toArray ( ) , e . forEach ( function ( e ) { d = $ ( e ) . attr ( " id " ) , d = d . replace ( " s2id_newEdgeDefinitions " , " " ) , a = _ . pluck ( $ ( " # s2id_newEdgeDefinitions " + d ) . select2 ( " data " ) , " text " ) [ 0 ] , a & & " " ! = = a & & ( b = _ . pluck ( $ ( " # s2id_fromCollections " + d ) . select2 ( " data " ) , " text " ) , c = _ . pluck ( $ ( " # s2id_toCollections " + d ) . select2 ( " data " ) , " text " ) , 1 ! = = b & & 1 ! = = c & & h . push ( { collection : a , from : b , to : c } ) ) } ) , 0 = = = h . length ? ( $ ( " # s2id_newEdgeDefinitions0 . select2 - choices " ) . css ( " border - color " , " red " ) , $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) , void $ ( " # s2id_newEdgeDefinitions0 " ) . parent ( ) . parent ( ) . next ( ) . next ( ) . find ( " . select2 - choices " ) . css ( " border - color " , " red " ) ) : void this . collection . create ( { name : f , edgeDefinitions : h , orphanCollections : g } , { success : function ( ) { i . updateGraphManagementView ( ) , window . modalView . hide ( ) } , error : function ( a , b ) { var c = JSON . parse ( b . responseText ) , d = c . errorMessage ; d = d . replace ( " < " , " " ) , d = d . replace ( " > " , " " ) , arangoHelper . arangoError ( d ) } } ) ) : ( arangoHelper . arangoError ( " A name for the graph has to be provided . " ) , 0 ) } , createEditGraphModal : function ( a ) { var b , c = [ ] , d = [ ] , e = [ ] , f = this . options . collectionCollection . models , g = this , h = " " , i = [ { collection : " " , from : " " , to : " " } ] , j = " " , k = function ( a , b ) { return a = a . toLowerCase ( ) , b = b . toLowerCase ( ) , b > a ? - 1 : a > b ? 1 : 0 } ; if ( this . eCollList = [ ] , this . removedECollList = [ ] , f . forEach ( function ( a ) { a . get ( " isSystem " ) | | ( " edge " = = = a . get ( " type " ) ? g . eCollList . push ( a . id ) : d . push ( a . id ) ) } ) , window . modalView . enableHotKeys = ! 1 , this . counter = 0 , a ? ( b = " Edit Graph " , h = a . get ( " _key " ) , i = a . get ( " edgeDefinitions " ) , i & & 0 ! = = i . length | | ( i = [ { collection : " " , from : " " , to : " " } ] ) , j = a . get ( " orphanCollections " ) , e . push ( window . modalView . createReadOnlyEntry ( " editGraphName " , " Name " , h , " The name to identify the graph . Has to be unique " ) ) , c . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteGraph . bind ( this ) ) ) , c . push ( window . modalView . createSuccessButton ( " Save " , this . saveEditedGraph . bind ( this ) ) ) ) : ( b = " Create Graph " , e . push ( window . modalView . createTextEntry ( " createNewGraphName " , " Name " , " " , " The name to identify the graph . Has to be unique . " , " graphName " , ! 0 ) ) , c . push ( window . modalView . createSuccessButton ( " Create " , this . createNewGraph . bind ( this ) ) ) ) , i . forEach ( function ( a ) { 0 = = = g . counter ? ( a . collection & & ( g . removedECollList . push ( a . collection ) , g . eCollList . splice ( g . eCollList . indexOf ( a . collection ) , 1 ) ) , e . push ( window . modalView . createSelect2Entry ( " newEdgeDefinitions " + g . counter , " Edge definitions " , a . collection , " An edge definition defines a relation of the graph " , " Edge definitions " , ! 0 , ! 1 , ! 0 , 1 , g . eCollList . sort ( k ) ) ) ) : e . push ( window . modalView . createSelect2Entry ( " newEdgeDefinitions " + g . counter , " Edge definitions " , a . collection , " An edge definition defines a relation of the graph " , " Edge definitions " , ! 1 , ! 0 , ! 1 , 1 , g . eCollList . sort ( k ) ) ) , e . push ( window . modalView . createSelect2Entry ( " fromCollections " + g . counter , " fromCollections " , a . from , " The collections that contain the start vertices of the relation . " , " fromCollections " , ! 0 , ! 1 , ! 1 , 10 , d . sort ( k ) ) ) , e . push ( window . modalView . createSelect2Entry ( " toCollections " + g . counter , " toCollections " , a . to , " The collections that contain the end vertices of the relation . " , " toCollections " , ! 0 , ! 1 , ! 1 , 10 , d . sort ( k ) ) ) , g . counter + + } ) , e . push ( window . modalView . createSelect2Entry ( " newVertexCollections " , " Vertex collections " , j , " Collections that are part of a graph but not used in an edge definition " , " Vertex Collections " , ! 1 , ! 1 , ! 1 , 10 , d . sort ( k ) ) ) , window . modalView . show ( " modalGraphTable . ejs " , b , c , e , void 0 , void 0 , this . events ) , a ) { $ ( " . modal - body table " ) . css ( " border - collapse " , " separate " ) ; var l ; for ( $ ( " . modal - body . spacer " ) . remove ( ) , l = 0 ; l < = this . counter ; l + + ) $ ( " # row_fromCollections " + l ) . show ( ) , $ ( " # row_toCollections " + l ) . show ( ) , $ ( " # row_newEdgeDefinitions " + l ) . addClass ( " first " ) , $ ( " # row_fromCollections " + l ) . addClass ( " middle " ) , $ ( " # row_toCollections " + l ) . addClass ( " last " ) , $ ( " # row_toCollections " + l ) . after ( ' < tr id = " spacer ' + l + ' " class = " spacer " > < / tr > ' ) ; $ ( " # graphTab " ) . hide ( ) , $ ( " # modal - dialog . modal - delete - confirmation " ) . append ( ' < fieldset > < input type = " checkbox " id = " dropGraphCollections " name = " " value = " " > < label for = " mc " > also drop collections ? < / label > < / fieldset > ' ) } } , showHideDefinition : function ( a ) { } , addRemoveDefinition : function ( a ) { var b = [ ] , c = this . options . collectionCollection . models ; c . forEach ( function ( a ) { a . get ( " isSystem " ) | | b . push ( a . id ) } ) , a . stopPropagation ( ) ; var d , e = $ ( a . currentTarget ) . attr ( " id " ) ; if ( - 1 = = = e . indexOf ( " addAfter_newEdgeDefinitions " ) ) - 1 ! = = e . indexOf ( " remove_newEdgeDefinitions " ) & & ( d = e . split ( " remove_newEdgeDefinitions " ) [ 1 ] , $ ( " # row_newEdgeDefinitions " + d ) . remove ( ) , $ ( " # row_fromCollections " + d ) . remove ( ) , $ ( " # row_toCollections " + d ) . remove ( ) , $ ( " # spacer " + d ) . remove ( ) ) ; else { this . counter + + , $ ( " # row_newVertexCollections " ) . before ( this . edgeDefintionTemplate . render ( { number : this . counter } ) ) , $ ( " # newEdgeDefinitions " + this . counter ) . select2 ( { tags : this . eCollList , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : 1 } ) , $ ( " # fromCollections " + this . counter ) . select2 ( { tags : b , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : 10 } ) , $ ( " # toCollections " + this . counter ) . select2 ( { tags : b , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : 10 } ) , window . modalView . undelegateEvents ( ) , window . modalView . delegateEvents ( this . events ) ; var f ; for ( $ ( " . modal - body . spacer " ) . remove ( ) , f = 0 ; f < = this . counter ; f + + ) $ ( " # row_fromCollections " + f ) . show ( ) , $ ( " # row_toCollections " + f ) . show ( ) , $ ( " # row_newEdgeDefinitions " + f ) . addClass ( " first " ) , $ ( " # row_fromCollections " + f ) . addClass ( " middle " ) , $ ( " # row_toCollections " + f ) . addClass ( " last " ) , $ ( " # row_toCollections " + f ) . after ( ' < tr id = " spacer ' + f + ' " class = " spacer " > < / tr > ' ) } } , calculateEdgeDefinitionMap : function ( ) { var a = { } ; return this . collection . models . forEach ( function ( b ) { b . get ( " edgeDefinitions " ) . forEach ( function ( b ) { a [ b . collection ] = { from : b . from , to : b . to } } ) } ) , a } } ) } ( ) , function ( ) { " use strict " ; window . HelpUsView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " helpUsView . ejs " ) , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) } } ) } ( ) , function ( ) { " use strict " ; window . IndicesView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , template : templateEngine . createTemplate ( " indicesView . ejs " ) , events : { } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { model : this . model } ) ) , this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Indices " ) , this . getIndex ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , getIndex : function ( ) { var a = function ( a , b ) { a ? window . arangoHelper . arangoError ( " Index " , b . errorMessage ) : this . renderIndex ( b ) } . bind ( this ) ; this . model . getIndex ( a ) } , createIndex : function ( ) { var a , b , c , d = this , e = $ ( " # newIndexType " ) . val ( ) , f = { } ; switch ( e ) { case " Geo " : a = $ ( " # newGeoFields " ) . val ( ) ; var g = d . checkboxToValue ( " # newGeoJson " ) ; f = { type : " geo " , fields : d . stringToArray ( a ) , geoJson : g } ; break ; case " Persistent " : a = $ ( " # newPersistentFields " ) . val ( ) , b = d . checkboxToValue ( " # newPersistentUnique " ) , c = d . checkboxToValue ( " # newPersistentSparse " ) , f = { type : " rocksdb " , fields : d . stringToArray ( a ) , unique : b , sparse : c } ; break ; case " Hash " : a = $ ( " # newHashFields " ) . val ( ) , b = d . checkboxToValue ( " # newHashUnique " ) , c = d . checkboxToValue ( " # newHashSparse " ) , f = { type : " hash " , fields : d . stringToArray ( a ) , unique : b , sparse : c } ; break ; case " Fulltext " : a = $ ( " # newFulltextFields " ) . val ( ) ; var h = parseInt ( $ ( " # newFulltextMinLength " ) . val ( ) , 10 ) | | 0 ; f = { type : " fulltext " , fields : d . stringToArray ( a ) , minLength : h } ; break ; case " Skiplist " : a = $ ( " # newSkiplistFields " ) . val ( ) , b = d . checkboxToValue ( " # newSkiplistUnique " ) , c = d . checkboxToValue ( " # newSkiplistSparse " ) , f = { type : " skiplist " , fields : d . stringToArray ( a ) , unique : b , sparse : c } } var i = function ( a , b ) { if ( a ) if ( b ) { var c = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " Document error " , c . errorMessage ) } else arangoHelper . arangoError ( " Document error " , " Could not create index . " ) ; d . toggleNewIndexView ( ) , d . render ( ) } ; this . model . createIndex ( f , i ) } , bindIndexEvents : function ( ) { this . unbindIndexEvents ( ) ; var a = this ; $ ( " # indexEditView # addIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) , $ ( " # cancelIndex " ) . unbind ( " click " ) , $ ( " # cancelIndex " ) . bind ( " click " , function ( ) { a . toggleNewIndexView ( ) , a . render ( ) } ) , $ ( " # createIndex " ) . unbind ( " click " ) , $ ( " # createIndex " ) . bind ( " click " , function ( ) { a . createIndex ( ) } ) } ) , $ ( " # newIndexType " ) . bind ( " change " , function ( ) { a . selectIndexType ( ) } ) , $ ( " . deleteIndex " ) . bind ( " click " , function ( b ) { a . prepDeleteIndex ( b ) } ) , $ ( " # infoTab a " ) . bind ( " click " , function ( a ) { if ( $ ( " # indexDeleteModal " ) . remove ( ) , " Indices " ! = = $ ( a . currentTarget ) . html ( ) | | $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) | | ( $ ( " # newIndexView " ) . hide ( ) , $ ( " # indexEditView " ) . show ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - danger " ) . hide ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - success " ) . hide ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - notification " ) . hide ( ) ) , " General " = = = $ ( a . currentTarget ) . html ( ) & & ! $ ( a . currentTarget ) . parent ( ) . hasClass ( " active " ) ) { $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - danger " ) . show ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - success " ) . show ( ) , $ ( " # indexHeaderContent # modal - dialog . modal - footer . button - notification " ) . show ( ) ; var b = $ ( " . index - button - bar2 " ) [ 0 ] ; $ ( " # cancelIndex " ) . is ( " : visible " ) & & ( $ ( " # cancelIndex " ) . detach ( ) . appendTo ( b ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( b ) ) } } ) } , prepDeleteIndex : function ( a ) { var b = this ; this . lastTarget = a , this . lastId = $ ( this . lastTarget . currentTarget ) . parent ( ) . parent ( ) . first ( ) . children ( ) . first ( ) . text ( ) , $ ( " # modal - dialog . modal - footer " ) . after ( ' < div id = " indexDeleteModal " style = " display : block ; " class = " alert alert - error modal - delete - confirmation " > < strong > Really delete ? < / strong > < button id = " indexConfirmDelete " class = " button - danger pull - right modal - confirm - delete " > Yes < / button > < button id = " indexAbortDelete " class = " button - neutral pull - right " > No < / button > < / div > ' ) , $ ( " # indexConfirmDelete " ) . unbind ( " click " ) , $ ( " # indexConfirmDelete " ) . bind ( " click " , function ( ) { $ ( " # indexDeleteModal " ) . remove ( ) , b . deleteIndex ( ) } ) , $ ( " # indexAbortDelete " ) . unbind ( " click " ) , $ ( " # indexAbortDelete " ) . bind ( " click " , function ( ) { $ ( " # indexDeleteModal " ) . remove ( ) } ) } , unbindIndexEvents : function ( ) { $ ( " # indexEditView # addIndex " ) . unbind ( " click " ) , $ ( " # newIndexType " ) . unbind ( " change " ) , $ ( " # infoTab a " ) . unbind ( " click " ) , $ ( " . deleteIndex " ) . unbind ( " click " ) } , deleteIndex : function ( ) { var a = function ( a ) { a ? ( arangoHelper . arangoError ( " Could not delete index " ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' ) , this . model . set ( " locked " , ! 1 ) ) : a | | void 0 = = = a | | ( $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . remove ( ) , this . model . set ( " locked " , ! 1 ) ) } . bind ( this ) ; this . model . set ( " locked " , ! 0 ) , this . model . deleteIndex ( this . lastId , a ) , $ ( " tr th : contains ( ' " + this . lastId + " ' ) " ) . parent ( ) . children ( ) . last ( ) . html ( ' < i class = " fa fa - circle - o - notch fa - spin " > < / i > ' ) } , renderIndex : function ( a ) { this . index = a ; var b = " collectionInfoTh modal - text " ; if ( this . index ) { var c = " " , d = " " ; _ . each ( this . index . indexes , function ( a ) { d = " primary " = = = a . type | | " edge " = = = a . type ? ' < span class = " icon_arangodb_locked " data - original - title = " No action " > < / span > ' : ' < span class = " deleteIndex icon_arangodb_roundminus " data - original - title = " Delete index " title = " Delete index " > < / span > ' , void 0 ! = = a . fields & & ( c = a . fields . join ( " , " ) ) ; var e = a . id . indexOf ( " / " ) , f = a . id . substr ( e + 1 , a . id . length ) , g = a . hasOwnProperty ( " selectivityEstimate " ) ? ( 100 * a . selectivityEstimate ) . toFixed ( 2 ) + " % " : " n / a " , h = a . hasOwnProperty ( " sparse " ) ? a . sparse : " n / a " ; $ ( " # collectionEditIndexTable " ) . append ( " < tr > < th class = " + JSON . stringify ( b ) + " > " + f + " < / th > < th class = " + JSON . stringify ( b ) + " > " + a . type + " < / th > < th class = " + JSON . stringify ( b ) + " > " + a . unique + " < / th > < th class = " + JSON . stringify ( b ) + " > " + h + " < / th > < th class = " + JSON . stringify ( b ) + " > " + g + " < / th > < th class = " + JSON . stringify ( b ) + " > " + c + " < / th > < th class = " + JSON . stringify ( b ) + " > " + d + " < / th > < / tr > " ) } ) } this . bindIndexEvents ( ) } , selectIndexType : function ( ) { $ ( " . newIndexClass " ) . hide ( ) ; var a = $ ( " # newIndexType " ) . val ( ) ; $ ( " # newIndexType " + a ) . show ( ) } , resetIndexForms : function ( ) { $ ( " # indexHeader input " ) . val ( " " ) . prop ( " checked " , ! 1 ) , $ ( " # newIndexType " ) . val ( " Geo " ) . prop ( " selected " , ! 0 ) , this . selectIndexType ( ) } , toggleNewIndexView : function ( ) { var a = $ ( " . index - button - bar2 " ) [ 0 ] ; $ ( " # indexEditView " ) . is ( " : visible " ) ? ( $ ( " # indexEditView " ) . hide ( ) , $ ( " # newIndexView " ) . show ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( " # indexHeaderContent # modal - dialog . modal - footer " ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( " # indexHeaderContent # modal - dialog . modal - footer " ) ) : ( $ ( " # indexEditView " ) . show ( ) , $ ( " # newIndexView " ) . hide ( ) , $ ( " # cancelIndex " ) . detach ( ) . appendTo ( a ) , $ ( " # createIndex " ) . detach ( ) . appendTo ( a ) ) , arangoHelper . fixTooltips ( " . icon_arangodb , . arangoicon " , " right " ) , this . resetIndexForms ( ) } , stringToArray : function ( a ) { var b = [ ] ; return a . split ( " , " ) . forEach ( function ( a ) { a = a . replace ( / ( ^ \ s + | \ s + $ ) / g , " " ) , " " ! = = a & & b . push ( a ) } ) , b } , checkboxToValue : function ( a ) { return $ ( a ) . prop ( " checked " ) } } ) } ( ) , function ( ) { " use strict " ; window . InfoView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , events : { } , render : function ( ) { this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Info " ) , this . renderInfoView ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , renderInfoView : function ( ) { if ( this . model . get ( " locked " ) ) return 0 ; var a = function ( a , b , c ) { if ( a ) arangoHelper . arangoError ( " Figures " , " Could not get revision . " ) ; else { var d = [ ] , e = { figures : c , revision : b , model : this . model } ; window . modalView . show ( " modalCollectionInfo . ejs " , " Collection : " + this . model . get ( " name " ) , d , e , null , null , null , null , null , " content " ) } } . bind ( this ) , b = function ( b , c ) { if ( b ) arangoHelper . arangoError ( " Figures " , " Could not get figures . " ) ; else { var d = c ; this . model . getRevision ( a , d ) } } . bind ( this ) ; this . model . getFigures ( b ) } } ) } ( ) , function ( ) { " use strict " ; window . loginView = Backbone . View . extend ( { el : " # content " , <nl> - el2 : " . header " , el3 : " . footer " , loggedIn : ! 1 , events : { " keyPress # loginForm input " : " keyPress " , " click # submitLogin " : " validate " , " submit # dbForm " : " goTo " , " click # logout " : " logout " , " change # loginDatabase " : " renderDBS " } , template : templateEngine . createTemplate ( " loginView . ejs " ) , render : function ( a ) { var b = this ; if ( $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el2 ) . hide ( ) , $ ( this . el3 ) . hide ( ) , frontendConfig . authenticationEnabled & & a ! = = ! 0 ) window . setTimeout ( function ( ) { $ ( " # loginUsername " ) . focus ( ) } , 300 ) ; else { var c = arangoHelper . databaseUrl ( " / _api / database / user " ) ; frontendConfig . authenticationEnabled = = = ! 1 & & ( $ ( " # logout " ) . hide ( ) , $ ( " . login - window # databases " ) . css ( " height " , " 90px " ) ) , $ ( " # loginForm " ) . hide ( ) , $ ( " . login - window # databases " ) . show ( ) , $ . ajax ( c ) . success ( function ( a ) { $ ( " # loginDatabase " ) . html ( " " ) , _ . each ( a . result , function ( a ) { $ ( " # loginDatabase " ) . append ( " < option > " + a + " < / option > " ) } ) , b . renderDBS ( ) } ) } return $ ( " . bodyWrapper " ) . show ( ) , this } , clear : function ( ) { $ ( " # loginForm input " ) . removeClass ( " form - error " ) , $ ( " . wrong - credentials " ) . hide ( ) } , keyPress : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? ( a . preventDefault ( ) , this . validate ( ) ) : a . metaKey & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . validate ( ) ) } , validate : function ( a ) { a . preventDefault ( ) , this . clear ( ) ; var b = $ ( " # loginUsername " ) . val ( ) , c = $ ( " # loginPassword " ) . val ( ) ; if ( b ) { var d = function ( a ) { var b = this ; if ( a ) $ ( " . wrong - credentials " ) . show ( ) , $ ( " # loginDatabase " ) . html ( " " ) , $ ( " # loginDatabase " ) . append ( " < option > _system < / option > " ) ; else { var c = arangoHelper . databaseUrl ( " / _api / database / user " , " _system " ) ; frontendConfig . authenticationEnabled = = = ! 1 & & ( c = arangoHelper . databaseUrl ( " / _api / database / user " ) ) , $ ( " . wrong - credentials " ) . hide ( ) , b . loggedIn = ! 0 , $ . ajax ( c ) . success ( function ( a ) { $ ( " # loginForm " ) . hide ( ) , $ ( " # databases " ) . show ( ) , $ ( " # loginDatabase " ) . html ( " " ) , _ . each ( a . result , function ( a ) { $ ( " # loginDatabase " ) . append ( " < option > " + a + " < / option > " ) } ) , b . renderDBS ( ) } ) } } . bind ( this ) ; this . collection . login ( b , c , d ) } } , renderDBS : function ( ) { var a = $ ( " # loginDatabase " ) . val ( ) ; $ ( " # goToDatabase " ) . html ( " Select : " + a ) , window . setInterval ( function ( ) { $ ( " # goToDatabase " ) . focus ( ) } , 300 ) } , logout : function ( ) { this . collection . logout ( ) } , goTo : function ( a ) { a . preventDefault ( ) ; var b = $ ( " # loginUsername " ) . val ( ) , c = $ ( " # loginDatabase " ) . val ( ) ; console . log ( window . App . dbSet ) , window . App . dbSet = c , console . log ( window . App . dbSet ) ; var d = function ( a ) { a & & arangoHelper . arangoError ( " User " , " Could not fetch user settings " ) } , e = window . location . protocol + " / / " + window . location . host + frontendConfig . basePath + " / _db / " + c + " / _admin / aardvark / index . html " ; window . location . href = e , $ ( this . el2 ) . show ( ) , $ ( this . el3 ) . show ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) , $ ( " # currentUser " ) . text ( b ) , this . collection . loadUserSettings ( d ) } } ) } ( ) , function ( ) { " use strict " ; window . LogsView = window . PaginationView . extend ( { el : " # content " , id : " # logContent " , paginationDiv : " # logPaginationDiv " , idPrefix : " logTable " , fetchedAmount : ! 1 , initialize : function ( a ) { this . options = a , this . convertModelToJSON ( ) } , currentLoglevel : " logall " , events : { " click # arangoLogTabbar button " : " setActiveLoglevel " , " click # logTable_first " : " firstPage " , " click # logTable_last " : " lastPage " } , template : templateEngine . createTemplate ( " logsView . ejs " ) , tabbar : templateEngine . createTemplate ( " arangoTabbar . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , tabbarElements : { id : " arangoLogTabbar " , titles : [ [ " All " , " logall " ] , [ " Info " , " loginfo " ] , [ " Error " , " logerror " ] , [ " Warning " , " logwarning " ] , [ " Debug " , " logdebug " ] ] } , tableDescription : { id : " arangoLogTable " , titles : [ " Loglevel " , " Date " , " Message " ] , rows : [ ] } , convertedRows : null , setActiveLoglevel : function ( a ) { $ ( " . arangodb - tabbar " ) . removeClass ( " arango - active - tab " ) , this . currentLoglevel ! = = a . currentTarget . id & & ( this . currentLoglevel = a . currentTarget . id , this . convertModelToJSON ( ) ) } , initTotalAmount : function ( ) { var a = this ; this . collection = this . options [ this . currentLoglevel ] , this . collection . fetch ( { data : $ . param ( { test : ! 0 } ) , success : function ( ) { a . convertModelToJSON ( ) } } ) , this . fetchedAmount = ! 0 } , invertArray : function ( a ) { var b , c = [ ] , d = 0 ; for ( b = a . length - 1 ; b > = 0 ; b - - ) c [ d ] = a [ b ] , d + + ; return c } , convertModelToJSON : function ( ) { if ( ! this . fetchedAmount ) return void this . initTotalAmount ( ) ; var a , b = this , c = [ ] ; this . collection = this . options [ this . currentLoglevel ] , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { a = new Date ( 1e3 * b . get ( " timestamp " ) ) , c . push ( [ b . getLogStatus ( ) , arangoHelper . formatDT ( a ) , b . get ( " text " ) ] ) } ) , b . tableDescription . rows = b . invertArray ( c ) , b . render ( ) } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . id ) . html ( this . tabbar . render ( { content : this . tabbarElements } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # " + this . currentLoglevel ) . addClass ( " arango - active - tab " ) , $ ( " # logContent " ) . append ( ' < div id = " logPaginationDiv " class = " pagination - line " > < / div > ' ) , this . renderPagination ( ) , this } , rerender : function ( ) { this . convertModelToJSON ( ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b , c , d ) { return { type : a , title : b , callback : c , confirm : d } } , b = function ( a , b , c , d , e , f , g , h , i , j , k ) { var l = { type : a , label : b } ; return void 0 ! = = c & & ( l . value = c ) , void 0 ! = = d & & ( l . info = d ) , void 0 ! = = e & & ( l . placeholder = e ) , void 0 ! = = f & & ( l . mandatory = f ) , void 0 ! = = h & & ( l . addDelete = h ) , void 0 ! = = i & & ( l . addAdd = i ) , void 0 ! = = j & & ( l . maxEntrySize = j ) , void 0 ! = = k & & ( l . tags = k ) , g & & ( l . validateInput = function ( ) { return g } ) , l } ; window . ModalView = Backbone . View . extend ( { _validators : [ ] , _validateWatchers : [ ] , baseTemplate : templateEngine . createTemplate ( " modalBase . ejs " ) , tableTemplate : templateEngine . createTemplate ( " modalTable . ejs " ) , el : " # modalPlaceholder " , contentEl : " # modalContent " , hideFooter : ! 1 , confirm : { list : " # modal - delete - confirmation " , yes : " # modal - confirm - delete " , no : " # modal - abort - delete " } , enabledHotkey : ! 1 , enableHotKeys : ! 0 , buttons : { SUCCESS : " success " , NOTIFICATION : " notification " , DELETE : " danger " , NEUTRAL : " neutral " , CLOSE : " close " } , tables : { READONLY : " readonly " , TEXT : " text " , BLOB : " blob " , PASSWORD : " password " , SELECT : " select " , SELECT2 : " select2 " , CHECKBOX : " checkbox " } , initialize : function ( ) { Object . freeze ( this . buttons ) , Object . freeze ( this . tables ) } , createModalHotkeys : function ( ) { $ ( this . el ) . unbind ( " keydown " ) , $ ( this . el ) . unbind ( " return " ) , $ ( this . el ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) , $ ( " . modal - body input " ) . unbind ( " keydown " ) , $ ( " . modal - body input " ) . unbind ( " return " ) , $ ( " . modal - body input " , $ ( this . el ) ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) , $ ( " . modal - body select " ) . unbind ( " keydown " ) , $ ( " . modal - body select " ) . unbind ( " return " ) , $ ( " . modal - body select " , $ ( this . el ) ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) } , createInitModalHotkeys : function ( ) { var a = this ; $ ( this . el ) . bind ( " keydown " , " left " , function ( ) { a . navigateThroughButtons ( " left " ) } ) , $ ( this . el ) . bind ( " keydown " , " right " , function ( ) { a . navigateThroughButtons ( " right " ) } ) } , navigateThroughButtons : function ( a ) { var b = $ ( " . createModalDialog . modal - footer button " ) . is ( " : focus " ) ; b = = = ! 1 ? " left " = = = a ? $ ( " . createModalDialog . modal - footer button " ) . first ( ) . focus ( ) : " right " = = = a & & $ ( " . createModalDialog . modal - footer button " ) . last ( ) . focus ( ) : b = = = ! 0 & & ( " left " = = = a ? $ ( " : focus " ) . prev ( ) . focus ( ) : " right " = = = a & & $ ( " : focus " ) . next ( ) . focus ( ) ) } , createCloseButton : function ( b , c ) { var d = this ; return a ( this . buttons . CLOSE , b , function ( ) { d . hide ( ) , c & & c ( ) } ) } , createSuccessButton : function ( b , c ) { return a ( this . buttons . SUCCESS , b , c ) } , createNotificationButton : function ( b , c ) { return a ( this . buttons . NOTIFICATION , b , c ) } , createDeleteButton : function ( b , c , d ) { return a ( this . buttons . DELETE , b , c , d ) } , createNeutralButton : function ( b , c ) { return a ( this . buttons . NEUTRAL , b , c ) } , createDisabledButton : function ( b ) { var c = a ( this . buttons . NEUTRAL , b ) ; return c . disabled = ! 0 , c } , createReadOnlyEntry : function ( a , c , d , e , f , g ) { var h = b ( this . tables . READONLY , c , d , e , void 0 , void 0 , void 0 , f , g ) ; return h . id = a , h } , createTextEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . TEXT , c , d , e , f , g , h ) ; return i . id = a , i } , createBlobEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . BLOB , c , d , e , f , g , h ) ; return i . id = a , i } , createSelect2Entry : function ( a , c , d , e , f , g , h , i , j , k ) { var l = b ( this . tables . SELECT2 , c , d , e , f , g , void 0 , h , i , j , k ) ; return l . id = a , l } , createPasswordEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . PASSWORD , c , d , e , f , g , h ) ; return i . id = a , i } , createCheckboxEntry : function ( a , c , d , e , f ) { var g = b ( this . tables . CHECKBOX , c , d , e ) ; return g . id = a , f & & ( g . checked = f ) , g } , createSelectEntry : function ( a , c , d , e , f ) { var g = b ( this . tables . SELECT , c , null , e ) ; return g . id = a , d & & ( g . selected = d ) , g . options = f , g } , createOptionEntry : function ( a , b ) { return { label : a , value : b | | a } } , show : function ( a , b , c , d , e , f , g , h , i , j ) { var k , l , m = this , n = ! 1 ; c = c | | [ ] , h = Boolean ( h ) , this . clearValidators ( ) , c . length > 0 ? ( c . forEach ( function ( a ) { a . type = = = m . buttons . CLOSE & & ( n = ! 0 ) , a . type = = = m . buttons . DELETE & & ( l = l | | a . confirm ) } ) , n | | ( k = c . pop ( ) , c . push ( m . createCloseButton ( " Cancel " ) ) , c . push ( k ) ) ) : c . push ( m . createCloseButton ( " Close " ) ) , j ? ( $ ( " # " + j ) . html ( this . baseTemplate . render ( { title : b , buttons : c , hideFooter : this . hideFooter , confirm : l , tabBar : i } ) ) , $ ( " # " + j + " # modal - dialog " ) . removeClass ( " fade hide modal " ) , $ ( " # " + j + " . modal - header " ) . remove ( ) , $ ( " # " + j + " . modal - tabbar " ) . remove ( ) , $ ( " # " + j + " . modal - tabbar " ) . remove ( ) , $ ( " # " + j + " . button - close " ) . remove ( ) , 0 = = = $ ( " # " + j + " . modal - footer " ) . children ( ) . length & & $ ( " # " + j + " . modal - footer " ) . remove ( ) ) : $ ( this . el ) . html ( this . baseTemplate . render ( { title : b , buttons : c , hideFooter : this . hideFooter , confirm : l , tabBar : i } ) ) , _ . each ( c , function ( a , b ) { return ! a . disabled & & a . callback ? a . type ! = = m . buttons . DELETE | | h ? void $ ( " # modalButton " + b ) . bind ( " click " , a . callback ) : void $ ( " # modalButton " + b ) . bind ( " click " , function ( ) { $ ( m . confirm . yes ) . unbind ( " click " ) , $ ( m . confirm . yes ) . bind ( " click " , a . callback ) , $ ( m . confirm . list ) . css ( " display " , " block " ) } ) : void 0 } ) , $ ( this . confirm . no ) . bind ( " click " , function ( ) { $ ( m . confirm . list ) . css ( " display " , " none " ) } ) ; var o ; if ( " string " = = typeof a ) o = templateEngine . createTemplate ( a ) , j ? $ ( " # " + j + " . createModalDialog . modal - body " ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) : $ ( " # modalPlaceholder . createModalDialog . modal - body " ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) ; else { var p = 0 ; _ . each ( a , function ( a ) { o = templateEngine . createTemplate ( a ) , $ ( " . createModalDialog . modal - body . tab - content # " + i [ p ] ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) , p + + } ) } $ ( " . createModalDialog . modalTooltips " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) ; var q = d | | [ ] ; e & & e . content & & ( q = q . concat ( e . content ) ) , _ . each ( q , function ( a ) { m . modalBindValidation ( a ) , a . type = = = m . tables . SELECT2 & & $ ( " # " + a . id ) . select2 ( { tags : a . tags | | [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : a . maxEntrySize | | 8 } ) } ) , g & & ( this . events = g , this . delegateEvents ( ) ) , $ ( " # accordion2 " ) & & ( $ ( " # accordion2 . accordion - toggle " ) . bind ( " click " , function ( ) { $ ( " # collapseOne " ) . is ( " : visible " ) ? ( $ ( " # collapseOne " ) . hide ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . addClass ( " collapsed " ) } , 100 ) ) : ( $ ( " # collapseOne " ) . show ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . removeClass ( " collapsed " ) } , 100 ) ) } ) , $ ( " # collapseOne " ) . hide ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . addClass ( " collapsed " ) } , 100 ) ) , j | | $ ( " # modal - dialog " ) . modal ( " show " ) , this . enabledHotkey = = = ! 1 & & ( this . createInitModalHotkeys ( ) , this . enabledHotkey = ! 0 ) , this . enableHotKeys & & this . createModalHotkeys ( ) ; var r = $ ( " # modal - dialog " ) . find ( " input " ) ; r & & setTimeout ( function ( ) { var a = $ ( " # modal - dialog " ) ; a . length > 0 & & ( a = a . find ( " input " ) , a . length > 0 & & $ ( a [ 0 ] ) . focus ( ) ) } , 400 ) } , modalBindValidation : function ( a ) { var b = this ; if ( a . hasOwnProperty ( " id " ) & & a . hasOwnProperty ( " validateInput " ) ) { var c = function ( ) { var b = $ ( " # " + a . id ) , c = a . validateInput ( b ) , d = ! 1 ; return _ . each ( c , function ( a ) { var c = b . val ( ) ; if ( a . rule | | ( a = { rule : a } ) , " function " = = typeof a . rule ) try { a . rule ( c ) } catch ( e ) { d = a . msg | | e . message } else { var f = Joi . validate ( c , a . rule ) ; f . error & & ( d = a . msg | | f . error . message ) } return d ? ! 1 : void 0 } ) , d ? d : void 0 } , d = $ ( " # " + a . id ) ; d . on ( " keyup focusout " , function ( ) { var a = c ( ) , e = d . next ( ) [ 0 ] ; a ? ( d . addClass ( " invalid - input " ) , e ? $ ( e ) . text ( a ) : d . after ( ' < p class = " errorMessage " > ' + a + " < / p > " ) , $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 0 ) . addClass ( " disabled " ) ) : ( d . removeClass ( " invalid - input " ) , e & & $ ( e ) . remove ( ) , b . modalTestAll ( ) ) } ) , this . _validators . push ( c ) , this . _validateWatchers . push ( d ) } } , modalTestAll : function ( ) { var a = _ . map ( this . _validators , function ( a ) { return a ( ) } ) , b = _ . any ( a ) ; return b ? $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 0 ) . addClass ( " disabled " ) : $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 1 ) . removeClass ( " disabled " ) , ! b } , clearValidators : function ( ) { this . _validators = [ ] , _ . each ( this . _validateWatchers , function ( a ) { a . unbind ( " keyup focusout " ) } ) , this . _validateWatchers = [ ] } , hide : function ( ) { this . clearValidators ( ) , $ ( " # modal - dialog " ) . modal ( " hide " ) } } ) } ( ) , function ( ) { " use strict " ; window . NavigationView = Backbone . View . extend ( { el : " # navigationBar " , subEl : " # subNavigationBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " click li " : " switchTab " , " click . arangodbLogo " : " selectMenuItem " , " mouseenter . dropdown > * " : " showDropdown " , " click . shortcut - icons p " : " showShortcutModal " , " mouseleave . dropdown " : " hideDropdown " } , renderFirst : ! 0 , activeSubMenu : void 0 , changeDB : function ( ) { window . location . hash = " # login " } , initialize : function ( a ) { var b = this ; this . userCollection = a . userCollection , this . currentDB = a . currentDB , this . dbSelectionView = new window . DBSelectionView ( { collection : a . database , current : this . currentDB } ) , this . userBarView = new window . UserBarView ( { userCollection : this . userCollection } ) , this . notificationView = new window . NotificationView ( { collection : a . notificationCollection } ) , this . statisticBarView = new window . StatisticBarView ( { currentDB : this . currentDB } ) , this . isCluster = a . isCluster , this . handleKeyboardHotkeys ( ) , Backbone . history . on ( " all " , function ( ) { b . selectMenuItem ( ) } ) } , showShortcutModal : function ( ) { arangoHelper . hotkeysFunctions . showHotkeysModal ( ) } , handleSelectDatabase : function ( ) { this . dbSelectionView . render ( $ ( " # dbSelect " ) ) } , template : templateEngine . createTemplate ( " navigationView . ejs " ) , templateSub : templateEngine . createTemplate ( " subNavigationView . ejs " ) , render : function ( ) { var a = this ; $ ( this . el ) . html ( this . template . render ( { currentDB : this . currentDB , isCluster : this . isCluster } ) ) , " _system " ! = = this . currentDB . get ( " name " ) & & $ ( " # dashboard " ) . parent ( ) . remove ( ) , $ ( this . subEl ) . html ( this . templateSub . render ( { currentDB : this . currentDB . toJSON ( ) } ) ) , this . dbSelectionView . render ( $ ( " # dbSelect " ) ) ; var b = function ( a ) { a | | this . userBarView . render ( ) } . bind ( this ) ; return this . userCollection . whoAmI ( b ) , this . renderFirst & & ( this . renderFirst = ! 1 , this . selectMenuItem ( ) , $ ( " . arangodbLogo " ) . on ( " click " , function ( ) { a . selectMenuItem ( ) } ) , $ ( " # dbStatus " ) . on ( " click " , function ( ) { a . changeDB ( ) } ) ) , this } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , handleKeyboardHotkeys : function ( ) { arangoHelper . enableKeyboardHotkeys ( ! 0 ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id , d = ! 1 ; $ ( b ) . hasClass ( " fa " ) | | ( " " = = = c & & ( c = $ ( b ) . attr ( " class " ) ) , " links " = = = c ? ( d = ! 0 , $ ( " # link_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) : " tools " = = = c ? ( d = ! 0 , $ ( " # tools_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) : " dbselection " = = = c & & ( d = ! 0 , $ ( " # dbs_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) , d | | ( window . App . navigate ( c , { trigger : ! 0 } ) , a . preventDefault ( ) ) ) } , handleSelectNavigation : function ( ) { var a = this ; $ ( " # arangoCollectionSelect " ) . change ( function ( ) { a . navigateBySelect ( ) } ) } , subViewConfig : { documents : " collections " , collection : " collections " } , subMenuConfig : { cluster : [ { name : " Dashboard " , view : void 0 , active : ! 0 } , { name : " Logs " , view : void 0 , disabled : ! 0 } ] , collections : [ { name : " " , view : void 0 , active : ! 1 } ] , queries : [ { name : " Editor " , route : " query " , active : ! 0 } , { name : " Running Queries " , route : " queryManagement " , params : { active : ! 0 } , active : void 0 } , { name : " Slow Query History " , route : " queryManagement " , params : { active : ! 1 } , active : void 0 } ] } , renderSubMenu : function ( a ) { var b = this ; if ( void 0 = = = a & & ( a = window . isCluster ? " cluster " : " dashboard " ) , this . subMenuConfig [ a ] ) { $ ( this . subEl + " . bottom " ) . html ( " " ) ; var c = " " ; _ . each ( this . subMenuConfig [ a ] , function ( a ) { c = a . active ? " active " : " " , a . disabled & & ( c = " disabled " ) , $ ( b . subEl + " . bottom " ) . append ( ' < li class = " subMenuEntry ' + c + ' " > < a > ' + a . name + " < / a > < / li > " ) , a . disabled | | $ ( b . subEl + " . bottom " ) . children ( ) . last ( ) . bind ( " click " , function ( c ) { b . activeSubMenu = a , b . renderSubView ( a , c ) } ) } ) } } , renderSubView : function ( a , b ) { window . App [ a . route ] & & ( window . App [ a . route ] . resetState & & window . App [ a . route ] . resetState ( ) , window . App [ a . route ] ( ) ) , $ ( this . subEl + " . bottom " ) . children ( ) . removeClass ( " active " ) , $ ( b . currentTarget ) . addClass ( " active " ) } , switchTab : function ( a ) { var b = $ ( a . currentTarget ) . children ( ) . first ( ) . attr ( " id " ) ; b & & this . selectMenuItem ( b + " - menu " ) } , selectMenuItem : function ( a , b ) { void 0 = = = a & & ( a = window . location . hash . split ( " / " ) [ 0 ] , a = a . substr ( 1 , a . length - 1 ) ) , " " = = = a ? a = window . App . isCluster ? " cluster " : " dashboard " : ( " cNodes " = = = a | | " dNodes " = = = a ) & & ( a = " nodes " ) ; try { this . renderSubMenu ( a . split ( " - " ) [ 0 ] ) } catch ( c ) { this . renderSubMenu ( a ) } $ ( " . navlist li " ) . removeClass ( " active " ) , " string " = = typeof a & & ( b ? $ ( " . " + this . subViewConfig [ a ] + " - menu " ) . addClass ( " active " ) : a & & ( $ ( " . " + a ) . addClass ( " active " ) , $ ( " . " + a + " - menu " ) . addClass ( " active " ) ) ) , arangoHelper . hideArangoNotifications ( ) } , showSubDropdown : function ( a ) { console . log ( $ ( a . currentTarget ) ) , console . log ( $ ( a . currentTarget ) . find ( " . subBarDropdown " ) ) , $ ( a . currentTarget ) . find ( " . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; " links " = = = c | | " link_dropdown " = = = c | | " links " = = = a . currentTarget . id ? $ ( " # link_dropdown " ) . fadeIn ( 1 ) : " tools " = = = c | | " tools_dropdown " = = = c | | " tools " = = = a . currentTarget . id ? $ ( " # tools_dropdown " ) . fadeIn ( 1 ) : ( " dbselection " = = = c | | " dbs_dropdown " = = = c | | " dbselection " = = = a . currentTarget . id ) & & $ ( " # dbs_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( a ) { var b = a . target | | a . srcElement ; b = $ ( b ) . parent ( ) , $ ( " # link_dropdown " ) . fadeOut ( 1 ) , $ ( " # tools_dropdown " ) . fadeOut ( 1 ) , $ ( " # dbs_dropdown " ) . fadeOut ( 1 ) } } ) } ( ) , function ( ) { " use strict " ; window . NodeView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodeView . ejs " ) , interval : 5e3 , dashboards : [ ] , events : { } , initialize : function ( a ) { window . App . isCluster & & ( this . coordinators = a . coordinators , this . dbServers = a . dbServers , this . coordname = a . coordname , this . updateServerTime ( ) , window . setInterval ( function ( ) { if ( 0 = = = window . location . hash . indexOf ( " # node / " ) ) ; } , this . interval ) ) } , breadcrumb : function ( a ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Node : " + a ) } , render : function ( ) { this . $ el . html ( this . template . render ( { coords : [ ] } ) ) ; var a = function ( ) { this . continueRender ( ) , this . breadcrumb ( this . coordname ) , $ ( window ) . trigger ( " resize " ) } . bind ( this ) , b = function ( ) { console . log ( " " ) } ; this . initCoordDone | | this . waitForCoordinators ( b ) , this . initDBDone ? ( this . coordname = window . location . hash . split ( " / " ) [ 1 ] , this . coordinator = this . coordinators . findWhere ( { name : this . coordname } ) , a ( ) ) : this . waitForDBServers ( a ) } , continueRender : function ( ) { var a = this ; this . dashboards [ this . coordinator . get ( " name " ) ] = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : window . App . arangoDatabase , serverToShow : { raw : this . coordinator . get ( " address " ) , isDBServer : ! 1 , endpoint : this . coordinator . get ( " protocol " ) + " : / / " + this . coordinator . get ( " address " ) , target : this . coordinator . get ( " name " ) } } ) , this . dashboards [ this . coordinator . get ( " name " ) ] . render ( ) , window . setTimeout ( function ( ) { a . dashboards [ a . coordinator . get ( " name " ) ] . resize ( ) } , 500 ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( b . coordinator = b . coordinators . findWhere ( { name : b . coordname } ) , b . initCoordDone = ! 0 , a ( ) ) } , 200 ) } , waitForDBServers : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . dbServers [ 0 ] . length ? b . waitForDBServers ( a ) : ( b . initDBDone = ! 0 , b . dbServer = b . dbServers [ 0 ] , b . dbServer . each ( function ( a ) { " DBServer1 " = = = a . get ( " name " ) & & ( b . dbServer = a ) } ) , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NodesView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodesView . ejs " ) , interval : 5e3 , knownServers : [ ] , events : { " click # nodesContent . pure - table - body . pure - table - row " : " navigateToNode " } , initialize : function ( a ) { window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , this . toRender = a . toRender , window . setInterval ( function ( ) { if ( " # cNodes " = = = window . location . hash | | " # dNodes " = = = window . location . hash ) ; } , this . interval ) ) } , navigateToNode : function ( a ) { if ( " # dNodes " ! = = window . location . hash ) { var b = $ ( a . currentTarget ) . attr ( " node " ) ; window . App . navigate ( " # node / " + encodeURIComponent ( b ) , { trigger : ! 0 } ) } } , render : function ( ) { var a = function ( ) { this . continueRender ( ) } . bind ( this ) ; this . initDoneCoords ? a ( ) : this . waitForCoordinators ( a ) } , continueRender : function ( ) { var a ; a = " coordinator " = = = this . toRender ? this . coordinators . toJSON ( ) : this . dbServers . toJSON ( ) , this . $ el . html ( this . template . render ( { coords : a , type : this . toRender } ) ) , window . arangoHelper . buildNodesSubNav ( this . toRender ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( this . initDoneCoords = ! 0 , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NotificationView = Backbone . View . extend ( { events : { " click . navlogo # stat_hd " : " toggleNotification " , " click . notificationItem . fa " : " removeNotification " , " click # removeAllNotifications " : " removeAllNotifications " } , initialize : function ( ) { this . collection . bind ( " add " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " remove " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " reset " , this . renderNotifications . bind ( this ) ) , window . setTimeout ( function ( ) { frontendConfig . authenticationEnabled = = = ! 1 & & window . arangoHelper . arangoWarning ( " Warning " , " Authentication is disabled . Do not use this setup in production mode . " ) } , 2e3 ) } , notificationItem : templateEngine . createTemplate ( " notificationItem . ejs " ) , el : " # notificationBar " , template : templateEngine . createTemplate ( " notificationView . ejs " ) , toggleNotification : function ( ) { var a = this . collection . length ; 0 ! = = a & & $ ( " # notification_menu " ) . toggle ( ) } , removeAllNotifications : function ( ) { $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , this . collection . reset ( ) , $ ( " # notification_menu " ) . hide ( ) } , removeNotification : function ( a ) { var b = a . target . id ; this . collection . get ( b ) . destroy ( ) } , renderNotifications : function ( a , b , c ) { if ( c & & c . add ) { var d , e = this . collection . at ( this . collection . length - 1 ) , f = e . get ( " title " ) , g = 3e3 , h = [ " click " ] ; if ( e . get ( " content " ) & & ( f = f + " : " + e . get ( " content " ) ) , " error " = = = e . get ( " type " ) ? ( g = ! 1 , h = [ " button " ] , d = [ { addClass : " button - danger " , text : " Close " , onClick : function ( a ) { a . close ( ) } } ] ) : " warning " = = = e . get ( " type " ) & & ( g = 2e4 ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , noty ( { theme : " relax " , text : f , template : ' < div class = " noty_message arango_message " > < div > < i class = " fa fa - close " > < / i > < / div > < span class = " noty_text arango_text " > < / span > < div class = " noty_close arango_close " > < / div > < / div > ' , maxVisible : 1 , closeWith : [ " click " ] , type : e . get ( " type " ) , layout : " bottom " , timeout : g , buttons : d , animation : { open : { height : " show " } , close : { height : " hide " } , easing : " swing " , speed : 200 , closeWith : h } } ) , " success " = = = e . get ( " type " ) ) return void e . destroy ( ) } $ ( " # stat_hd_counter " ) . text ( this . collection . length ) , 0 = = = this . collection . length ? ( $ ( " # stat_hd " ) . removeClass ( " fullNotification " ) , $ ( " # notification_menu " ) . hide ( ) ) : $ ( " # stat_hd " ) . addClass ( " fullNotification " ) , $ ( " . innerDropdownInnerUL " ) . html ( this . notificationItem . render ( { notifications : this . collection } ) ) , $ ( " . notificationInfoIcon " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { notifications : this . collection } ) ) , this . renderNotifications ( ) , this . delegateEvents ( ) , this . el } } ) } ( ) , function ( ) { " use strict " ; window . ProgressView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " progressBase . ejs " ) , el : " # progressPlaceholder " , el2 : " # progressPlaceholderIcon " , toShow : ! 1 , lastDelay : 0 , action : function ( ) { } , events : { " click . progress - action button " : " performAction " } , performAction : function ( ) { " function " = = typeof this . action & & this . action ( ) , window . progressView . hide ( ) } , initialize : function ( ) { } , showWithDelay : function ( a , b , c , d ) { var e = this ; e . toShow = ! 0 , e . lastDelay = a , setTimeout ( function ( ) { e . toShow = = = ! 0 & & e . show ( b , c , d ) } , e . lastDelay ) } , show : function ( a , b , c ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " . progress - text " ) . text ( a ) , c ? $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > ' + c + " < / button > " ) : $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > Cancel < / button > ' ) , b ? this . action = b : this . action = this . hide ( ) , $ ( this . el ) . show ( ) } , hide : function ( ) { var a = this ; a . toShow = ! 1 , $ ( this . el ) . hide ( ) , this . action = function ( ) { } } } ) } ( ) , function ( ) { " use strict " ; window . queryManagementView = Backbone . View . extend ( { el : " # content " , id : " # queryManagementContent " , templateActive : templateEngine . createTemplate ( " queryManagementViewActive . ejs " ) , templateSlow : templateEngine . createTemplate ( " queryManagementViewSlow . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , active : ! 0 , shouldRender : ! 0 , timer : 0 , refreshRate : 2e3 , initialize : function ( ) { var a = this ; this . activeCollection = new window . QueryManagementActive , this . slowCollection = new window . QueryManagementSlow , this . convertModelToJSON ( ! 0 ) , window . setInterval ( function ( ) { " # queries " = = = window . location . hash & & window . VISIBLE & & a . shouldRender & & " queryManagement " = = = arangoHelper . getCurrentSub ( ) . route & & ( a . active ? $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 0 ) : $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 1 ) ) } , a . refreshRate ) } , events : { " click # deleteSlowQueryHistory " : " deleteSlowQueryHistoryModal " , " click # arangoQueryManagementTable . fa - minus - circle " : " deleteRunningQueryModal " } , tableDescription : { id : " arangoQueryManagementTable " , titles : [ " ID " , " Query String " , " Runtime " , " Started " , " " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 0 ] } , deleteRunningQueryModal : function ( a ) { this . killQueryId = $ ( a . currentTarget ) . attr ( " data - id " ) ; var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , " Running Query " , " Do you want to kill the running query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Kill " , this . killRunningQuery . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Kill Running Query " , b , c ) , $ ( " . modal - delete - confirmation strong " ) . html ( " Really kill ? " ) } , killRunningQuery : function ( ) { this . collection . killRunningQuery ( this . killQueryId , this . killRunningQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , killRunningQueryCallback : function ( ) { this . convertModelToJSON ( ! 0 ) , this . renderActive ( ) } , deleteSlowQueryHistoryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( void 0 , " Slow Query Log " , " Do you want to delete the slow query log entries ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteSlowQueryHistory . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Slow Query Log " , a , b ) } , deleteSlowQueryHistory : function ( ) { this . collection . deleteSlowQueryHistory ( this . slowQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , slowQueryCallback : function ( ) { this . convertModelToJSON ( ! 1 ) , this . renderSlow ( ) } , render : function ( ) { var a = arangoHelper . getCurrentSub ( ) ; a . params . active ? ( this . active = ! 0 , this . convertModelToJSON ( ! 0 ) ) : ( this . active = ! 1 , this . convertModelToJSON ( ! 1 ) ) } , addEvents : function ( ) { var a = this ; $ ( " # queryManagementContent tbody " ) . on ( " mousedown " , function ( ) { clearTimeout ( a . timer ) , a . shouldRender = ! 1 } ) , $ ( " # queryManagementContent tbody " ) . on ( " mouseup " , function ( ) { a . timer = window . setTimeout ( function ( ) { a . shouldRender = ! 0 } , 3e3 ) } ) } , renderActive : function ( ) { this . $ el . html ( this . templateActive . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # activequeries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , renderSlow : function ( ) { this . $ el . html ( this . templateSlow . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # slowqueries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , convertModelToJSON : function ( a ) { var b = this , c = [ ] ; a = = = ! 0 ? this . collection = this . activeCollection : this . collection = this . slowCollection , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { var d = " " ; a & & ( d = ' < i data - id = " ' + b . get ( " id " ) + ' " class = " fa fa - minus - circle " > < / i > ' ) , c . push ( [ b . get ( " id " ) , b . get ( " query " ) , b . get ( " runTime " ) . toFixed ( 2 ) + " s " , b . get ( " started " ) , d ] ) } ) ; var d = " No running queries . " ; a | | ( d = " No slow queries . " ) , 0 = = = c . length & & c . push ( [ d , " " , " " , " " , " " ] ) , b . tableDescription . rows = c , a ? b . renderActive ( ) : b . renderSlow ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . queryView = Backbone . View . extend ( { el : " # content " , id : " # customsDiv " , warningTemplate : templateEngine . createTemplate ( " warningList . ejs " ) , tabArray : [ ] , execPending : ! 1 , initialize : function ( ) { this . refreshAQL ( ) , this . tableDescription . rows = this . customQueries } , events : { " click # result - switch " : " switchTab " , " click # query - switch " : " switchTab " , " click # customs - switch " : " switchTab " , " click # submitQueryButton " : " submitQuery " , " click # explainQueryButton " : " explainQuery " , " click # commentText " : " commentText " , " click # uncommentText " : " uncommentText " , " click # undoText " : " undoText " , " click # redoText " : " redoText " , " click # smallOutput " : " smallOutput " , " click # bigOutput " : " bigOutput " , " click # clearOutput " : " clearOutput " , " click # clearInput " : " clearInput " , " click # clearQueryButton " : " clearInput " , " click # addAQL " : " addAQL " , " mouseover # querySelect " : function ( ) { this . refreshAQL ( ! 0 ) } , " change # querySelect " : " importSelected " , " keypress # aqlEditor " : " aqlShortcuts " , " click # arangoQueryTable . table - cell0 " : " editCustomQuery " , " click # arangoQueryTable . table - cell1 " : " editCustomQuery " , " click # arangoQueryTable . table - cell2 a " : " deleteAQL " , " click # confirmQueryImport " : " importCustomQueries " , " click # confirmQueryExport " : " exportCustomQueries " , " click # export - query " : " exportCustomQueries " , " click # import - query " : " openExportDialog " , " click # closeQueryModal " : " closeExportDialog " , " click # downloadQueryResult " : " downloadQueryResult " } , openExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , createCustomQueryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " new - query - name " , " Name " , " " , void 0 , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No query name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . saveAQL . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Save Query " , a , b , void 0 , void 0 , { " keyup # new - query - name " : this . listenKey . bind ( this ) } ) } , updateTable : function ( ) { this . tableDescription . rows = this . customQueries , _ . each ( this . tableDescription . rows , function ( a ) { a . thirdRow = ' < a class = " deleteButton " > < span class = " icon_arangodb_roundminus " title = " Delete query " > < / span > < / a > ' , a . hasOwnProperty ( " parameter " ) & & delete a . parameter } ) , this . tableDescription . unescaped = [ ! 1 , ! 1 , ! 0 ] , this . $ ( this . id ) . html ( this . table . render ( { content : this . tableDescription } ) ) } , editCustomQuery : function ( a ) { var b = $ ( a . target ) . parent ( ) . children ( ) . first ( ) . text ( ) , c = ace . edit ( " aqlEditor " ) , d = ace . edit ( " varsEditor " ) ; c . setValue ( this . getCustomQueryValueByName ( b ) ) , d . setValue ( JSON . stringify ( this . getCustomQueryParameterByName ( b ) ) ) , this . deselect ( d ) , this . deselect ( c ) , $ ( " # querySelect " ) . val ( b ) , this . switchTab ( " query - switch " ) } , initTabArray : function ( ) { var a = this ; $ ( " . arango - tab " ) . children ( ) . each ( function ( ) { a . tabArray . push ( $ ( this ) . children ( ) . first ( ) . attr ( " id " ) ) } ) } , listenKey : function ( a ) { 13 = = = a . keyCode & & this . saveAQL ( a ) , this . checkSaveName ( ) } , checkSaveName : function ( ) { var a = $ ( " # new - query - name " ) . val ( ) ; if ( " Insert Query " = = = a ) return void $ ( " # new - query - name " ) . val ( " " ) ; var b = this . customQueries . some ( function ( b ) { return b . name = = = a } ) ; b ? ( $ ( " # modalButton1 " ) . removeClass ( " button - success " ) , $ ( " # modalButton1 " ) . addClass ( " button - warning " ) , $ ( " # modalButton1 " ) . text ( " Update " ) ) : ( $ ( " # modalButton1 " ) . removeClass ( " button - warning " ) , $ ( " # modalButton1 " ) . addClass ( " button - success " ) , $ ( " # modalButton1 " ) . text ( " Save " ) ) } , clearOutput : function ( ) { var a = ace . edit ( " queryOutput " ) ; a . setValue ( " " ) } , clearInput : function ( ) { var a = ace . edit ( " aqlEditor " ) , b = ace . edit ( " varsEditor " ) ; this . setCachedQuery ( a . getValue ( ) , b . getValue ( ) ) , a . setValue ( " " ) , b . setValue ( " " ) } , smallOutput : function ( ) { var a = ace . edit ( " queryOutput " ) ; a . getSession ( ) . foldAll ( ) } , bigOutput : function ( ) { var a = ace . edit ( " queryOutput " ) ; a . getSession ( ) . unfold ( ) } , aqlShortcuts : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? this . submitQuery ( ) : a . metaKey & & ! a . ctrlKey & & 13 = = = a . keyCode & & this . submitQuery ( ) } , queries : [ ] , customQueries : [ ] , tableDescription : { id : " arangoQueryTable " , titles : [ " Name " , " Content " , " " ] , rows : [ ] } , template : templateEngine . createTemplate ( " queryView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , render : function ( ) { var a = this ; this . $ el . html ( this . template . render ( { } ) ) , <nl> - this . $ ( this . id ) . html ( this . table . render ( { content : this . tableDescription } ) ) ; var b = 1e3 , c = $ ( " # querySize " ) ; c . empty ( ) , [ 100 , 250 , 500 , 1e3 , 2500 , 5e3 , 1e4 , " all " ] . forEach ( function ( a ) { c . append ( ' < option value = " ' + _ . escape ( a ) + ' " ' + ( b = = = a ? " selected " : " " ) + " > " + _ . escape ( a ) + " results < / option > " ) } ) ; var d = ace . edit ( " queryOutput " ) ; d . setReadOnly ( ! 0 ) , d . setHighlightActiveLine ( ! 1 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setFontSize ( " 13px " ) , d . setValue ( " " ) ; var e = ace . edit ( " aqlEditor " ) ; e . getSession ( ) . setMode ( " ace / mode / aql " ) , e . setFontSize ( " 13px " ) , e . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) ; var f = ace . edit ( " varsEditor " ) ; f . getSession ( ) . setMode ( " ace / mode / aql " ) , f . setFontSize ( " 13px " ) , f . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) ; var g = this . getCachedQuery ( ) ; null ! = = g & & void 0 ! = = g & & " " ! = = g & & ( e . setValue ( g . query ) , " " = = = g . parameter | | void 0 = = = g ? f . setValue ( " { } " ) : f . setValue ( g . parameter ) ) ; var h = function ( ) { var b = e . getSession ( ) , c = e . getCursorPosition ( ) , d = b . getTokenAt ( c . row , c . column ) ; d & & ( " comment " = = = d . type ? $ ( " # commentText i " ) . removeClass ( " fa - comment " ) . addClass ( " fa - comment - o " ) . attr ( " data - original - title " , " Uncomment " ) : $ ( " # commentText i " ) . removeClass ( " fa - comment - o " ) . addClass ( " fa - comment " ) . attr ( " data - original - title " , " Comment " ) ) ; var g = e . getValue ( ) , h = f . getValue ( ) ; 1 = = = g . length & & ( g = " " ) , 1 = = = h . length & & ( h = " " ) , a . setCachedQuery ( g , h ) } ; e . getSession ( ) . selection . on ( " changeCursor " , function ( ) { h ( ) } ) , f . getSession ( ) . selection . on ( " changeCursor " , function ( ) { h ( ) } ) , $ ( " # queryOutput " ) . resizable ( { handles : " s " , ghost : ! 0 , stop : function ( ) { setTimeout ( function ( ) { var a = ace . edit ( " queryOutput " ) ; a . resize ( ) } , 200 ) } } ) , arangoHelper . fixTooltips ( " . vars - editor - header i , . queryTooltips , . icon_arangodb " , " top " ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) ; var i = $ ( window ) . height ( ) - 295 ; return $ ( " # aqlEditor " ) . height ( i - 100 - 29 ) , $ ( " # varsEditor " ) . height ( 100 ) , $ ( " # queryOutput " ) . height ( i ) , e . resize ( ) , d . resize ( ) , this . initTabArray ( ) , this . renderSelectboxes ( ) , this . deselect ( f ) , this . deselect ( d ) , this . deselect ( e ) , $ ( " # queryDiv " ) . show ( ) , $ ( " # customsDiv " ) . show ( ) , this . initQueryImport ( ) , this . switchTab ( " query - switch " ) , this } , getCachedQuery : function ( ) { if ( " undefined " ! = = Storage ) { var a = localStorage . getItem ( " cachedQuery " ) ; if ( void 0 ! = = a ) { var b = JSON . parse ( a ) ; return b } } } , setCachedQuery : function ( a , b ) { if ( " undefined " ! = = Storage ) { var c = { query : a , parameter : b } ; localStorage . setItem ( " cachedQuery " , JSON . stringify ( c ) ) } } , initQueryImport : function ( ) { var a = this ; a . allowUpload = ! 1 , $ ( " # importQueries " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , a . allowUpload = ! 0 , $ ( " # confirmQueryImport " ) . removeClass ( " disabled " ) } ) } , importCustomQueries : function ( ) { var a = this ; if ( this . allowUpload = = = ! 0 ) { var b = function ( ) { this . collection . fetch ( { success : function ( ) { a . updateLocalQueries ( ) , a . renderSelectboxes ( ) , a . updateTable ( ) , a . allowUpload = ! 1 , $ ( " # customs - switch " ) . click ( ) , $ ( " # confirmQueryImport " ) . addClass ( " disabled " ) , $ ( " # queryImportDialog " ) . modal ( " hide " ) } , error : function ( a ) { arangoHelper . arangoError ( " Custom Queries " , a . responseText ) } } ) } . bind ( this ) ; a . collection . saveImportQueries ( a . file , b . bind ( this ) ) } } , downloadQueryResult : function ( ) { var a = ace . edit ( " aqlEditor " ) , b = a . getValue ( ) ; " " ! = = b | | void 0 ! = = b | | null ! = = b ? window . open ( " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : b } ) ) ) ) : arangoHelper . arangoError ( " Query error " , " could not query result . " ) } , exportCustomQueries : function ( ) { var a , b = { } , c = [ ] ; _ . each ( this . customQueries , function ( a ) { c . push ( { name : a . name , value : a . value , parameter : a . parameter } ) } ) , b = { extra : { queries : c } } , $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a = b . user , ( null = = = a | | a = = = ! 1 ) & & ( a = " root " ) , window . open ( " query / download / " + encodeURIComponent ( a ) ) } ) } , deselect : function ( a ) { var b = a . getSelection ( ) , c = b . lead . row , d = b . lead . column ; b . setSelectionRange ( { start : { row : c , column : d } , end : { row : c , column : d } } ) , a . focus ( ) } , addAQL : function ( ) { this . refreshAQL ( ! 0 ) , this . createCustomQueryModal ( ) , $ ( " # new - query - name " ) . val ( $ ( " # querySelect " ) . val ( ) ) , setTimeout ( function ( ) { $ ( " # new - query - name " ) . focus ( ) } , 500 ) , this . checkSaveName ( ) } , getAQL : function ( a ) { var b = this ; this . collection . fetch ( { success : function ( ) { var c = localStorage . getItem ( " customQueries " ) ; if ( c ) { var d = JSON . parse ( c ) ; _ . each ( d , function ( a ) { b . collection . add ( { value : a . value , name : a . name } ) } ) ; var e = function ( a , b ) { a ? arangoHelper . arangoError ( " Custom Queries " , " Could not import old local storage queries " ) : localStorage . removeItem ( " customQueries " ) } . bind ( b ) ; b . collection . saveCollectionQueries ( e ) } b . updateLocalQueries ( ) , a & & a ( ) } } ) } , deleteAQL : function ( a ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Query " , " Could not delete query . " ) : ( this . updateLocalQueries ( ) , this . renderSelectboxes ( ) , this . updateTable ( ) ) } . bind ( this ) , c = $ ( a . target ) . parent ( ) . parent ( ) . parent ( ) . children ( ) . first ( ) . text ( ) , d = this . collection . findWhere ( { name : c } ) ; this . collection . remove ( d ) , this . collection . saveCollectionQueries ( b ) } , updateLocalQueries : function ( ) { var a = this ; this . customQueries = [ ] , this . collection . each ( function ( b ) { a . customQueries . push ( { name : b . get ( " name " ) , value : b . get ( " value " ) , parameter : b . get ( " parameter " ) } ) } ) } , saveAQL : function ( a ) { a . stopPropagation ( ) , this . refreshAQL ( ) ; var b = ace . edit ( " aqlEditor " ) , c = ace . edit ( " varsEditor " ) , d = $ ( " # new - query - name " ) . val ( ) , e = c . getValue ( ) ; if ( ! $ ( " # new - query - name " ) . hasClass ( " invalid - input " ) & & " " ! = = d . trim ( ) ) { var f = b . getValue ( ) , g = ! 1 ; if ( $ . each ( this . customQueries , function ( a , b ) { return b . name = = = d ? ( b . value = f , void ( g = ! 0 ) ) : void 0 } ) , g = = = ! 0 ) this . collection . findWhere ( { name : d } ) . set ( " value " , f ) ; else { if ( ( " " = = = e | | void 0 = = = e ) & & ( e = " { } " ) , " string " = = typeof e ) try { e = JSON . parse ( e ) } catch ( h ) { console . log ( " could not parse bind parameter " ) } this . collection . add ( { name : d , parameter : e , value : f } ) } var i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var b = this ; this . collection . fetch ( { success : function ( ) { b . updateLocalQueries ( ) , b . renderSelectboxes ( ) , $ ( " # querySelect " ) . val ( d ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( i ) , window . modalView . hide ( ) } } , getSystemQueries : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : " js / arango / aqltemplates . json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a & & a ( ! 1 ) , b . queries = c } , error : function ( ) { a & & a ( ! 0 ) , arangoHelper . arangoNotification ( " Query " , " Error while loading system templates " ) } } ) } , getCustomQueryValueByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " value " ) } , getCustomQueryParameterByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " parameter " ) } , refreshAQL : function ( a ) { var b = this , c = function ( c ) { if ( c ) arangoHelper . arangoError ( " Query " , " Could not reload Queries " ) ; else if ( b . updateLocalQueries ( ) , a ) { var d = $ ( " # querySelect " ) . val ( ) ; b . renderSelectboxes ( ) , $ ( " # querySelect " ) . val ( d ) } } . bind ( b ) , d = function ( ) { b . getSystemQueries ( c ) } . bind ( b ) ; this . getAQL ( d ) } , importSelected : function ( a ) { var b = ace . edit ( " aqlEditor " ) , c = ace . edit ( " varsEditor " ) ; _ . each ( this . queries , function ( d ) { $ ( " # " + a . currentTarget . id ) . val ( ) = = = d . name & & ( b . setValue ( d . value ) , d . hasOwnProperty ( " parameter " ) ? ( ( " " = = = d . parameter | | void 0 = = = d . parameter ) & & ( d . parameter = " { } " ) , " object " = = typeof d . parameter ? c . setValue ( JSON . stringify ( d . parameter ) ) : c . setValue ( d . parameter ) ) : c . setValue ( " { } " ) ) } ) , _ . each ( this . customQueries , function ( d ) { $ ( " # " + a . currentTarget . id ) . val ( ) = = = d . name & & ( b . setValue ( d . value ) , d . hasOwnProperty ( " parameter " ) ? ( ( " " = = = d . parameter | | void 0 = = = d . parameter | | " { } " = = = JSON . stringify ( d . parameter ) ) & & ( d . parameter = " { } " ) , c . setValue ( d . parameter ) ) : c . setValue ( " { } " ) ) } ) , this . deselect ( ace . edit ( " varsEditor " ) ) , this . deselect ( ace . edit ( " aqlEditor " ) ) } , renderSelectboxes : function ( ) { this . sortQueries ( ) ; var a = " " ; a = " # querySelect " , $ ( a ) . empty ( ) , $ ( a ) . append ( ' < option id = " emptyquery " > Insert Query < / option > ' ) , $ ( a ) . append ( ' < optgroup label = " Example queries " > ' ) , jQuery . each ( this . queries , function ( b , c ) { $ ( a ) . append ( ' < option id = " ' + _ . escape ( c . name ) + ' " > ' + _ . escape ( c . name ) + " < / option > " ) } ) , $ ( a ) . append ( " < / optgroup > " ) , this . customQueries . length > 0 & & ( $ ( a ) . append ( ' < optgroup label = " Custom queries " > ' ) , jQuery . each ( this . customQueries , function ( b , c ) { $ ( a ) . append ( ' < option id = " ' + _ . escape ( c . name ) + ' " > ' + _ . escape ( c . name ) + " < / option > " ) } ) , $ ( a ) . append ( " < / optgroup > " ) ) } , undoText : function ( ) { var a = ace . edit ( " aqlEditor " ) ; a . undo ( ) } , redoText : function ( ) { var a = ace . edit ( " aqlEditor " ) ; a . redo ( ) } , commentText : function ( ) { var a = ace . edit ( " aqlEditor " ) ; a . toggleCommentLines ( ) } , sortQueries : function ( ) { this . queries = _ . sortBy ( this . queries , " name " ) , this . customQueries = _ . sortBy ( this . customQueries , " name " ) } , readQueryData : function ( ) { var a = ace . edit ( " aqlEditor " ) , b = ace . edit ( " varsEditor " ) , c = a . session . getTextRange ( a . getSelectionRange ( ) ) , d = $ ( " # querySize " ) , e = { query : c | | a . getValue ( ) , id : " currentFrontendQuery " } ; " all " ! = = d . val ( ) & & ( e . batchSize = parseInt ( d . val ( ) , 10 ) ) ; var f = b . getValue ( ) ; if ( f . length > 0 ) try { var g = JSON . parse ( f ) ; 0 ! = = Object . keys ( g ) . length & & ( e . bindVars = g ) } catch ( h ) { return arangoHelper . arangoError ( " Query error " , " Could not parse bind parameters . " ) , ! 1 } return JSON . stringify ( e ) } , heatmapColors : [ " # 313695 " , " # 4575b4 " , " # 74add1 " , " # abd9e9 " , " # e0f3f8 " , " # ffffbf " , " # fee090 " , " # fdae61 " , " # f46d43 " , " # d73027 " , " # a50026 " ] , heatmap : function ( a ) { return this . heatmapColors [ Math . floor ( 10 * a ) ] } , followQueryPath : function ( a , b ) { var c = { } , d = 0 ; c [ b [ 0 ] . id ] = a ; var e , f , g , h ; for ( e = 1 ; e < b . length ; + + e ) for ( f = this . preparePlanNodeEntry ( b [ e ] , b [ e - 1 ] . estimatedCost ) , c [ b [ e ] . id ] = f , h = b [ e ] . dependencies , d = f . estimatedCost , g = 0 ; g < h . length ; + + g ) c [ h [ g ] ] . children . push ( f ) ; return console . log ( d ) , d } , preparePlanNodeEntry : function ( a , b ) { var c = { estimatedCost : a . estimatedCost , estimatedNrItems : a . estimatedNrItems , type : a . type , children : [ ] } ; switch ( a . type ) { case " SubqueryNode " : c . relativeCost = c . estimatedCost - this . followQueryPath ( c , a . subquery . nodes ) ; break ; default : c . relativeCost = c . estimatedCost - b | | c . estimatedCost } return c } , fillExplain : function ( a ) { var b = this , c = ace . edit ( " queryOutput " ) , d = this . readQueryData ( ) ; $ ( " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 , d & & ( window . progressView . show ( " Explain is operating . . . " ) , $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / query / explain / " ) , data : d , contentType : " application / json " , processData : ! 1 , success : function ( d ) { c . setValue ( d . msg ) , b . switchTab ( " result - switch " ) , window . progressView . hide ( ) , b . deselect ( c ) , $ ( " # downloadQueryResult " ) . hide ( ) , " function " = = typeof a & & a ( ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) } , error : function ( b ) { window . progressView . hide ( ) ; try { var c = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " Explain error " , c . errorNum ) } catch ( d ) { arangoHelper . arangoError ( " Explain error " , " ERROR " ) } window . progressView . hide ( ) , " function " = = typeof a & & a ( ) } } ) ) } , resize : function ( ) { } , checkQueryTimer : void 0 , queryCallbackFunction : function ( a , b ) { var c = this , d = ace . edit ( " queryOutput " ) , e = function ( ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( c . checkQueryTimer ) , arangoHelper . arangoNotification ( " Query " , " Query canceled . " ) , window . progressView . hide ( ) } } ) } ; window . progressView . show ( " Query is operating . . . " , e , " Cancel Query " ) , $ ( " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 ; var f = function ( a ) { var b = " " ; a . extra & & a . extra . warnings & & a . extra . warnings . length > 0 & & ( b + = " Warnings : \ r \ n \ r \ n " , a . extra . warnings . forEach ( function ( a ) { b + = " [ " + a . code + " ] , ' " + a . message + " ' \ r \ n " } ) ) , " " ! = = b & & ( b + = " \ r \ nResult : \ r \ n \ r \ n " ) , d . setValue ( b + JSON . stringify ( a . result , void 0 , 2 ) ) } , g = function ( a ) { f ( a ) , c . switchTab ( " result - switch " ) , window . progressView . hide ( ) ; var e = " - " ; a & & a . extra & & a . extra . stats & & ( e = a . extra . stats . executionTime . toFixed ( 3 ) + " s " ) , $ ( " . queryExecutionTime " ) . text ( " Execution time : " + e ) , c . deselect ( d ) , $ ( " # downloadQueryResult " ) . show ( ) , " function " = = typeof b & & b ( ) } , h = function ( ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a , b , d ) { 201 = = = d . status ? g ( a ) : 204 = = = d . status & & ( c . checkQueryTimer = window . setTimeout ( function ( ) { h ( ) } , 500 ) ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; b . errorMessage & & arangoHelper . arangoError ( " Query " , b . errorMessage ) } catch ( c ) { arangoHelper . arangoError ( " Query " , " Something went wrong . " ) } window . progressView . hide ( ) } } ) } ; h ( ) } , fillResult : function ( a ) { var b = this , c = ace . edit ( " queryOutput " ) ; c . setValue ( " " ) ; var d = this . readQueryData ( ) ; d & & $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , headers : { " x - arango - async " : " store " } , data : d , contentType : " application / json " , processData : ! 1 , success : function ( c , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) & & b . queryCallbackFunction ( e . getResponseHeader ( " x - arango - async - id " ) , a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) } , error : function ( d ) { b . switchTab ( " result - switch " ) , $ ( " # downloadQueryResult " ) . hide ( ) ; try { var e = JSON . parse ( d . responseText ) ; c . setValue ( " [ " + e . errorNum + " ] " + e . errorMessage ) } catch ( f ) { c . setValue ( " ERROR " ) , arangoHelper . arangoError ( " Query error " , " ERROR " ) } window . progressView . hide ( ) , " function " = = typeof a & & a ( ) } } ) } , submitQuery : function ( ) { var a = ace . edit ( " queryOutput " ) ; this . fillResult ( this . switchTab . bind ( this , " result - switch " ) ) , a . resize ( ) ; var b = ace . edit ( " aqlEditor " ) ; this . deselect ( b ) , $ ( " # downloadQueryResult " ) . show ( ) } , explainQuery : function ( ) { this . fillExplain ( ) } , switchTab : function ( a ) { var b ; b = " string " = = typeof a ? a : a . target . id ; var c = this , d = function ( a ) { var d = " # " + a . replace ( " - switch " , " " ) , e = " # tabContent " + d . charAt ( 1 ) . toUpperCase ( ) + d . substr ( 2 ) ; a = = = b ? ( $ ( " # " + a ) . parent ( ) . addClass ( " active " ) , $ ( d ) . addClass ( " active " ) , $ ( e ) . show ( ) , " query - switch " = = = b ? $ ( " # aqlEditor . ace_text - input " ) . focus ( ) : " result - switch " = = = b & & c . execPending & & c . fillResult ( ) ) : ( $ ( " # " + a ) . parent ( ) . removeClass ( " active " ) , $ ( d ) . removeClass ( " active " ) , $ ( e ) . hide ( ) ) } ; this . tabArray . forEach ( d ) , this . updateTable ( ) } } ) } ( ) , function ( ) { " use strict " ; window . queryView2 = Backbone . View . extend ( { el : " # content " , bindParamId : " # bindParamEditor " , myQueriesId : " # queryTable " , template : templateEngine . createTemplate ( " queryView2 . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , outputDiv : " # outputEditors " , outputTemplate : templateEngine . createTemplate ( " queryViewOutput . ejs " ) , outputCounter : 0 , allowUpload : ! 1 , customQueries : [ ] , queries : [ ] , state : { lastQuery : { query : void 0 , bindParam : void 0 } } , settings : { aqlWidth : void 0 } , currentQuery : { } , initDone : ! 1 , bindParamRegExp : / @ ( @ ? \ w + \ d * ) / , bindParamTableObj : { } , bindParamTableDesc : { id : " arangoBindParamTable " , titles : [ " Key " , " Value " ] , rows : [ ] } , myQueriesTableDesc : { id : " arangoMyQueriesTable " , titles : [ " Name " , " Actions " ] , rows : [ ] } , execPending : ! 1 , aqlEditor : null , queryPreview : null , initialize : function ( ) { this . refreshAQL ( ) } , allowParamToggle : ! 0 , events : { " click # executeQuery " : " executeQuery " , " click # explainQuery " : " explainQuery " , " click # clearQuery " : " clearQuery " , " click . outputEditorWrapper # downloadQueryResult " : " downloadQueryResult " , " click . outputEditorWrapper . switchAce " : " switchAce " , " click . outputEditorWrapper . fa - close " : " closeResult " , " click # toggleQueries1 " : " toggleQueries " , " click # toggleQueries2 " : " toggleQueries " , " click # saveCurrentQuery " : " addAQL " , " click # exportQuery " : " exportCustomQueries " , " click # importQuery " : " openImportDialog " , " click # removeResults " : " removeResults " , " click # querySpotlight " : " showSpotlight " , " click # deleteQuery " : " selectAndDeleteQueryFromTable " , " click # explQuery " : " selectAndExplainQueryFromTable " , " keydown # arangoBindParamTable input " : " updateBindParams " , " change # arangoBindParamTable input " : " updateBindParams " , " click # arangoMyQueriesTable tbody tr " : " showQueryPreview " , " dblclick # arangoMyQueriesTable tbody tr " : " selectQueryFromTable " , " click # arangoMyQueriesTable # copyQuery " : " selectQueryFromTable " , " click # closeQueryModal " : " closeExportDialog " , " click # confirmQueryImport " : " importCustomQueries " , " click # switchTypes " : " toggleBindParams " , " click # arangoMyQueriesTable # runQuery " : " selectAndRunQueryFromTable " } , clearQuery : function ( ) { this . aqlEditor . setValue ( " " , 1 ) } , toggleBindParams : function ( ) { this . allowParamToggle ? ( $ ( " # bindParamEditor " ) . toggle ( ) , $ ( " # bindParamAceEditor " ) . toggle ( ) , " JSON " = = = $ ( " # switchTypes " ) . text ( ) ? ( $ ( " # switchTypes " ) . text ( " Table " ) , this . updateQueryTable ( ) , this . bindParamAceEditor . setValue ( JSON . stringify ( this . bindParamTableObj , null , " " ) , 1 ) , this . deselect ( this . bindParamAceEditor ) ) : ( $ ( " # switchTypes " ) . text ( " JSON " ) , this . renderBindParamTable ( ) ) ) : arangoHelper . arangoError ( " Bind parameter " , " Could not parse bind parameter " ) , this . resize ( ) } , openExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , initQueryImport : function ( ) { var a = this ; a . allowUpload = ! 1 , $ ( " # importQueries " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , a . allowUpload = ! 0 , $ ( " # confirmQueryImport " ) . removeClass ( " disabled " ) } ) } , importCustomQueries : function ( ) { var a = this ; if ( this . allowUpload = = = ! 0 ) { var b = function ( ) { this . collection . fetch ( { success : function ( ) { a . updateLocalQueries ( ) , a . updateQueryTable ( ) , a . resize ( ) , a . allowUpload = ! 1 , $ ( " # confirmQueryImport " ) . addClass ( " disabled " ) , $ ( " # queryImportDialog " ) . modal ( " hide " ) } , error : function ( a ) { arangoHelper . arangoError ( " Custom Queries " , a . responseText ) } } ) } . bind ( this ) ; a . collection . saveImportQueries ( a . file , b . bind ( this ) ) } } , removeResults : function ( ) { $ ( " . outputEditorWrapper " ) . hide ( " fast " , function ( ) { $ ( " . outputEditorWrapper " ) . remove ( ) } ) , $ ( " # removeResults " ) . hide ( ) } , getCustomQueryParameterByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " parameter " ) } , getCustomQueryValueByName : function ( a ) { var b ; return a & & ( b = this . collection . findWhere ( { name : a } ) ) , b ? b = b . get ( " value " ) : _ . each ( this . queries , function ( c ) { c . name = = = a & & ( b = c . value ) } ) , b } , openImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , exportCustomQueries : function ( ) { var a ; $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a = b . user , ( null = = = a | | a = = = ! 1 ) & & ( a = " root " ) , window . open ( " query / download / " + encodeURIComponent ( a ) ) } ) } , toggleQueries : function ( a ) { a & & " toggleQueries1 " = = = a . currentTarget . id ? ( this . updateQueryTable ( ) , $ ( " # bindParamAceEditor " ) . hide ( ) , $ ( " # bindParamEditor " ) . show ( ) , $ ( " # switchTypes " ) . text ( " JSON " ) , $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) , this . queryPreview . setValue ( " No query selected . " , 1 ) , this . deselect ( this . queryPreview ) ) : void 0 = = = this . settings . aqlWidth ? $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) : $ ( " . aqlEditorWrapper " ) . first ( ) . width ( this . settings . aqlWidth ) , this . resize ( ) ; var b = [ " aqlEditor " , " queryTable " , " previewWrapper " , " querySpotlight " , " bindParamEditor " , " toggleQueries1 " , " toggleQueries2 " , " saveCurrentQuery " , " querySize " , " executeQuery " , " switchTypes " , " explainQuery " , " importQuery " , " exportQuery " ] ; _ . each ( b , function ( a ) { $ ( " # " + a ) . toggle ( ) } ) , this . resize ( ) } , showQueryPreview : function ( a ) { $ ( " # arangoMyQueriesTable tr " ) . removeClass ( " selected " ) , $ ( a . currentTarget ) . addClass ( " selected " ) ; var b = this . getQueryNameFromTable ( a ) ; this . queryPreview . setValue ( this . getCustomQueryValueByName ( b ) , 1 ) , this . deselect ( this . queryPreview ) } , getQueryNameFromTable : function ( a ) { var b ; return $ ( a . currentTarget ) . is ( " tr " ) ? b = $ ( a . currentTarget ) . children ( ) . first ( ) . text ( ) : $ ( a . currentTarget ) . is ( " span " ) & & ( b = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . text ( ) ) , b } , deleteQueryModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , a , " Do you want to delete the query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteAQL . bind ( this , a ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Query " , b , c ) } , selectAndDeleteQueryFromTable : function ( a ) { var b = this . getQueryNameFromTable ( a ) ; this . deleteQueryModal ( b ) } , selectAndExplainQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . explainQuery ( ) } , selectAndRunQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . executeQuery ( ) } , selectQueryFromTable : function ( a , b ) { var c = this . getQueryNameFromTable ( a ) , d = this ; void 0 = = = b & & this . toggleQueries ( ) , this . state . lastQuery . query = this . aqlEditor . getValue ( ) , this . state . lastQuery . bindParam = this . bindParamTableObj , this . aqlEditor . setValue ( this . getCustomQueryValueByName ( c ) , 1 ) , this . fillBindParamTable ( this . getCustomQueryParameterByName ( c ) ) , this . updateBindParams ( ) , $ ( " # lastQuery " ) . remove ( ) , $ ( " # queryContent . arangoToolbarTop . pull - left " ) . append ( ' < span id = " lastQuery " class = " clickable " > Previous Query < / span > ' ) , $ ( " # lastQuery " ) . hide ( ) . fadeIn ( 500 ) . on ( " click " , function ( ) { d . aqlEditor . setValue ( d . state . lastQuery . query , 1 ) , d . fillBindParamTable ( d . state . lastQuery . bindParam ) , d . updateBindParams ( ) , $ ( " # lastQuery " ) . fadeOut ( 500 , function ( ) { $ ( this ) . remove ( ) } ) } ) } , deleteAQL : function ( a ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Query " , " Could not delete query . " ) : ( this . updateLocalQueries ( ) , this . updateQueryTable ( ) , this . resize ( ) , window . modalView . hide ( ) ) } . bind ( this ) , c = this . collection . findWhere ( { name : a } ) ; this . collection . remove ( c ) , this . collection . saveCollectionQueries ( b ) } , switchAce : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) ; " Result " = = = $ ( a . currentTarget ) . text ( ) ? $ ( a . currentTarget ) . text ( " AQL " ) : $ ( a . currentTarget ) . text ( " Result " ) , $ ( " # outputEditor " + b ) . toggle ( ) , $ ( " # sentWrapper " + b ) . toggle ( ) , this . deselect ( ace . edit ( " outputEditor " + b ) ) , this . deselect ( ace . edit ( " sentQueryEditor " + b ) ) , this . deselect ( ace . edit ( " sentBindParamEditor " + b ) ) } , downloadQueryResult : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) , c = ace . edit ( " sentQueryEditor " + b ) , d = c . getValue ( ) ; " " ! = = d | | void 0 ! = = d | | null ! = = d ? 0 = = = Object . keys ( this . bindParamTableObj ) . length ? window . open ( " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d } ) ) ) ) : window . open ( " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d , bindVars : this . bindParamTableObj } ) ) ) ) : arangoHelper . arangoError ( " Query error " , " could not query result . " ) } , explainQuery : function ( ) { if ( ! this . verifyQueryAndParams ( ) ) { this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : this . outputCounter , type : " Explain " } ) ) ; var a = this . outputCounter , b = ace . edit ( " outputEditor " + a ) , c = ace . edit ( " sentQueryEditor " + a ) , d = ace . edit ( " sentBindParamEditor " + a ) ; c . getSession ( ) . setMode ( " ace / mode / aql " ) , c . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , c . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( c ) , b . setReadOnly ( ! 0 ) , b . getSession ( ) . setMode ( " ace / mode / json " ) , b . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , this . setEditorAutoHeight ( b ) , d . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( d ) , this . fillExplain ( b , c , a ) , this . outputCounter + + } } , fillExplain : function ( a , b , c ) { b . setValue ( this . aqlEditor . getValue ( ) , 1 ) ; var d = this , e = this . readQueryData ( ) ; if ( $ ( " # outputEditorWrapper " + c + " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 , e ) { var f = function ( ) { $ ( " # outputEditorWrapper " + c + " # spinner " ) . remove ( ) , $ ( " # outputEditor " + c ) . css ( " opacity " , " 1 " ) , $ ( " # outputEditorWrapper " + c + " . fa - close " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " . switchAce " ) . show ( ) } ; $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / query / explain / " ) , data : e , contentType : " application / json " , processData : ! 1 , success : function ( b ) { b . msg . includes ( " errorMessage " ) ? ( d . removeOutputEditor ( c ) , arangoHelper . arangoError ( " Explain " , b . msg ) ) : ( a . setValue ( b . msg , 1 ) , d . deselect ( a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , d . handleResult ( c ) ) , f ( ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " Explain " , b . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Explain " , " ERROR " ) } d . handleResult ( c ) , d . removeOutputEditor ( c ) , f ( ) } } ) } } , removeOutputEditor : function ( a ) { $ ( " # outputEditorWrapper " + a ) . hide ( ) , $ ( " # outputEditorWrapper " + a ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & $ ( " # removeResults " ) . hide ( ) } , getCachedQueryAfterRender : function ( ) { var a = this . getCachedQuery ( ) , b = this ; if ( null ! = = a & & void 0 ! = = a & & " " ! = = a & & ( this . aqlEditor . setValue ( a . query , 1 ) , this . aqlEditor . getSession ( ) . setUndoManager ( new ace . UndoManager ) , " " ! = = a . parameter | | void 0 ! = = a ) ) try { b . bindParamTableObj = JSON . parse ( a . parameter ) ; var c ; _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { c = $ ( a ) . attr ( " name " ) , $ ( a ) . val ( b . bindParamTableObj [ c ] ) } ) , b . setCachedQuery ( b . aqlEditor . getValue ( ) , JSON . stringify ( b . bindParamTableObj ) ) } catch ( d ) { } } , getCachedQuery : function ( ) { if ( " undefined " ! = = Storage ) { var a = localStorage . getItem ( " cachedQuery " ) ; if ( void 0 ! = = a ) { var b = JSON . parse ( a ) ; this . currentQuery = b ; try { this . bindParamTableObj = JSON . parse ( b . parameter ) } catch ( c ) { } return b } } } , setCachedQuery : function ( a , b ) { if ( " undefined " ! = = Storage ) { var c = { query : a , parameter : b } ; this . currentQuery = c , localStorage . setItem ( " cachedQuery " , JSON . stringify ( c ) ) } } , closeResult : function ( a ) { var b = $ ( " # " + $ ( a . currentTarget ) . attr ( " element " ) ) . parent ( ) ; $ ( b ) . hide ( " fast " , function ( ) { $ ( b ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & $ ( " # removeResults " ) . hide ( ) } ) } , fillSelectBoxes : function ( ) { var a = 1e3 , b = $ ( " # querySize " ) ; b . empty ( ) , [ 100 , 250 , 500 , 1e3 , 2500 , 5e3 , 1e4 , " all " ] . forEach ( function ( c ) { b . append ( ' < option value = " ' + _ . escape ( c ) + ' " ' + ( a = = = c ? " selected " : " " ) + " > " + _ . escape ( c ) + " results < / option > " ) } ) } , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) , this . afterRender ( ) , this . initDone | | ( this . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) ) , this . initDone = ! 0 , this . renderBindParamTable ( ! 0 ) } , afterRender : function ( ) { var a = this ; this . initAce ( ) , this . initTables ( ) , this . fillSelectBoxes ( ) , this . makeResizeable ( ) , this . initQueryImport ( ) , this . getCachedQueryAfterRender ( ) , $ ( " . inputEditorWrapper " ) . height ( $ ( window ) . height ( ) / 10 * 5 + 25 ) , window . setTimeout ( function ( ) { a . resize ( ) } , 10 ) , a . deselect ( a . aqlEditor ) } , showSpotlight : function ( a ) { var b , c ; if ( ( void 0 = = = a | | " click " = = = a . type ) & & ( a = " aql " ) , " aql " = = = a ) b = function ( a ) { this . aqlEditor . insert ( a ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } . bind ( this ) , c = function ( ) { $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } ; else { var d = $ ( " : focus " ) ; b = function ( a ) { var b = $ ( d ) . val ( ) ; $ ( d ) . val ( b + a ) , $ ( d ) . focus ( ) } . bind ( this ) , c = function ( ) { $ ( d ) . focus ( ) } } window . spotlightView . show ( b , c , a ) } , resize : function ( ) { this . resizeFunction ( ) } , resizeFunction : function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) ? ( this . aqlEditor . resize ( ) , $ ( " # arangoBindParamTable thead " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable thead th " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) , $ ( " # arangoBindParamTable tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody " ) . css ( " height " , $ ( " # aqlEditor " ) . height ( ) - 35 ) , $ ( " # arangoBindParamTable tbody " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody td " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) ) : ( this . queryPreview . resize ( ) , $ ( " # arangoMyQueriesTable thead " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable thead th " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) , $ ( " # arangoMyQueriesTable tr " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " height " , $ ( " # queryTable " ) . height ( ) - 35 ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody td " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) ) } , makeResizeable : function ( ) { var a = this ; $ ( " . aqlEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) , a . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) } , handles : " e " } ) , $ ( " . inputEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) } , handles : " s " } ) , this . resizeFunction ( ) } , initTables : function ( ) { this . $ ( this . bindParamId ) . html ( this . table . render ( { content : this . bindParamTableDesc } ) ) , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , checkType : function ( a ) { var b = " stringtype " ; try { a = JSON . parse ( a ) , b = a instanceof Array ? " arraytype " : typeof a + " type " } catch ( c ) { } return b } , updateBindParams : function ( a ) { var b , c = this ; if ( a ) { b = $ ( a . currentTarget ) . attr ( " name " ) , this . bindParamTableObj [ b ] = arangoHelper . parseInput ( a . currentTarget ) ; var d = [ " arraytype " , " objecttype " , " booleantype " , " numbertype " , " stringtype " ] ; _ . each ( d , function ( b ) { $ ( a . currentTarget ) . removeClass ( b ) } ) , $ ( a . currentTarget ) . addClass ( c . checkType ( $ ( a . currentTarget ) . val ( ) ) ) } else _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { b = $ ( a ) . attr ( " name " ) , c . bindParamTableObj [ b ] = arangoHelper . parseInput ( a ) } ) ; this . setCachedQuery ( this . aqlEditor . getValue ( ) , JSON . stringify ( this . bindParamTableObj ) ) , a & & ( ( a . ctrlKey | | a . metaKey ) & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . executeQuery ( ) ) , ( a . ctrlKey | | a . metaKey ) & & 32 = = = a . keyCode & & ( a . preventDefault ( ) , this . showSpotlight ( " bind " ) ) ) } , parseQuery : function ( a ) { var b = 0 , c = 1 , d = 2 , e = 3 , f = 4 , g = 5 , h = 6 , i = 7 ; a + = " " ; var j , k , l , m = this , n = b , o = a . length , p = [ ] ; for ( k = 0 ; o > k ; + + k ) switch ( l = a . charAt ( k ) , n ) { case b : " @ " = = = l ? ( n = h , j = k ) : " ' " = = = l ? n = c : ' " ' = = = l ? n = d : " ` " = = = l ? n = e : " ´ " = = = l ? n = i : " / " = = = l & & o > k + 1 & & ( " / " = = = a . charAt ( k + 1 ) ? ( n = f , + + k ) : " * " = = = a . charAt ( k + 1 ) & & ( n = g , + + k ) ) ; break ; case f : ( " \ r " = = = l | | " \ n " = = = l ) & & ( n = b ) ; break ; case g : " * " = = = l & & o > = k + 1 & & " / " = = = a . charAt ( k + 1 ) & & ( n = b , + + k ) ; break ; case c : " \ \ " = = = l ? + + k : " ' " = = = l & & ( n = b ) ; break ; case d : " \ \ " = = = l ? + + k : ' " ' = = = l & & ( n = b ) ; break ; case e : " ` " = = = l & & ( n = b ) ; break ; case i : " ´ " = = = l & & ( n = b ) ; break ; case h : / ^ [ @ a - zA - Z0 - 9_ ] + $ / . test ( l ) | | ( p . push ( a . substring ( j , k ) ) , n = b , j = void 0 ) } var q ; return _ . each ( p , function ( a , b ) { q = a . match ( m . bindParamRegExp ) , q & & ( p [ b ] = q [ 1 ] ) } ) , { query : a , bindParams : p } } , checkForNewBindParams : function ( ) { var a = this , b = this . parseQuery ( this . aqlEditor . getValue ( ) ) . bindParams , c = { } ; _ . each ( b , function ( b ) { a . bindParamTableObj [ b ] ? c [ b ] = a . bindParamTableObj [ b ] : c [ b ] = " " } ) , Object . keys ( b ) . forEach ( function ( b ) { Object . keys ( a . bindParamTableObj ) . forEach ( function ( d ) { b = = = d & & ( c [ b ] = a . bindParamTableObj [ d ] ) } ) } ) , a . bindParamTableObj = c } , renderBindParamTable : function ( a ) { $ ( " # arangoBindParamTable tbody " ) . html ( " " ) , a & & this . getCachedQuery ( ) ; var b = 0 ; _ . each ( this . bindParamTableObj , function ( a , c ) { $ ( " # arangoBindParamTable tbody " ) . append ( " < tr > < td > " + c + " < / td > < td > < input name = " + c + ' type = " text " > < / input > < / td > < / tr > ' ) , b + + , _ . each ( $ ( " # arangoBindParamTable input " ) , function ( b ) { $ ( b ) . attr ( " name " ) = = = c & & ( a instanceof Array ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( " arraytype " ) : " object " = = typeof a ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( typeof a + " type " ) : $ ( b ) . val ( a ) . addClass ( typeof a + " type " ) ) } ) } ) , 0 = = = b & & $ ( " # arangoBindParamTable tbody " ) . append ( ' < tr class = " noBgColor " > < td > No bind parameters defined . < / td > < td > < / td > < / tr > ' ) } , fillBindParamTable : function ( a ) { _ . each ( a , function ( a , b ) { _ . each ( $ ( " # arangoBindParamTable input " ) , function ( c ) { $ ( c ) . attr ( " name " ) = = = b & & $ ( c ) . val ( a ) } ) } ) } , initAce : function ( ) { var a = this ; this . aqlEditor = ace . edit ( " aqlEditor " ) , this . aqlEditor . getSession ( ) . setMode ( " ace / mode / aql " ) , this . aqlEditor . setFontSize ( " 10pt " ) , this . aqlEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor = ace . edit ( " bindParamAceEditor " ) , this . bindParamAceEditor . getSession ( ) . setMode ( " ace / mode / json " ) , this . bindParamAceEditor . setFontSize ( " 10pt " ) , this . bindParamAceEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor . getSession ( ) . on ( " change " , function ( ) { try { a . bindParamTableObj = JSON . parse ( a . bindParamAceEditor . getValue ( ) ) , a . allowParamToggle = ! 0 , a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) } catch ( b ) { " " = = = a . bindParamAceEditor . getValue ( ) ? ( _ . each ( a . bindParamTableObj , function ( b , c ) { a . bindParamTableObj [ c ] = " " } ) , a . allowParamToggle = ! 0 ) : a . allowParamToggle = ! 1 } } ) , this . aqlEditor . getSession ( ) . on ( " change " , function ( ) { a . checkForNewBindParams ( ) , a . renderBindParamTable ( ) , a . initDone & & a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) , a . bindParamAceEditor . setValue ( JSON . stringify ( a . bindParamTableObj , null , " " ) , 1 ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) , a . resize ( ) } ) , this . aqlEditor . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , this . aqlEditor . commands . addCommand ( { name : " executeQuery " , bindKey : { win : " Ctrl - Return " , mac : " Command - Return " , linux : " Ctrl - Return " } , exec : function ( ) { a . executeQuery ( ) } } ) , this . aqlEditor . commands . addCommand ( { name : " saveQuery " , bindKey : { win : " Ctrl - Shift - S " , mac : " Command - Shift - S " , linux : " Ctrl - Shift - S " } , exec : function ( ) { a . addAQL ( ) } } ) , this . aqlEditor . commands . addCommand ( { name : " explainQuery " , bindKey : { win : " Ctrl - Shift - Return " , mac : " Command - Shift - Return " , linux : " Ctrl - Shift - Return " } , exec : function ( ) { a . explainQuery ( ) } } ) , this . aqlEditor . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , this . aqlEditor . commands . addCommand ( { name : " showSpotlight " , bindKey : { win : " Ctrl - Space " , mac : " Ctrl - Space " , linux : " Ctrl - Space " } , exec : function ( ) { a . showSpotlight ( ) } } ) , this . queryPreview = ace . edit ( " queryPreview " ) , this . queryPreview . getSession ( ) . setMode ( " ace / mode / aql " ) , this . queryPreview . setReadOnly ( ! 0 ) , this . queryPreview . setFontSize ( " 13px " ) , <nl> - $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } , updateQueryTable : function ( ) { function a ( a , b ) { var c ; return c = a . name < b . name ? - 1 : a . name > b . name ? 1 : 0 } var b = this ; this . updateLocalQueries ( ) , this . myQueriesTableDesc . rows = this . customQueries , _ . each ( this . myQueriesTableDesc . rows , function ( a ) { a . secondRow = ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < span id = " explQuery " title = " Explain query " > < i class = " fa fa - comments " > < / i > < / i > < / span > < span id = " runQuery " title = " Run query " > < i class = " fa fa - play - circle - o " > < / i > < / i > < / span > < span id = " deleteQuery " title = " Delete query " > < i class = " fa fa - minus - circle " > < / i > < / span > < / span > ' , a . hasOwnProperty ( " parameter " ) & & delete a . parameter , delete a . value } ) , this . myQueriesTableDesc . rows . sort ( a ) , _ . each ( this . queries , function ( a ) { a . hasOwnProperty ( " parameter " ) & & delete a . parameter , b . myQueriesTableDesc . rows . push ( { name : a . name , thirdRow : ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < / span > ' } ) } ) , this . myQueriesTableDesc . unescaped = [ ! 1 , ! 0 , ! 0 ] , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , listenKey : function ( a ) { 13 = = = a . keyCode & & this . saveAQL ( a ) , this . checkSaveName ( ) } , addAQL : function ( ) { this . refreshAQL ( ! 0 ) , this . createCustomQueryModal ( ) , setTimeout ( function ( ) { $ ( " # new - query - name " ) . focus ( ) } , 500 ) } , createCustomQueryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " new - query - name " , " Name " , " " , void 0 , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No query name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . saveAQL . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Save Query " , a , b , void 0 , void 0 , { " keyup # new - query - name " : this . listenKey . bind ( this ) } ) } , checkSaveName : function ( ) { var a = $ ( " # new - query - name " ) . val ( ) ; if ( " Insert Query " = = = a ) return void $ ( " # new - query - name " ) . val ( " " ) ; var b = this . customQueries . some ( function ( b ) { return b . name = = = a } ) ; b ? ( $ ( " # modalButton1 " ) . removeClass ( " button - success " ) , $ ( " # modalButton1 " ) . addClass ( " button - warning " ) , $ ( " # modalButton1 " ) . text ( " Update " ) ) : ( $ ( " # modalButton1 " ) . removeClass ( " button - warning " ) , $ ( " # modalButton1 " ) . addClass ( " button - success " ) , $ ( " # modalButton1 " ) . text ( " Save " ) ) } , saveAQL : function ( a ) { a . stopPropagation ( ) , this . refreshAQL ( ) ; var b = $ ( " # new - query - name " ) . val ( ) , c = this . bindParamTableObj ; if ( ! $ ( " # new - query - name " ) . hasClass ( " invalid - input " ) & & " " ! = = b . trim ( ) ) { var d = this . aqlEditor . getValue ( ) , e = ! 1 ; if ( _ . each ( this . customQueries , function ( a ) { return a . name = = = b ? ( a . value = d , void ( e = ! 0 ) ) : void 0 } ) , e = = = ! 0 ) this . collection . findWhere ( { name : b } ) . set ( " value " , d ) ; else { if ( ( " " = = = c | | void 0 = = = c ) & & ( c = " { } " ) , " string " = = typeof c ) try { c = JSON . parse ( c ) } catch ( f ) { arangoHelper . arangoError ( " Query " , " Could not parse bind parameter " ) } this . collection . add ( { name : b , parameter : c , value : d } ) } var g = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var b = this ; this . collection . fetch ( { success : function ( ) { b . updateLocalQueries ( ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( g ) , window . modalView . hide ( ) } } , verifyQueryAndParams : function ( ) { var a = ! 1 ; 0 = = = this . aqlEditor . getValue ( ) . length & & ( arangoHelper . arangoError ( " Query " , " Your query is empty " ) , a = ! 0 ) ; var b = [ ] ; return _ . each ( this . bindParamTableObj , function ( c , d ) { " " = = = c & & ( a = ! 0 , b . push ( d ) ) } ) , b . length > 0 & & arangoHelper . arangoError ( " Bind Parameter " , JSON . stringify ( b ) + " not defined . " ) , a } , executeQuery : function ( ) { if ( ! this . verifyQueryAndParams ( ) ) { this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : this . outputCounter , type : " Query " } ) ) , $ ( " # outputEditorWrapper " + this . outputCounter ) . hide ( ) , $ ( " # outputEditorWrapper " + this . outputCounter ) . show ( " fast " ) ; var a = this . outputCounter , b = ace . edit ( " outputEditor " + a ) , c = ace . edit ( " sentQueryEditor " + a ) , d = ace . edit ( " sentBindParamEditor " + a ) ; c . getSession ( ) . setMode ( " ace / mode / aql " ) , c . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , c . setFontSize ( " 13px " ) , c . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( c ) , b . setFontSize ( " 13px " ) , b . getSession ( ) . setMode ( " ace / mode / json " ) , b . setReadOnly ( ! 0 ) , b . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , b . setShowPrintMargin ( ! 1 ) , this . setEditorAutoHeight ( b ) , d . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( d ) , this . fillResult ( b , c , a ) , this . outputCounter + + } } , readQueryData : function ( ) { var a = this . aqlEditor . session . getTextRange ( this . aqlEditor . getSelectionRange ( ) ) , b = $ ( " # querySize " ) , c = { query : a | | this . aqlEditor . getValue ( ) , id : " currentFrontendQuery " } ; return " all " = = = b . val ( ) ? c . batchSize = 1e6 : c . batchSize = parseInt ( b . val ( ) , 10 ) , Object . keys ( this . bindParamTableObj ) . length > 0 & & ( c . bindVars = this . bindParamTableObj ) , JSON . stringify ( c ) } , fillResult : function ( a , b , c ) { var d = this , e = this . readQueryData ( ) ; e & & ( b . setValue ( d . aqlEditor . getValue ( ) , 1 ) , $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , headers : { " x - arango - async " : " store " } , data : e , contentType : " application / json " , processData : ! 1 , success : function ( b , e , f ) { f . getResponseHeader ( " x - arango - async - id " ) & & d . queryCallbackFunction ( f . getResponseHeader ( " x - arango - async - id " ) , a , c ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , d . handleResult ( c ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " [ " + b . errorNum + " ] " , b . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Query error " , " ERROR " ) } d . handleResult ( c ) } } ) ) } , handleResult : function ( ) { window . progressView . hide ( ) , $ ( " # removeResults " ) . show ( ) , $ ( " . centralRow " ) . animate ( { scrollTop : $ ( " # queryContent " ) . height ( ) } , " fast " ) } , setEditorAutoHeight : function ( a ) { var b = $ ( " . centralRow " ) . height ( ) , c = ( b - 250 ) / 17 ; a . setOptions ( { maxLines : c , minLines : 10 } ) } , deselect : function ( a ) { var b = a . getSelection ( ) , c = b . lead . row , d = b . lead . column ; b . setSelectionRange ( { start : { row : c , column : d } , end : { row : c , column : d } } ) , a . focus ( ) } , queryCallbackFunction : function ( a , b , c ) { var d = this , e = function ( a , b ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( d . checkQueryTimer ) , $ ( " # outputEditorWrapper " + b ) . remove ( ) , arangoHelper . arangoNotification ( " Query " , " Query canceled . " ) } } ) } ; $ ( " # outputEditorWrapper " + c + " # cancelCurrentQuery " ) . bind ( " click " , function ( ) { e ( a , c ) } ) , $ ( " # outputEditorWrapper " + c + " # copy2aqlEditor " ) . bind ( " click " , function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) | | d . toggleQueries ( ) ; var a = ace . edit ( " sentQueryEditor " + c ) . getValue ( ) , b = JSON . parse ( ace . edit ( " sentBindParamEditor " + c ) . getValue ( ) ) ; d . aqlEditor . setValue ( a , 1 ) , d . deselect ( d . aqlEditor ) , Object . keys ( b ) . length > 0 & & ( d . bindParamTableObj = b , d . setCachedQuery ( d . aqlEditor . getValue ( ) , JSON . stringify ( d . bindParamTableObj ) ) , $ ( " # bindParamEditor " ) . is ( " : visible " ) ? d . renderBindParamTable ( ) : ( d . bindParamAceEditor . setValue ( JSON . stringify ( b ) , 1 ) , d . deselect ( d . bindParamAceEditor ) ) ) , $ ( " . centralRow " ) . animate ( { scrollTop : 0 } , " fast " ) , d . resize ( ) } ) , this . execPending = ! 1 ; var f = function ( a ) { var c = " " ; a . extra & & a . extra . warnings & & a . extra . warnings . length > 0 & & ( c + = " Warnings : \ r \ n \ r \ n " , a . extra . warnings . forEach ( function ( a ) { c + = " [ " + a . code + " ] , ' " + a . message + " ' \ r \ n " } ) ) , " " ! = = c & & ( c + = " \ r \ nResult : \ r \ n \ r \ n " ) , b . setValue ( c + JSON . stringify ( a . result , void 0 , 2 ) , 1 ) , b . getSession ( ) . setScrollTop ( 0 ) } , g = function ( a ) { f ( a ) , window . progressView . hide ( ) ; var e = function ( a , b ) { $ ( " # outputEditorWrapper " + c + " . arangoToolbarTop . pull - left " ) . append ( ' < span > < i class = " fa ' + b + ' " > < / i > < i class = " iconText " > ' + a + " < / i > < / span > " ) } ; $ ( " # outputEditorWrapper " + c + " . pull - left # spinner " ) . remove ( ) ; var g = " - " ; a & & a . extra & & a . extra . stats & & ( g = a . extra . stats . executionTime . toFixed ( 3 ) + " s " ) , e ( a . result . length + " elements " , " fa - calculator " ) , e ( g , " fa - clock - o " ) , a . extra & & a . extra . stats & & ( console . log ( a . result . length ) , ( a . extra . stats . writesExecuted > 0 | | a . extra . stats . writesIgnored > 0 ) & & ( e ( a . extra . stats . writesExecuted + " writes " , " fa - check - circle positive " ) , 0 = = = a . extra . stats . writesIgnored ? e ( a . extra . stats . writesIgnored + " writes ignored " , " fa - check - circle positive " ) : e ( a . extra . stats . writesIgnored + " writes ignored " , " fa - exclamation - circle warning " ) ) , a . extra . stats . scannedFull > 0 ? e ( " full collection scan " , " fa - exclamation - circle warning " ) : e ( " no full collection scan " , " fa - check - circle positive " ) ) , $ ( " # outputEditorWrapper " + c + " . switchAce " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " . fa - close " ) . show ( ) , $ ( " # outputEditor " + c ) . css ( " opacity " , " 1 " ) , $ ( " # outputEditorWrapper " + c + " # downloadQueryResult " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " # copy2aqlEditor " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " # cancelCurrentQuery " ) . remove ( ) , d . setEditorAutoHeight ( b ) , d . deselect ( b ) , a . id & & $ . ajax ( { url : " / _api / cursor / " + encodeURIComponent ( a . id ) , type : " DELETE " , error : function ( a ) { console . log ( a ) } } ) } , h = function ( ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a , b , c ) { 201 = = = c . status ? g ( a ) : 204 = = = c . status & & ( d . checkQueryTimer = window . setTimeout ( function ( ) { h ( ) } , 500 ) ) } , error : function ( a ) { var b ; try { if ( " Gone " = = = a . statusText ) return arangoHelper . arangoNotification ( " Query " , " Query execution aborted . " ) , void d . removeOutputEditor ( c ) ; b = JSON . parse ( a . responseText ) , arangoHelper . arangoError ( " Query " , b . errorMessage ) , b . errorMessage & & ( null ! = = b . errorMessage . match ( / \ d + : \ d + / g ) ? d . markPositionError ( b . errorMessage . match ( / ' . * ' / g ) [ 0 ] , b . errorMessage . match ( / \ d + : \ d + / g ) [ 0 ] ) : d . markPositionError ( b . errorMessage . match ( / \ ( \ w + \ ) / g ) [ 0 ] ) , d . removeOutputEditor ( c ) ) } catch ( e ) { console . log ( b ) , 400 ! = = b . code & & arangoHelper . arangoError ( " Query " , " Successfully aborted . " ) , d . removeOutputEditor ( c ) } window . progressView . hide ( ) } } ) } ; h ( ) } , markPositionError : function ( a , b ) { var c ; b & & ( c = b . split ( " : " ) [ 0 ] , a = a . substr ( 1 , a . length - 2 ) ) ; var d = this . aqlEditor . find ( a ) ; ! d & & b & & ( this . aqlEditor . selection . moveCursorToPosition ( { row : c , column : 0 } ) , this . aqlEditor . selection . selectLine ( ) ) , window . setTimeout ( function ( ) { $ ( " . ace_start " ) . first ( ) . css ( " background " , " rgba ( 255 , 129 , 129 , 0 . 7 ) " ) } , 100 ) } , refreshAQL : function ( ) { var a = this , b = function ( b ) { b ? arangoHelper . arangoError ( " Query " , " Could not reload Queries " ) : ( a . updateLocalQueries ( ) , a . updateQueryTable ( ) ) } . bind ( a ) , c = function ( ) { a . getSystemQueries ( b ) } . bind ( a ) ; this . getAQL ( c ) } , getSystemQueries : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : " js / arango / aqltemplates . json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a & & a ( ! 1 ) , b . queries = c } , error : function ( ) { a & & a ( ! 0 ) , arangoHelper . arangoNotification ( " Query " , " Error while loading system templates " ) } } ) } , updateLocalQueries : function ( ) { var a = this ; this . customQueries = [ ] , this . collection . each ( function ( b ) { a . customQueries . push ( { name : b . get ( " name " ) , value : b . get ( " value " ) , parameter : b . get ( " parameter " ) } ) } ) } , getAQL : function ( a ) { var b = this ; this . collection . fetch ( { success : function ( ) { var c = localStorage . getItem ( " customQueries " ) ; if ( c ) { var d = JSON . parse ( c ) ; _ . each ( d , function ( a ) { b . collection . add ( { value : a . value , name : a . name } ) } ) ; var e = function ( a ) { a ? arangoHelper . arangoError ( " Custom Queries " , " Could not import old local storage queries " ) : localStorage . removeItem ( " customQueries " ) } . bind ( b ) ; b . collection . saveCollectionQueries ( e ) } b . updateLocalQueries ( ) , a & & a ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ScaleView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " scaleView . ejs " ) , interval : 5e3 , knownServers : [ ] , events : { " click # addCoord " : " addCoord " , " click # removeCoord " : " removeCoord " , " click # addDBs " : " addDBs " , " click # removeDBs " : " removeDBs " } , setCoordSize : function ( a ) { $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / cluster / setCoordSize " ) , contentType : " application / json " , data : JSON . stringify ( { value : a } ) , success : function ( ) { $ ( " # plannedCoords " ) . html ( a ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , setDBsSize : function ( a ) { $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / cluster / setDBsSize " ) , contentType : " application / json " , data : JSON . stringify ( { value : a } ) , success : function ( ) { $ ( " # plannedCoords " ) . html ( a ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , addCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 0 ) ) } , removeCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 1 , ! 0 ) ) } , addDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 0 ) ) } , removeDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 1 , ! 0 ) ) } , readNumberFromID : function ( a , b , c ) { var d = $ ( a ) . html ( ) , e = ! 1 ; try { e = JSON . parse ( d ) } catch ( f ) { } return b & & e + + , c & & 1 ! = = e & & e - - , e } , initialize : function ( a ) { window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , window . setInterval ( function ( ) { if ( " # sNodes " = = = window . location . hash ) ; } , this . interval ) ) } , render : function ( ) { var a = this , b = function ( ) { var b = function ( ) { a . continueRender ( ) } . bind ( this ) ; this . waitForDBServers ( b ) } . bind ( this ) ; this . initDoneCoords ? b ( ) : this . waitForCoordinators ( b ) , window . arangoHelper . buildNodesSubNav ( " scale " ) } , continueRender : function ( ) { var a , b , c = this ; a = this . coordinators . toJSON ( ) , b = this . dbServers . toJSON ( ) , this . $ el . html ( this . template . render ( { runningCoords : a . length , runningDBs : b . length , plannedCoords : void 0 , plannedDBs : void 0 } ) ) , $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c . updateTable ( a ) } } ) } , updateTable : function ( a ) { $ ( " # plannedCoords " ) . html ( a . numberOfCoordinators ) , $ ( " # plannedDBs " ) . html ( a . numberOfDBServers ) ; var b = ' < span class = " warning " > scaling in progress < / span > ' , c = ' < span class = " positive " > no scaling process active < / span > ' ; this . coordinators . toJSON ( ) . length = = = a . numberOfCoordinators ? $ ( " # statusCoords " ) . html ( c ) : $ ( " # statusCoords " ) . html ( b ) , this . dbServers . toJSON ( ) . length = = = a . numberOfDBServers ? $ ( " # statusDBs " ) . html ( c ) : $ ( " # statusDBs " ) . html ( b ) } , waitForDBServers : function ( a ) { var b = this ; 0 = = = this . dbServers . length ? window . setInterval ( function ( ) { b . waitForDBServers ( a ) } , 300 ) : a ( ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( this . initDoneCoords = ! 0 , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . SettingsView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , events : { } , render : function ( ) { this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Settings " ) , this . renderSettings ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , unloadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be unloaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " unloading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " unloaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " unloaded . " ) } . bind ( this ) ; this . model . unloadCollection ( a ) , window . modalView . hide ( ) } , loadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be loaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " loading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " loaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " loaded . " ) } . bind ( this ) ; this . model . loadCollection ( a ) , window . modalView . hide ( ) } , truncateCollection : function ( ) { this . model . truncateCollection ( ) , window . modalView . hide ( ) } , deleteCollection : function ( ) { this . model . destroy ( { error : function ( ) { arangoHelper . arangoError ( " Could not delete collection . " ) } , success : function ( ) { window . App . navigate ( " # collections " , { trigger : ! 0 } ) } } ) } , saveModifiedCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c ; c = b ? this . model . get ( " name " ) : $ ( " # change - collection - name " ) . val ( ) ; var d = this . model . get ( " status " ) ; if ( " loaded " = = = d ) { var e ; try { e = JSON . parse ( 1024 * $ ( " # change - collection - size " ) . val ( ) * 1024 ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } var g ; try { if ( g = JSON . parse ( $ ( " # change - index - buckets " ) . val ( ) ) , 1 > g | | parseInt ( g ) ! = = Math . pow ( 2 , Math . log2 ( g ) ) ) throw " invalid indexBuckets value " } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number of index buckets " ) , 0 } var h = function ( a ) { a ? arangoHelper . arangoError ( " Collection error : " + a . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) , i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Collection error : " + a . responseText ) ; else { var b = $ ( " # change - collection - sync " ) . val ( ) ; this . model . changeCollection ( b , e , g , h ) } } . bind ( this ) ; this . model . renameCollection ( c , i ) } else if ( " unloaded " = = = d ) if ( this . model . get ( " name " ) ! = = c ) { var j = function ( a , b ) { a ? arangoHelper . arangoError ( " Collection error : " + b . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) ; this . model . renameCollection ( c , j ) } else window . modalView . hide ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , renderSettings : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c = ! 1 ; " loaded " = = = this . model . get ( " status " ) & & ( c = ! 0 ) ; var d = [ ] , e = [ ] ; b | | e . push ( window . modalView . createTextEntry ( " change - collection - name " , " Name " , this . model . get ( " name " ) , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) ; var f = function ( ) { e . push ( window . modalView . createReadOnlyEntry ( " change - collection - id " , " ID " , this . model . get ( " id " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - type " , " Type " , this . model . get ( " type " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - status " , " Status " , this . model . get ( " status " ) , " " ) ) , d . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteCollection . bind ( this ) ) ) , d . push ( window . modalView . createDeleteButton ( " Truncate " , this . truncateCollection . bind ( this ) ) ) , c ? d . push ( window . modalView . createNotificationButton ( " Unload " , this . unloadCollection . bind ( this ) ) ) : d . push ( window . modalView . createNotificationButton ( " Load " , this . loadCollection . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . saveModifiedCollection . bind ( this ) ) ) ; var a = [ " General " , " Indices " ] , b = [ " modalTable . ejs " , " indicesView . ejs " ] ; window . modalView . show ( b , " Modify Collection " , d , e , null , null , this . events , null , a , " content " ) , $ ( $ ( " # infoTab " ) . children ( ) [ 1 ] ) . remove ( ) } . bind ( this ) ; if ( c ) { var g = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Collection " , " Could not fetch properties " ) ; else { var c = b . journalSize / 1048576 , d = b . indexBuckets , g = b . waitForSync ; e . push ( window . modalView . createTextEntry ( " change - collection - size " , " Journal size " , c , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , e . push ( window . modalView . createTextEntry ( " change - index - buckets " , " Index buckets " , d , " The number of index buckets for this collection . Must be at least 1 and a power of 2 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 1 - 9 ] [ 0 - 9 ] * $ / ) , msg : " Must be a number greater than 1 and a power of 2 . " } ] ) ) , e . push ( window . modalView . createSelectEntry ( " change - collection - sync " , " Wait for sync " , g , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) } f ( ) } . bind ( this ) ; this . model . getProperties ( g ) } else f ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . ShowClusterView = Backbone . View . extend ( { detailEl : " # modalPlaceholder " , el : " # content " , defaultFrame : 12e5 , template : templateEngine . createTemplate ( " showCluster . ejs " ) , modal : templateEngine . createTemplate ( " waitModal . ejs " ) , detailTemplate : templateEngine . createTemplate ( " detailView . ejs " ) , events : { " change # selectDB " : " updateCollections " , " change # selectCol " : " updateShards " , " click . dbserver . success " : " dashboard " , " click . coordinator . success " : " dashboard " } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " icon " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } , setShowAll : function ( ) { this . graphShowAll = ! 0 } , resetShowAll : function ( ) { this . graphShowAll = ! 1 , this . renderLineChart ( ) } , initialize : function ( a ) { this . options = a , this . interval = 1e4 , this . isUpdating = ! 1 , this . timer = null , this . knownServers = [ ] , this . graph = void 0 , this . graphShowAll = ! 1 , this . updateServerTime ( ) , this . dygraphConfig = this . options . dygraphConfig , this . dbservers = new window . ClusterServers ( [ ] , { interval : this . interval } ) , this . coordinators = new window . ClusterCoordinators ( [ ] , { interval : this . interval } ) , this . documentStore = new window . arangoDocuments , this . statisticsDescription = new window . StatisticsDescription , this . statisticsDescription . fetch ( { async : ! 1 } ) , this . dbs = new window . ClusterDatabases ( [ ] , { interval : this . interval } ) , this . cols = new window . ClusterCollections , this . shards = new window . ClusterShards , this . startUpdating ( ) } , listByAddress : function ( a ) { var b = { } , c = this ; this . dbservers . byAddress ( b , function ( b ) { c . coordinators . byAddress ( b , a ) } ) } , updateCollections : function ( ) { var a = this , b = $ ( " # selectCol " ) , c = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) ; if ( c ) { var d = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . cols . getList ( c , function ( c ) { _ . each ( _ . pluck ( c , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + d , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateShards ( ) } ) } } , updateShards : function ( ) { var a = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) , b = $ ( " # selectCol " ) . find ( " : selected " ) . attr ( " id " ) ; this . shards . getList ( a , b , function ( a ) { $ ( " . shardCounter " ) . html ( " 0 " ) , _ . each ( a , function ( a ) { $ ( " # " + a . server + " Shards " ) . html ( a . shards . length ) } ) } ) } , updateServerStatus : function ( a ) { var b = this , c = function ( a , b , c ) { var d , e , f = c ; f = f . replace ( / \ . / g , " - " ) , f = f . replace ( / \ : / g , " _ " ) , e = $ ( " # id " + f ) , e . length < 1 | | ( d = e . attr ( " class " ) . split ( / \ s + / ) [ 1 ] , e . attr ( " class " , a + " " + d + " " + b ) , " coordinator " = = = a & & ( " success " = = = b ? $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 1 ) : $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 0 ) ) ) } ; this . coordinators . getStatuses ( c . bind ( this , " coordinator " ) , function ( ) { b . dbservers . getStatuses ( c . bind ( b , " dbserver " ) ) , a ( ) } ) } , updateDBDetailList : function ( ) { var a = this , b = $ ( " # selectDB " ) , c = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . dbs . getList ( function ( d ) { _ . each ( _ . pluck ( d , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + c , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateCollections ( ) } ) } , rerender : function ( ) { var a = this ; this . updateServerStatus ( function ( ) { a . getServerStatistics ( function ( ) { a . updateServerTime ( ) , a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) } ) } ) } , render : function ( ) { this . knownServers = [ ] , delete this . hist ; var a = this ; this . listByAddress ( function ( b ) { 1 = = = Object . keys ( b ) . length ? a . type = " testPlan " : a . type = " other " , a . updateDBDetailList ( ) , a . dbs . getList ( function ( c ) { $ ( a . el ) . html ( a . template . render ( { dbs : _ . pluck ( c , " name " ) , byAddress : b , type : a . type } ) ) , $ ( a . el ) . append ( a . modal . render ( { } ) ) , a . replaceSVGs ( ) , a . getServerStatistics ( function ( ) { a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) , a . startUpdating ( ) } ) } ) } ) } , generatePieData : function ( ) { var a = [ ] , b = this ; return this . data . forEach ( function ( c ) { a . push ( { key : c . get ( " name " ) , value : c . get ( " system " ) . virtualSize , time : b . serverTime } ) } ) , a } , addStatisticsItem : function ( a , b , c , d ) { var e = this ; e . hasOwnProperty ( " hist " ) | | ( e . hist = { } ) , e . hist . hasOwnProperty ( a ) | | ( e . hist [ a ] = [ ] ) ; var f = e . hist [ a ] , g = f . length ; if ( 0 = = = g ) f . push ( { time : b , snap : d , requests : c , requestsPerSecond : 0 } ) ; else { var h = f [ g - 1 ] . time , i = f [ g - 1 ] . requests ; if ( c > i ) { var j = b - h , k = 0 ; j > 0 & & ( k = ( c - i ) / j ) , f . push ( { time : b , snap : d , requests : c , requestsPerSecond : k } ) } } } , getServerStatistics : function ( a ) { var b = this , c = Math . round ( b . serverTime / 1e3 ) ; this . data = void 0 ; var d = new window . ClusterStatisticsCollection , e = this . coordinators . first ( ) ; this . dbservers . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { - 1 = = = b . knownServers . indexOf ( a . id ) & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = e . get ( " protocol " ) + " : / / " + e . get ( " address " ) + " / _admin / clusterStatistics ? DBserver = " + a . get ( " name " ) , d . add ( c ) } } ) , this . coordinators . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { - 1 = = = b . knownServers . indexOf ( a . id ) & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = a . get ( " protocol " ) + " : / / " + a . get ( " address " ) + " / _admin / statistics " , d . add ( c ) } } ) ; var f = d . size ( ) ; this . data = [ ] ; var g = function ( d ) { f - - ; var e = d . get ( " time " ) , g = d . get ( " name " ) , h = d . get ( " http " ) . requestsTotal ; b . addStatisticsItem ( g , e , h , c ) , b . data . push ( d ) , 0 = = = f & & a ( ) } , h = function ( ) { f - - , 0 = = = f & & a ( ) } ; d . fetch ( g , h ) } , renderPieChart : function ( a ) { var b = $ ( " # clusterGraphs svg " ) . width ( ) , c = $ ( " # clusterGraphs svg " ) . height ( ) , d = Math . min ( b , c ) / 2 , e = this . dygraphConfig . colors , f = d3 . svg . arc ( ) . outerRadius ( d - 20 ) . innerRadius ( 0 ) , g = d3 . layout . pie ( ) . sort ( function ( a ) { return a . value } ) . value ( function ( a ) { return a . value } ) ; d3 . select ( " # clusterGraphs " ) . select ( " svg " ) . remove ( ) ; var h = d3 . select ( " # clusterGraphs " ) . append ( " svg " ) . attr ( " class " , " clusterChart " ) . append ( " g " ) . attr ( " transform " , " translate ( " + b / 2 + " , " + ( c / 2 - 10 ) + " ) " ) , i = d3 . svg . arc ( ) . outerRadius ( d - 2 ) . innerRadius ( d - 2 ) , j = h . selectAll ( " . arc " ) . data ( g ( a ) ) . enter ( ) . append ( " g " ) . attr ( " class " , " slice " ) ; j . append ( " path " ) . attr ( " d " , f ) . style ( " fill " , function ( a , b ) { return e [ b % e . length ] } ) . style ( " stroke " , function ( a , b ) { return e [ b % e . length ] } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + f . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { var b = a . data . value / 1024 / 1024 / 1024 ; return b . toFixed ( 2 ) } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + i . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { return a . data . key } ) } , renderLineChart : function ( ) { var a , b , c , d , e , f , g = this , h = 1200 , i = [ ] , j = [ ] , k = Math . round ( ( new Date ) . getTime ( ) / 1e3 ) - h , l = g . knownServers , m = function ( ) { return null } ; for ( c = 0 ; c < l . length ; + + c ) if ( b = g . hist [ l [ c ] ] ) for ( d = 0 ; d < b . length ; + + d ) f = b [ d ] . snap , k > f | | ( j . hasOwnProperty ( f ) ? a = j [ f ] : ( e = new Date ( 1e3 * f ) , a = j [ f ] = [ e ] . concat ( l . map ( m ) ) ) , a [ c + 1 ] = b [ d ] . requestsPerSecond ) ; i = [ ] , Object . keys ( j ) . sort ( ) . forEach ( function ( a ) { i . push ( j [ a ] ) } ) ; var n = this . dygraphConfig . getDefaultConfig ( " clusterRequestsPerSecond " ) ; n . labelsDiv = $ ( " # lineGraphLegend " ) [ 0 ] , n . labels = [ " datetime " ] . concat ( l ) , g . graph = new Dygraph ( document . getElementById ( " lineGraph " ) , i , n ) } , stopUpdating : function ( ) { window . clearTimeout ( this . timer ) , delete this . graph , this . isUpdating = ! 1 } , startUpdating : function ( ) { if ( ! this . isUpdating ) { this . isUpdating = ! 0 ; var a = this ; this . timer = window . setInterval ( function ( ) { a . rerender ( ) } , this . interval ) } } , dashboard : function ( a ) { this . stopUpdating ( ) ; var b , c , d = $ ( a . currentTarget ) , e = { } , f = d . attr ( " id " ) ; f = f . replace ( / \ - / g , " . " ) , f = f . replace ( / \ _ / g , " : " ) , f = f . substr ( 2 ) , e . raw = f , e . isDBServer = d . hasClass ( " dbserver " ) , e . isDBServer ? ( b = this . dbservers . findWhere ( { address : e . raw } ) , c = this . coordinators . findWhere ( { status : " ok " } ) , e . endpoint = c . get ( " protocol " ) + " : / / " + c . get ( " address " ) ) : ( b = this . coordinators . findWhere ( { address : e . raw } ) , e . endpoint = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) ) , e . target = encodeURIComponent ( b . get ( " name " ) ) , window . App . serverToShow = e , window . App . dashboard ( ) } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , resize : function ( ) { var a ; this . graph & & ( a = this . getCurrentSize ( this . graph . maindiv_ . id ) , this . graph . resize ( a . width , a . height ) ) } } ) } ( ) , function ( ) { " use strict " ; window . SpotlightView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " spotlightView . ejs " ) , el : " # spotlightPlaceholder " , displayLimit : 8 , typeahead : null , callbackSuccess : null , callbackCancel : null , collections : { system : [ ] , doc : [ ] , edge : [ ] } , events : { " focusout # spotlight . tt - input " : " hide " , " keyup # spotlight . typeahead " : " listenKey " } , aqlKeywordsArray : [ ] , aqlBuiltinFunctionsArray : [ ] , aqlKeywords : " for | return | filter | sort | limit | let | collect | asc | desc | in | into | insert | update | remove | replace | upsert | options | with | and | or | not | distinct | graph | outbound | inbound | any | all | none | aggregate | like | count " , aqlBuiltinFunctions : " to_bool | to_number | to_string | to_list | is_null | is_bool | is_number | is_string | is_list | is_document | typename | concat | concat_separator | char_length | lower | upper | substring | left | right | trim | reverse | contains | like | floor | ceil | round | abs | rand | sqrt | pow | length | min | max | average | sum | median | variance_population | variance_sample | first | last | unique | matches | merge | merge_recursive | has | attributes | values | unset | unset_recursive | keep | near | within | within_rectangle | is_in_polygon | fulltext | paths | traversal | traversal_tree | edges | stddev_sample | stddev_population | slice | nth | position | translate | zip | call | apply | push | append | pop | shift | unshift | remove_valueremove_nth | graph_paths | shortest_path | graph_shortest_path | graph_distance_to | graph_traversal | graph_traversal_tree | graph_edges | graph_vertices | neighbors | graph_neighbors | graph_common_neighbors | graph_common_properties | graph_eccentricity | graph_betweenness | graph_closeness | graph_absolute_eccentricity | remove_values | graph_absolute_betweenness | graph_absolute_closeness | graph_diameter | graph_radius | date_now | date_timestamp | date_iso8601 | date_dayofweek | date_year | date_month | date_day | date_hour | date_minute | date_second | date_millisecond | date_dayofyear | date_isoweek | date_leapyear | date_quarter | date_days_in_month | date_add | date_subtract | date_diff | date_compare | date_format | fail | passthru | sleep | not_null | first_list | first_document | parse_identifier | current_user | current_database | collections | document | union | union_distinct | intersection | flatten | ltrim | rtrim | find_first | find_last | split | substitute | md5 | sha1 | hash | random_token | AQL_LAST_ENTRY " , listenKey : function ( a ) { 27 = = = a . keyCode ? ( this . callbackSuccess & & this . callbackCancel ( ) , this . hide ( ) ) : 13 = = = a . keyCode & & this . callbackSuccess & & ( this . callbackSuccess ( $ ( this . typeahead ) . val ( ) ) , this . hide ( ) ) } , substringMatcher : function ( a ) { return function ( b , c ) { var d , e ; d = [ ] , e = new RegExp ( b , " i " ) , _ . each ( a , function ( a ) { e . test ( a ) & & d . push ( a ) } ) , c ( d ) } } , updateDatasets : function ( ) { var a = this ; this . collections = { system : [ ] , doc : [ ] , edge : [ ] } , window . App . arangoCollectionsStore . each ( function ( b ) { b . get ( " isSystem " ) ? a . collections . system . push ( b . get ( " name " ) ) : " document " = = = b . get ( " type " ) ? a . collections . doc . push ( b . get ( " name " ) ) : a . collections . edge . push ( b . get ( " name " ) ) } ) } , stringToArray : function ( ) { var a = this ; _ . each ( this . aqlKeywords . split ( " | " ) , function ( b ) { a . aqlKeywordsArray . push ( b . toUpperCase ( ) ) } ) , _ . each ( this . aqlBuiltinFunctions . split ( " | " ) , function ( b ) { a . aqlBuiltinFunctionsArray . push ( b . toUpperCase ( ) ) } ) , a . aqlKeywordsArray . push ( ! 0 ) , a . aqlKeywordsArray . push ( ! 1 ) , a . aqlKeywordsArray . push ( null ) } , show : function ( a , b , c ) { this . callbackSuccess = a , this . callbackCancel = b , this . stringToArray ( ) , this . updateDatasets ( ) ; var d = function ( a , b , c ) { var d = ' < div class = " header - type " > < h4 > ' + a + " < / h4 > " ; return b & & ( d + = ' < span > < i class = " fa ' + b + ' " > < / i > < / span > ' ) , c & & ( d + = ' < span class = " type " > ' + c . toUpperCase ( ) + " < / span > " ) , d + = " < / div > " } ; $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el ) . show ( ) , " aql " = = = c ? this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Functions " , source : this . substringMatcher ( this . aqlBuiltinFunctionsArray ) , limit : this . displayLimit , templates : { header : d ( " Functions " , " fa - code " , " aql " ) } } , { name : " Keywords " , source : this . substringMatcher ( this . aqlKeywordsArray ) , limit : this . displayLimit , templates : { header : d ( " Keywords " , " fa - code " , " aql " ) } } , { name : " Documents " , source : this . substringMatcher ( this . collections . doc ) , limit : this . displayLimit , templates : { header : d ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : this . substringMatcher ( this . collections . edge ) , limit : this . displayLimit , templates : { header : d ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : this . displayLimit , source : this . substringMatcher ( this . collections . system ) , templates : { header : d ( " System " , " fa - cogs " , " Collection " ) } } ) : this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Documents " , source : this . substringMatcher ( this . collections . doc ) , limit : this . displayLimit , templates : { header : d ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : this . substringMatcher ( this . collections . edge ) , limit : this . displayLimit , templates : { header : d ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : this . displayLimit , source : this . substringMatcher ( this . collections . system ) , templates : { header : d ( " System " , " fa - cogs " , " Collection " ) } } ) , $ ( " # spotlight . typeahead " ) . focus ( ) ; <nl> - } , hide : function ( ) { $ ( this . el ) . hide ( ) , this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( " destroy " ) } } ) } ( ) , function ( ) { " use strict " ; window . StatisticBarView = Backbone . View . extend ( { el : " # statisticBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " } , template : templateEngine . createTemplate ( " statisticBarView . ejs " ) , initialize : function ( a ) { this . currentDB = a . currentDB } , replaceSVG : function ( a ) { var b = a . attr ( " id " ) , c = a . attr ( " class " ) , d = a . attr ( " src " ) ; $ . get ( d , function ( d ) { var e = $ ( d ) . find ( " svg " ) ; void 0 = = = b & & ( e = e . attr ( " id " , b ) ) , void 0 = = = c & & ( e = e . attr ( " class " , c + " replaced - svg " ) ) , e = e . removeAttr ( " xmlns : a " ) , a . replaceWith ( e ) } , " xml " ) } , render : function ( ) { var a = this ; return $ ( this . el ) . html ( this . template . render ( { isSystem : this . currentDB . get ( " isSystem " ) } ) ) , $ ( " img . svg " ) . each ( function ( ) { a . replaceSVG ( $ ( this ) ) } ) , this } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; return " links " = = = c ? ( $ ( " # link_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : " tools " = = = c ? ( $ ( " # tools_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , handleSelectNavigation : function ( ) { $ ( " # arangoCollectionSelect " ) . change ( function ( ) { var a = $ ( this ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } ) } , selectMenuItem : function ( a ) { $ ( " . navlist li " ) . removeClass ( " active " ) , a & & $ ( " . " + a ) . addClass ( " active " ) } } ) } ( ) , function ( ) { " use strict " ; window . TableView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " tableView . ejs " ) , loading : templateEngine . createTemplate ( " loadingTableView . ejs " ) , initialize : function ( a ) { this . rowClickCallback = a . rowClick } , events : { " click . pure - table - body . pure - table - row " : " rowClick " , " click . deleteButton " : " removeClick " } , rowClick : function ( a ) { this . hasOwnProperty ( " rowClickCallback " ) & & this . rowClickCallback ( a ) } , removeClick : function ( a ) { this . hasOwnProperty ( " removeClickCallback " ) & & ( this . removeClickCallback ( a ) , a . stopPropagation ( ) ) } , setRowClick : function ( a ) { this . rowClickCallback = a } , setRemoveClick : function ( a ) { this . removeClickCallback = a } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { docs : this . collection } ) ) } , drawLoading : function ( ) { $ ( this . el ) . html ( this . loading . render ( { } ) ) } } ) } ( ) , function ( ) { " use strict " ; window . testView = Backbone . View . extend ( { el : " # content " , graph : { edges : [ ] , nodes : [ ] } , events : { } , initialize : function ( ) { console . log ( void 0 ) } , template : templateEngine . createTemplate ( " testView . ejs " ) , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , this . renderGraph ( ) , this } , renderGraph : function ( ) { this . convertData ( ) , console . log ( this . graph ) , this . s = new sigma ( { graph : this . graph , container : " graph - container " , verbose : ! 0 , renderers : [ { container : document . getElementById ( " graph - container " ) , type : " webgl " } ] } ) } , convertData : function ( ) { var a = this ; return _ . each ( this . dump , function ( b ) { _ . each ( b . p , function ( c ) { a . graph . nodes . push ( { id : c . verticesvalue . v . _id , label : b . v . _key , x : Math . random ( ) , y : Math . random ( ) , size : Math . random ( ) } ) , a . graph . edges . push ( { id : b . e . _id , source : b . e . _from , target : b . e . _to } ) } ) } ) , null } , dump : [ { v : { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } ] } } , { v : { label : " 8 " , _id : " circles / H " , _rev : " 1841664067459 " , _key : " H " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_blob " , _id : " edges / 1841666295683 " , _rev : " 1841666295683 " , _key : " 1841666295683 " , _from : " circles / G " , _to : " circles / H " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 8 " , _id : " circles / H " , _rev : " 1841664067459 " , _key : " H " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_blob " , _id : " edges / 1841666295683 " , _rev : " 1841666295683 " , _key : " 1841666295683 " , _from : " circles / G " , _to : " circles / H " } ] } } , { v : { label : " 9 " , _id : " circles / I " , _rev : " 1841664264067 " , _key : " I " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_blub " , _id : " edges / 1841666492291 " , _rev : " 1841666492291 " , _key : " 1841666492291 " , _from : " circles / H " , _to : " circles / I " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 8 " , _id : " circles / H " , _rev : " 1841664067459 " , _key : " H " } , { label : " 9 " , _id : " circles / I " , _rev : " 1841664264067 " , _key : " I " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_blob " , _id : " edges / 1841666295683 " , _rev : " 1841666295683 " , _key : " 1841666295683 " , _from : " circles / G " , _to : " circles / H " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_blub " , _id : " edges / 1841666492291 " , _rev : " 1841666492291 " , _key : " 1841666492291 " , _from : " circles / H " , _to : " circles / I " } ] } } , { v : { label : " 10 " , _id : " circles / J " , _rev : " 1841664460675 " , _key : " J " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_zip " , _id : " edges / 1841666688899 " , _rev : " 1841666688899 " , _key : " 1841666688899 " , _from : " circles / G " , _to : " circles / J " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 10 " , _id : " circles / J " , _rev : " 1841664460675 " , _key : " J " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_zip " , _id : " edges / 1841666688899 " , _rev : " 1841666688899 " , _key : " 1841666688899 " , _from : " circles / G " , _to : " circles / J " } ] } } , { v : { label : " 11 " , _id : " circles / K " , _rev : " 1841664657283 " , _key : " K " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_zup " , _id : " edges / 1841666885507 " , _rev : " 1841666885507 " , _key : " 1841666885507 " , _from : " circles / J " , _to : " circles / K " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 10 " , _id : " circles / J " , _rev : " 1841664460675 " , _key : " J " } , { label : " 11 " , _id : " circles / K " , _rev : " 1841664657283 " , _key : " K " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_zip " , _id : " edges / 1841666688899 " , _rev : " 1841666688899 " , _key : " 1841666688899 " , _from : " circles / G " , _to : " circles / J " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_zup " , _id : " edges / 1841666885507 " , _rev : " 1841666885507 " , _key : " 1841666885507 " , _from : " circles / J " , _to : " circles / K " } ] } } , { v : { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } ] } } , { v : { label : " 5 " , _id : " circles / E " , _rev : " 1841663477635 " , _key : " E " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_blub " , _id : " edges / 1841665705859 " , _rev : " 1841665705859 " , _key : " 1841665705859 " , _from : " circles / B " , _to : " circles / E " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 5 " , _id : " circles / E " , _rev : " 1841663477635 " , _key : " E " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blub " , _id : " edges / 1841665705859 " , _rev : " 1841665705859 " , _key : " 1841665705859 " , _from : " circles / B " , _to : " circles / E " } ] } } , { v : { label : " 6 " , _id : " circles / F " , _rev : " 1841663674243 " , _key : " F " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_schubi " , _id : " edges / 1841665902467 " , _rev : " 1841665902467 " , _key : " 1841665902467 " , _from : " circles / E " , _to : " circles / F " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 5 " , _id : " circles / E " , _rev : " 1841663477635 " , _key : " E " } , { label : " 6 " , _id : " circles / F " , _rev : " 1841663674243 " , _key : " F " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blub " , _id : " edges / 1841665705859 " , _rev : " 1841665705859 " , _key : " 1841665705859 " , _from : " circles / B " , _to : " circles / E " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_schubi " , _id : " edges / 1841665902467 " , _rev : " 1841665902467 " , _key : " 1841665902467 " , _from : " circles / E " , _to : " circles / F " } ] } } , { v : { label : " 3 " , _id : " circles / C " , _rev : " 1841663084419 " , _key : " C " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_blarg " , _id : " edges / 1841665312643 " , _rev : " 1841665312643 " , _key : " 1841665312643 " , _from : " circles / B " , _to : " circles / C " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 3 " , _id : " circles / C " , _rev : " 1841663084419 " , _key : " C " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blarg " , _id : " edges / 1841665312643 " , _rev : " 1841665312643 " , _key : " 1841665312643 " , _from : " circles / B " , _to : " circles / C " } ] } } , { v : { label : " 4 " , _id : " circles / D " , _rev : " 1841663281027 " , _key : " D " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_blorg " , _id : " edges / 1841665509251 " , _rev : " 1841665509251 " , _key : " 1841665509251 " , _from : " circles / C " , _to : " circles / D " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 3 " , _id : " circles / C " , _rev : " 1841663084419 " , _key : " C " } , { label : " 4 " , _id : " circles / D " , _rev : " 1841663281027 " , _key : " D " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blarg " , _id : " edges / 1841665312643 " , _rev : " 1841665312643 " , _key : " 1841665312643 " , _from : " circles / B " , _to : " circles / C " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blorg " , _id : " edges / 1841665509251 " , _rev : " 1841665509251 " , _key : " 1841665509251 " , _from : " circles / C " , _to : " circles / D " } ] } } ] } ) } ( ) , function ( ) { " use strict " ; window . UserBarView = Backbone . View . extend ( { events : { " change # userBarSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " mouseenter . dropdown " : " showDropdown " , " mouseleave . dropdown " : " hideDropdown " , " click # userLogoutIcon " : " userLogout " , " click # userLogout " : " userLogout " } , initialize : function ( a ) { this . userCollection = a . userCollection , this . userCollection . fetch ( { async : ! 0 } ) , this . userCollection . bind ( " change : extra " , this . render . bind ( this ) ) } , template : templateEngine . createTemplate ( " userBarView . ejs " ) , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement ; b = $ ( b ) . closest ( " a " ) ; var c = b . attr ( " id " ) ; return " user " = = = c ? ( $ ( " # user_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , toggleUserMenu : function ( ) { $ ( " # userBar . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeOut ( 1 ) } , render : function ( ) { if ( frontendConfig . authenticationEnabled ! = = ! 1 ) { var a = this , b = function ( a , b ) { if ( a ) arangoHelper . arangoErro ( " User " , " Could not fetch user . " ) ; else { var c = null , d = null , e = ! 1 , f = null ; if ( b ! = = ! 1 ) return f = this . userCollection . findWhere ( { user : b } ) , f . set ( { loggedIn : ! 0 } ) , d = f . get ( " extra " ) . name , c = f . get ( " extra " ) . img , e = f . get ( " active " ) , c = c ? " https : / / s . gravatar . com / avatar / " + c + " ? s = 80 " : " img / default_user . png " , d | | ( d = " " ) , this . $ el = $ ( " # userBar " ) , this . $ el . html ( this . template . render ( { img : c , name : d , username : b , active : e } ) ) , this . delegateEvents ( ) , this . $ el } } . bind ( this ) ; $ ( " # userBar " ) . on ( " click " , function ( ) { a . toggleUserMenu ( ) } ) , this . userCollection . whoAmI ( b ) } } , userLogout : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Logout error " ) : this . userCollection . logout ( ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . userManagementView = Backbone . View . extend ( { el : " # content " , el2 : " # userManagementThumbnailsIn " , template : templateEngine . createTemplate ( " userManagementView . ejs " ) , events : { " click # createUser " : " createUser " , " click # submitCreateUser " : " submitCreateUser " , " click # userManagementThumbnailsIn . tile " : " editUser " , " click # submitEditUser " : " submitEditUser " , " click # userManagementToggle " : " toggleView " , " keyup # userManagementSearchInput " : " search " , " click # userManagementSearchSubmit " : " search " , " click # callEditUserPassword " : " editUserPassword " , " click # submitEditUserPassword " : " submitEditUserPassword " , " click # submitEditCurrentUserProfile " : " submitEditCurrentUserProfile " , " click . css - label " : " checkBoxes " , " change # userSortDesc " : " sorting " } , dropdownVisible : ! 1 , initialize : function ( ) { var a = this , b = function ( a , b ) { frontendConfig . authenticationEnabled = = = ! 0 & & ( a | | null = = = b ? arangoHelper . arangoError ( " User " , " Could not fetch user data " ) : this . currentUser = this . collection . findWhere ( { user : b } ) ) } . bind ( this ) ; this . collection . fetch ( { success : function ( ) { a . collection . whoAmI ( b ) } } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , sorting : function ( ) { $ ( " # userSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # userManagementDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , render : function ( a ) { var b = ! 1 ; return $ ( " # userManagementDropdown " ) . is ( " : visible " ) & & ( b = ! 0 ) , this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " } ) ) , b = = = ! 0 & & ( $ ( " # userManagementDropdown2 " ) . show ( ) , $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown " ) . show ( ) ) , a & & this . editCurrentUser ( ) , arangoHelper . setCheckboxStatus ( " # userManagementDropdown " ) , this } , search : function ( ) { var a , b , c , d ; a = $ ( " # userManagementSearchInput " ) , b = $ ( " # userManagementSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return - 1 ! = = a . get ( " user " ) . indexOf ( b ) } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b } ) ) , a = $ ( " # userManagementSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , createUser : function ( a ) { a . preventDefault ( ) , this . createCreateUserModal ( ) } , submitCreateUser : function ( ) { var a = this , b = $ ( " # newUsername " ) . val ( ) , c = $ ( " # newName " ) . val ( ) , d = $ ( " # newPassword " ) . val ( ) , e = $ ( " # newStatus " ) . is ( " : checked " ) ; if ( this . validateUserInfo ( c , b , d , e ) ) { var f = { user : b , passwd : d , active : e , extra : { name : c } } ; this . collection . create ( f , { wait : ! 0 , error : function ( a , b ) { arangoHelper . parseError ( " User " , b , a ) } , success : function ( ) { a . updateUserManagement ( ) , window . modalView . hide ( ) } } ) } } , validateUserInfo : function ( a , b , c , d ) { return " " = = = b ? ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) : ! 0 } , updateUserManagement : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , submitDeleteUser : function ( a ) { var b = this . collection . findWhere ( { user : a } ) ; b . destroy ( { wait : ! 0 } ) , window . modalView . hide ( ) , this . updateUserManagement ( ) } , editUser : function ( a ) { if ( " createUser " ! = = $ ( a . currentTarget ) . find ( " a " ) . attr ( " id " ) ) { $ ( a . currentTarget ) . hasClass ( " tile " ) & & ( a . currentTarget = $ ( a . currentTarget ) . find ( " img " ) ) , this . collection . fetch ( ) ; var b = this . evaluateUserName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - user " ) ; " " = = = b & & ( b = $ ( a . currentTarget ) . attr ( " id " ) ) ; var c = this . collection . findWhere ( { user : b } ) ; c . get ( " loggedIn " ) ? this . editCurrentUser ( ) : this . createEditUserModal ( c . get ( " user " ) , c . get ( " extra " ) . name , c . get ( " active " ) ) } } , editCurrentUser : function ( ) { this . createEditCurrentUserModal ( this . currentUser . get ( " user " ) , this . currentUser . get ( " extra " ) . name , this . currentUser . get ( " extra " ) . img ) } , submitEditUser : function ( a ) { var b = $ ( " # editName " ) . val ( ) , c = $ ( " # editStatus " ) . is ( " : checked " ) ; if ( ! this . validateStatus ( c ) ) return void $ ( " # editStatus " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; if ( ! this . validateName ( b ) ) return void $ ( " # editName " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; var d = this . collection . findWhere ( { user : a } ) ; d . save ( { extra : { name : b } , active : c } , { type : " PATCH " } ) , window . modalView . hide ( ) , this . updateUserManagement ( ) } , validateUsername : function ( a ) { return " " = = = a ? ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) : a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ \ - ] * $ / ) ? ! 0 : ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) } , validatePassword : function ( a ) { return ! 0 } , validateName : function ( a ) { return " " = = = a ? ! 0 : a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ \ - \ ] * $ / ) ? ! 0 : ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) } , validateStatus : function ( a ) { return " " = = = a ? ! 1 : ! 0 } , toggleView : function ( ) { $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown2 " ) . slideToggle ( 200 ) } , setFilterValues : function ( ) { } , evaluateUserName : function ( a , b ) { if ( a ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } } , editUserPassword : function ( ) { window . modalView . hide ( ) , this . createEditUserPasswordModal ( ) } , submitEditUserPassword : function ( ) { var a = $ ( " # oldCurrentPassword " ) . val ( ) , b = $ ( " # newCurrentPassword " ) . val ( ) , c = $ ( " # confirmCurrentPassword " ) . val ( ) ; $ ( " # oldCurrentPassword " ) . val ( " " ) , $ ( " # newCurrentPassword " ) . val ( " " ) , $ ( " # confirmCurrentPassword " ) . val ( " " ) , $ ( " # oldCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) , $ ( " # newCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) , $ ( " # confirmCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) ; var d = ! 1 , e = function ( a , e ) { a ? arangoHelper . arangoError ( " User " , " Could not verify old password " ) : e & & ( b ! = = c & & ( arangoHelper . arangoError ( " User " , " New passwords do not match " ) , d = ! 0 ) , d | | ( this . currentUser . setPassword ( b ) , arangoHelper . arangoNotification ( " User " , " Password changed " ) , window . modalView . hide ( ) ) ) } . bind ( this ) ; this . currentUser . checkPassword ( a , e ) } , submitEditCurrentUserProfile : function ( ) { var a = $ ( " # editCurrentName " ) . val ( ) , b = $ ( " # editCurrentUserProfileImg " ) . val ( ) ; b = this . parseImgString ( b ) ; var c = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Could not edit user settings " ) : ( arangoHelper . arangoNotification ( " User " , " Changes confirmed . " ) , this . updateUserProfile ( ) ) } . bind ( this ) ; this . currentUser . setExtras ( a , b , c ) , window . modalView . hide ( ) } , updateUserProfile : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , parseImgString : function ( a ) { return - 1 = = = a . indexOf ( " @ " ) ? a : CryptoJS . MD5 ( a ) . toString ( ) } , createEditUserModal : function ( a , b , c ) { var d , e ; e = [ { type : window . modalView . tables . READONLY , label : " Username " , value : _ . escape ( a ) } , { type : window . modalView . tables . TEXT , label : " Name " , value : b , id : " editName " , placeholder : " Name " } , { type : window . modalView . tables . CHECKBOX , label : " Active " , value : " active " , checked : c , id : " editStatus " } ] , d = [ { title : " Delete " , type : window . modalView . buttons . DELETE , callback : this . submitDeleteUser . bind ( this , a ) } , { title : " Save " , type : window . modalView . buttons . SUCCESS , callback : this . submitEditUser . bind ( this , a ) } ] , window . modalView . show ( " modalTable . ejs " , " Edit User " , d , e ) } , createCreateUserModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newUsername " , " Username " , " " , ! 1 , " Username " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No username given . " } ] ) ) , b . push ( window . modalView . createTextEntry ( " newName " , " Name " , " " , ! 1 , " Name " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " newPassword " , " Password " , " " , ! 1 , " " , ! 1 ) ) , b . push ( window . modalView . createCheckboxEntry ( " newStatus " , " Active " , " active " , ! 1 , ! 0 ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateUser . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create New User " , a , b ) } , createEditCurrentUserModal : function ( a , b , c ) { var d = [ ] , e = [ ] ; e . push ( window . modalView . createReadOnlyEntry ( " id_username " , " Username " , a ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentName " , " Name " , b , ! 1 , " Name " , ! 1 ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentUserProfileImg " , " Gravatar account ( Mail ) " , c , " Mailaddress or its md5 representation of your gravatar account . The address will be converted into a md5 string . Only the md5 string will be stored , not the mailaddress . " , " myAccount ( at ) gravatar . com " ) ) , d . push ( window . modalView . createNotificationButton ( " Change Password " , this . editUserPassword . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditCurrentUserProfile . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Profile " , d , e ) } , createEditUserPasswordModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createPasswordEntry ( " oldCurrentPassword " , " Old Password " , " " , ! 1 , " old password " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " newCurrentPassword " , " New Password " , " " , ! 1 , " new password " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " confirmCurrentPassword " , " Confirm New Password " , " " , ! 1 , " confirm new password " , ! 1 ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditUserPassword . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Password " , a , b ) } } ) } ( ) , function ( ) { " use strict " ; window . workMonitorView = Backbone . View . extend ( { el : " # content " , id : " # workMonitorContent " , template : templateEngine . createTemplate ( " workMonitorView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , initialize : function ( ) { } , events : { } , tableDescription : { id : " workMonitorTable " , titles : [ " Type " , " Database " , " Task ID " , " Started " , " Url " , " User " , " Description " , " Method " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 ] } , render : function ( ) { var a = this ; this . $ el . html ( this . template . render ( { } ) ) , this . collection . fetch ( { success : function ( ) { a . parseTableData ( ) , $ ( a . id ) . append ( a . table . render ( { content : a . tableDescription } ) ) } } ) } , parseTableData : function ( ) { var a = this ; this . collection . each ( function ( b ) { if ( " AQL query " = = = b . get ( " type " ) ) { var c = b . get ( " parent " ) ; if ( c ) try { a . tableDescription . rows . push ( [ b . get ( " type " ) , " ( p ) " + c . database , " ( p ) " + c . taskId , " ( p ) " + c . startTime , " ( p ) " + c . url , " ( p ) " + c . user , b . get ( " description " ) , " ( p ) " + c . method ] ) } catch ( d ) { console . log ( " some parse error " ) } } else " thread " ! = = b . get ( " type " ) & & a . tableDescription . rows . push ( [ b . get ( " type " ) , b . get ( " database " ) , b . get ( " taskId " ) , b . get ( " startTime " ) , b . get ( " url " ) , b . get ( " user " ) , b . get ( " description " ) , b . get ( " method " ) ] ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . Router = Backbone . Router . extend ( { toUpdate : [ ] , dbServers : [ ] , isCluster : void 0 , routes : { " " : " cluster " , dashboard : " dashboard " , collections : " collections " , " new " : " newCollection " , login : " login " , " collection / : colid / documents / : pageid " : " documents " , " cIndices / : colname " : " cIndices " , " cSettings / : colname " : " cSettings " , " cInfo / : colname " : " cInfo " , " collection / : colid / : docid " : " document " , shell : " shell " , queries : " query " , workMonitor : " workMonitor " , databases : " databases " , settings : " databases " , services : " applications " , " service / : mount " : " applicationDetail " , graphs : " graphManagement " , " graphs / : name " : " showGraph " , users : " userManagement " , userProfile : " userProfile " , cluster : " cluster " , nodes : " cNodes " , cNodes : " cNodes " , dNodes : " dNodes " , sNodes : " sNodes " , " node / : name " : " node " , logs : " logs " , helpus : " helpUs " } , execute : function ( a , b ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) , $ ( " # subNavigationBar . bottom " ) . html ( " " ) , $ ( " # loadingScreen " ) . hide ( ) , $ ( " # content " ) . show ( ) , a & & a . apply ( this , b ) } , checkUser : function ( ) { if ( " # login " ! = = window . location . hash ) { var a = function ( ) { this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) } . bind ( this ) , b = function ( b , c ) { frontendConfig . authenticationEnabled & & ( b | | null = = = c ) ? " # login " ! = = window . location . hash & & this . navigate ( " login " , { trigger : ! 0 } ) : a ( ) } . bind ( this ) ; frontendConfig . authenticationEnabled ? this . userCollection . whoAmI ( b ) : ( this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) ) } } , waitForInit : function ( a , b , c ) { this . initFinished ? ( b | | a ( ! 0 ) , b & & ! c & & a ( b , ! 0 ) , b & & c & & a ( b , c , ! 0 ) ) : setTimeout ( function ( ) { b | | a ( ! 1 ) , b & & ! c & & a ( b , ! 1 ) , b & & c & & a ( b , c , ! 1 ) } , 350 ) } , initFinished : ! 1 , initialize : function ( ) { frontendConfig . isCluster = = = ! 0 & & ( this . isCluster = ! 0 ) , window . modalView = new window . ModalView , this . foxxList = new window . FoxxCollection , window . foxxInstallView = new window . FoxxInstallView ( { collection : this . foxxList } ) , window . progressView = new window . ProgressView ; var a = this ; this . userCollection = new window . ArangoUsers , this . initOnce = function ( ) { this . initOnce = function ( ) { } ; var b = function ( b , c ) { a = this , c = = = ! 0 & & a . coordinatorCollection . fetch ( { success : function ( ) { a . fetchDBS ( ) } } ) } . bind ( this ) ; window . isCoordinator ( b ) , frontendConfig . isCluster = = = ! 1 & & ( this . initFinished = ! 0 ) , this . arangoDatabase = new window . ArangoDatabase , this . currentDB = new window . CurrentDatabase , this . arangoCollectionsStore = new window . arangoCollections , this . arangoDocumentStore = new window . arangoDocument , this . coordinatorCollection = new window . ClusterCoordinators , arangoHelper . setDocumentStore ( this . arangoDocumentStore ) , this . arangoCollectionsStore . fetch ( ) , window . spotlightView = new window . SpotlightView ( { collection : this . arangoCollectionsStore } ) , this . footerView = new window . FooterView ( { collection : a . coordinatorCollection } ) , this . notificationList = new window . NotificationCollection , this . currentDB . fetch ( { success : function ( ) { a . naviView = new window . NavigationView ( { database : a . arangoDatabase , currentDB : a . currentDB , notificationCollection : a . notificationList , userCollection : a . userCollection , isCluster : a . isCluster } ) , a . naviView . render ( ) } } ) , this . queryCollection = new window . ArangoQueries , this . footerView . render ( ) , window . checkVersion ( ) } . bind ( this ) , $ ( window ) . resize ( function ( ) { a . handleResize ( ) } ) , $ ( window ) . scroll ( function ( ) { } ) } , handleScroll : function ( ) { $ ( window ) . scrollTop ( ) > 50 ? ( $ ( " . navbar > . secondary " ) . css ( " top " , $ ( window ) . scrollTop ( ) ) , $ ( " . navbar > . secondary " ) . css ( " position " , " absolute " ) , $ ( " . navbar > . secondary " ) . css ( " z - index " , " 10 " ) , $ ( " . navbar > . secondary " ) . css ( " width " , $ ( window ) . width ( ) ) ) : ( $ ( " . navbar > . secondary " ) . css ( " top " , " 0 " ) , $ ( " . navbar > . secondary " ) . css ( " position " , " relative " ) , $ ( " . navbar > . secondary " ) . css ( " width " , " " ) ) } , cluster : function ( a ) { return this . checkUser ( ) , a ? this . isCluster = = = ! 1 | | void 0 = = = this . isCluster ? void ( " _system " = = = this . currentDB . get ( " name " ) ? ( this . routes [ " " ] = " dashboard " , this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . routes [ " " ] = " collections " , this . navigate ( " # collections " , { trigger : ! 0 } ) ) ) : ( this . clusterView | | ( this . clusterView = new window . ClusterView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . clusterView . render ( ) ) : void this . waitForInit ( this . cluster . bind ( this ) ) } , node : function ( a , b ) { return this . checkUser ( ) , b & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodeView | | ( this . nodeView = new window . NodeView ( { coordname : a , coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . nodeView . render ( ) ) : void this . waitForInit ( this . node . bind ( this ) , a ) } , cNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " coordinator " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . cNodes . bind ( this ) ) } , dNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : 0 = = = this . dbServers . length ? void this . navigate ( " # cNodes " , { trigger : ! 0 } ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " dbserver " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . dNodes . bind ( this ) ) } , sNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . scaleView = new window . ScaleView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] } ) , void this . scaleView . render ( ) ) : void this . waitForInit ( this . sNodes . bind ( this ) ) } , addAuth : function ( a ) { var b = this . clusterPlan . get ( " user " ) ; if ( ! b ) return a . abort ( ) , void ( this . isCheckingUser | | this . requestAuth ( ) ) ; var c = b . name , d = b . passwd , e = c . concat ( " : " , d ) ; a . setRequestHeader ( " Authorization " , " Basic " + btoa ( e ) ) } , logs : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . logs . bind ( this ) , a ) ; if ( ! this . logsView ) { var c = new window . ArangoLogs ( { upto : ! 0 , loglevel : 4 } ) , d = new window . ArangoLogs ( { loglevel : 4 } ) , e = new window . ArangoLogs ( { loglevel : 3 } ) , f = new window . ArangoLogs ( { loglevel : 2 } ) , g = new window . ArangoLogs ( { loglevel : 1 } ) ; this . logsView = new window . LogsView ( { logall : c , logdebug : d , loginfo : e , logwarning : f , logerror : g } ) } this . logsView . render ( ) } , applicationDetail : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . applicationDetail . bind ( this ) , a ) ; var c = function ( ) { this . hasOwnProperty ( " applicationDetailView " ) | | ( this . applicationDetailView = new window . ApplicationDetailView ( { model : this . foxxList . get ( decodeURIComponent ( a ) ) } ) ) , this . applicationDetailView . model = this . foxxList . get ( decodeURIComponent ( a ) ) , this . applicationDetailView . render ( " swagger " ) } . bind ( this ) ; 0 = = = this . foxxList . length ? this . foxxList . fetch ( { success : function ( ) { c ( ) } } ) : c ( ) } , login : function ( ) { var a = function ( a , b ) { this . loginView | | ( this . loginView = new window . loginView ( { collection : this . userCollection } ) ) , a | | null = = = b ? this . loginView . render ( ) : this . loginView . render ( ! 0 ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } , collections : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . collections . bind ( this ) ) ; var b = this ; this . collectionsView | | ( this . collectionsView = new window . CollectionsView ( { collection : this . arangoCollectionsStore } ) ) , this . arangoCollectionsStore . fetch ( { success : function ( ) { b . collectionsView . render ( ) } } ) } , cIndices : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { success : function ( ) { c . indicesView = new window . IndicesView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . indicesView . render ( ) } } ) : void this . waitForInit ( this . cIndices . bind ( this ) , a ) } , cSettings : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { success : function ( ) { c . settingsView = new window . SettingsView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . settingsView . render ( ) } } ) : void this . waitForInit ( this . cSettings . bind ( this ) , a ) } , cInfo : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { success : function ( ) { c . infoView = new window . InfoView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . infoView . render ( ) } } ) : void this . waitForInit ( this . cInfo . bind ( this ) , a ) } , documents : function ( a , b , c ) { return this . checkUser ( ) , c ? ( this . documentsView | | ( this . documentsView = new window . DocumentsView ( { collection : new window . arangoDocuments , documentStore : this . arangoDocumentStore , collectionsStore : this . arangoCollectionsStore } ) ) , this . documentsView . setCollectionId ( a , b ) , void this . documentsView . render ( ) ) : void this . waitForInit ( this . documents . bind ( this ) , a , b ) } , document : function ( a , b , c ) { if ( this . checkUser ( ) , ! c ) return void this . waitForInit ( this . document . bind ( this ) , a , b ) ; this . documentView | | ( this . documentView = new window . DocumentView ( { collection : this . arangoDocumentStore } ) ) , this . documentView . colid = a ; var d = window . location . hash . split ( " / " ) [ 2 ] , e = ( d . split ( " % " ) . length - 1 ) % 3 ; decodeURI ( d ) ! = = d & & 0 ! = = e & & ( d = decodeURIComponent ( d ) ) , this . documentView . docid = d , this . documentView . render ( ) ; var f = function ( a , b ) { a ? console . log ( " Error " , " Could not fetch collection type " ) : this . documentView . setType ( b ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , f ) } , shell : function ( a ) { return this . checkUser ( ) , a ? ( this . shellView | | ( this . shellView = new window . shellView ) , void this . shellView . render ( ) ) : void this . waitForInit ( this . shell . bind ( this ) ) } , query : function ( a ) { return this . checkUser ( ) , a ? ( this . queryView2 | | ( this . queryView2 = new window . queryView2 ( { collection : this . queryCollection } ) ) , void this . queryView2 . render ( ) ) : void this . waitForInit ( this . query . bind ( this ) ) ; <nl> + el2 : " . header " , el3 : " . footer " , loggedIn : ! 1 , events : { " keyPress # loginForm input " : " keyPress " , " click # submitLogin " : " validate " , " submit # dbForm " : " goTo " , " click # logout " : " logout " , " change # loginDatabase " : " renderDBS " } , template : templateEngine . createTemplate ( " loginView . ejs " ) , render : function ( a ) { var b = this ; if ( $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el2 ) . hide ( ) , $ ( this . el3 ) . hide ( ) , frontendConfig . authenticationEnabled & & a ! = = ! 0 ) window . setTimeout ( function ( ) { $ ( " # loginUsername " ) . focus ( ) } , 300 ) ; else { var c = arangoHelper . databaseUrl ( " / _api / database / user " ) ; frontendConfig . authenticationEnabled = = = ! 1 & & ( $ ( " # logout " ) . hide ( ) , $ ( " . login - window # databases " ) . css ( " height " , " 90px " ) ) , $ ( " # loginForm " ) . hide ( ) , $ ( " . login - window # databases " ) . show ( ) , $ . ajax ( c ) . success ( function ( a ) { $ ( " # loginDatabase " ) . html ( " " ) , _ . each ( a . result , function ( a ) { $ ( " # loginDatabase " ) . append ( " < option > " + a + " < / option > " ) } ) , b . renderDBS ( ) } ) } return $ ( " . bodyWrapper " ) . show ( ) , this } , clear : function ( ) { $ ( " # loginForm input " ) . removeClass ( " form - error " ) , $ ( " . wrong - credentials " ) . hide ( ) } , keyPress : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? ( a . preventDefault ( ) , this . validate ( ) ) : a . metaKey & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . validate ( ) ) } , validate : function ( a ) { a . preventDefault ( ) , this . clear ( ) ; var b = $ ( " # loginUsername " ) . val ( ) , c = $ ( " # loginPassword " ) . val ( ) ; if ( b ) { var d = function ( a ) { var b = this ; if ( a ) $ ( " . wrong - credentials " ) . show ( ) , $ ( " # loginDatabase " ) . html ( " " ) , $ ( " # loginDatabase " ) . append ( " < option > _system < / option > " ) ; else { var c = arangoHelper . databaseUrl ( " / _api / database / user " , " _system " ) ; frontendConfig . authenticationEnabled = = = ! 1 & & ( c = arangoHelper . databaseUrl ( " / _api / database / user " ) ) , $ ( " . wrong - credentials " ) . hide ( ) , b . loggedIn = ! 0 , $ . ajax ( c ) . success ( function ( a ) { $ ( " # loginForm " ) . hide ( ) , $ ( " # databases " ) . show ( ) , $ ( " # loginDatabase " ) . html ( " " ) , _ . each ( a . result , function ( a ) { $ ( " # loginDatabase " ) . append ( " < option > " + a + " < / option > " ) } ) , b . renderDBS ( ) } ) } } . bind ( this ) ; this . collection . login ( b , c , d ) } } , renderDBS : function ( ) { var a = $ ( " # loginDatabase " ) . val ( ) ; $ ( " # goToDatabase " ) . html ( " Select : " + a ) , window . setInterval ( function ( ) { $ ( " # goToDatabase " ) . focus ( ) } , 300 ) } , logout : function ( ) { this . collection . logout ( ) } , goTo : function ( a ) { a . preventDefault ( ) ; var b = $ ( " # loginUsername " ) . val ( ) , c = $ ( " # loginDatabase " ) . val ( ) ; console . log ( window . App . dbSet ) , window . App . dbSet = c , console . log ( window . App . dbSet ) ; var d = function ( a ) { a & & arangoHelper . arangoError ( " User " , " Could not fetch user settings " ) } , e = window . location . protocol + " / / " + window . location . host + frontendConfig . basePath + " / _db / " + c + " / _admin / aardvark / index . html " ; window . location . href = e , $ ( this . el2 ) . show ( ) , $ ( this . el3 ) . show ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) , $ ( " # currentUser " ) . text ( b ) , this . collection . loadUserSettings ( d ) } } ) } ( ) , function ( ) { " use strict " ; window . LogsView = window . PaginationView . extend ( { el : " # content " , id : " # logContent " , paginationDiv : " # logPaginationDiv " , idPrefix : " logTable " , fetchedAmount : ! 1 , initialize : function ( a ) { this . options = a , this . convertModelToJSON ( ) } , currentLoglevel : " logall " , events : { " click # arangoLogTabbar button " : " setActiveLoglevel " , " click # logTable_first " : " firstPage " , " click # logTable_last " : " lastPage " } , template : templateEngine . createTemplate ( " logsView . ejs " ) , tabbar : templateEngine . createTemplate ( " arangoTabbar . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , tabbarElements : { id : " arangoLogTabbar " , titles : [ [ " All " , " logall " ] , [ " Info " , " loginfo " ] , [ " Error " , " logerror " ] , [ " Warning " , " logwarning " ] , [ " Debug " , " logdebug " ] ] } , tableDescription : { id : " arangoLogTable " , titles : [ " Loglevel " , " Date " , " Message " ] , rows : [ ] } , convertedRows : null , setActiveLoglevel : function ( a ) { $ ( " . arangodb - tabbar " ) . removeClass ( " arango - active - tab " ) , this . currentLoglevel ! = = a . currentTarget . id & & ( this . currentLoglevel = a . currentTarget . id , this . convertModelToJSON ( ) ) } , initTotalAmount : function ( ) { var a = this ; this . collection = this . options [ this . currentLoglevel ] , this . collection . fetch ( { data : $ . param ( { test : ! 0 } ) , success : function ( ) { a . convertModelToJSON ( ) } } ) , this . fetchedAmount = ! 0 } , invertArray : function ( a ) { var b , c = [ ] , d = 0 ; for ( b = a . length - 1 ; b > = 0 ; b - - ) c [ d ] = a [ b ] , d + + ; return c } , convertModelToJSON : function ( ) { if ( ! this . fetchedAmount ) return void this . initTotalAmount ( ) ; var a , b = this , c = [ ] ; this . collection = this . options [ this . currentLoglevel ] , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { a = new Date ( 1e3 * b . get ( " timestamp " ) ) , c . push ( [ b . getLogStatus ( ) , arangoHelper . formatDT ( a ) , b . get ( " text " ) ] ) } ) , b . tableDescription . rows = b . invertArray ( c ) , b . render ( ) } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . id ) . html ( this . tabbar . render ( { content : this . tabbarElements } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # " + this . currentLoglevel ) . addClass ( " arango - active - tab " ) , $ ( " # logContent " ) . append ( ' < div id = " logPaginationDiv " class = " pagination - line " > < / div > ' ) , this . renderPagination ( ) , this } , rerender : function ( ) { this . convertModelToJSON ( ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b , c , d ) { return { type : a , title : b , callback : c , confirm : d } } , b = function ( a , b , c , d , e , f , g , h , i , j , k ) { var l = { type : a , label : b } ; return void 0 ! = = c & & ( l . value = c ) , void 0 ! = = d & & ( l . info = d ) , void 0 ! = = e & & ( l . placeholder = e ) , void 0 ! = = f & & ( l . mandatory = f ) , void 0 ! = = h & & ( l . addDelete = h ) , void 0 ! = = i & & ( l . addAdd = i ) , void 0 ! = = j & & ( l . maxEntrySize = j ) , void 0 ! = = k & & ( l . tags = k ) , g & & ( l . validateInput = function ( ) { return g } ) , l } ; window . ModalView = Backbone . View . extend ( { _validators : [ ] , _validateWatchers : [ ] , baseTemplate : templateEngine . createTemplate ( " modalBase . ejs " ) , tableTemplate : templateEngine . createTemplate ( " modalTable . ejs " ) , el : " # modalPlaceholder " , contentEl : " # modalContent " , hideFooter : ! 1 , confirm : { list : " # modal - delete - confirmation " , yes : " # modal - confirm - delete " , no : " # modal - abort - delete " } , enabledHotkey : ! 1 , enableHotKeys : ! 0 , buttons : { SUCCESS : " success " , NOTIFICATION : " notification " , DELETE : " danger " , NEUTRAL : " neutral " , CLOSE : " close " } , tables : { READONLY : " readonly " , TEXT : " text " , BLOB : " blob " , PASSWORD : " password " , SELECT : " select " , SELECT2 : " select2 " , CHECKBOX : " checkbox " } , initialize : function ( ) { Object . freeze ( this . buttons ) , Object . freeze ( this . tables ) } , createModalHotkeys : function ( ) { $ ( this . el ) . unbind ( " keydown " ) , $ ( this . el ) . unbind ( " return " ) , $ ( this . el ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) , $ ( " . modal - body input " ) . unbind ( " keydown " ) , $ ( " . modal - body input " ) . unbind ( " return " ) , $ ( " . modal - body input " , $ ( this . el ) ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) , $ ( " . modal - body select " ) . unbind ( " keydown " ) , $ ( " . modal - body select " ) . unbind ( " return " ) , $ ( " . modal - body select " , $ ( this . el ) ) . bind ( " keydown " , " return " , function ( ) { $ ( " . createModalDialog . modal - footer . button - success " ) . click ( ) } ) } , createInitModalHotkeys : function ( ) { var a = this ; $ ( this . el ) . bind ( " keydown " , " left " , function ( ) { a . navigateThroughButtons ( " left " ) } ) , $ ( this . el ) . bind ( " keydown " , " right " , function ( ) { a . navigateThroughButtons ( " right " ) } ) } , navigateThroughButtons : function ( a ) { var b = $ ( " . createModalDialog . modal - footer button " ) . is ( " : focus " ) ; b = = = ! 1 ? " left " = = = a ? $ ( " . createModalDialog . modal - footer button " ) . first ( ) . focus ( ) : " right " = = = a & & $ ( " . createModalDialog . modal - footer button " ) . last ( ) . focus ( ) : b = = = ! 0 & & ( " left " = = = a ? $ ( " : focus " ) . prev ( ) . focus ( ) : " right " = = = a & & $ ( " : focus " ) . next ( ) . focus ( ) ) } , createCloseButton : function ( b , c ) { var d = this ; return a ( this . buttons . CLOSE , b , function ( ) { d . hide ( ) , c & & c ( ) } ) } , createSuccessButton : function ( b , c ) { return a ( this . buttons . SUCCESS , b , c ) } , createNotificationButton : function ( b , c ) { return a ( this . buttons . NOTIFICATION , b , c ) } , createDeleteButton : function ( b , c , d ) { return a ( this . buttons . DELETE , b , c , d ) } , createNeutralButton : function ( b , c ) { return a ( this . buttons . NEUTRAL , b , c ) } , createDisabledButton : function ( b ) { var c = a ( this . buttons . NEUTRAL , b ) ; return c . disabled = ! 0 , c } , createReadOnlyEntry : function ( a , c , d , e , f , g ) { var h = b ( this . tables . READONLY , c , d , e , void 0 , void 0 , void 0 , f , g ) ; return h . id = a , h } , createTextEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . TEXT , c , d , e , f , g , h ) ; return i . id = a , i } , createBlobEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . BLOB , c , d , e , f , g , h ) ; return i . id = a , i } , createSelect2Entry : function ( a , c , d , e , f , g , h , i , j , k ) { var l = b ( this . tables . SELECT2 , c , d , e , f , g , void 0 , h , i , j , k ) ; return l . id = a , l } , createPasswordEntry : function ( a , c , d , e , f , g , h ) { var i = b ( this . tables . PASSWORD , c , d , e , f , g , h ) ; return i . id = a , i } , createCheckboxEntry : function ( a , c , d , e , f ) { var g = b ( this . tables . CHECKBOX , c , d , e ) ; return g . id = a , f & & ( g . checked = f ) , g } , createSelectEntry : function ( a , c , d , e , f ) { var g = b ( this . tables . SELECT , c , null , e ) ; return g . id = a , d & & ( g . selected = d ) , g . options = f , g } , createOptionEntry : function ( a , b ) { return { label : a , value : b | | a } } , show : function ( a , b , c , d , e , f , g , h , i , j ) { var k , l , m = this , n = ! 1 ; c = c | | [ ] , h = Boolean ( h ) , this . clearValidators ( ) , c . length > 0 ? ( c . forEach ( function ( a ) { a . type = = = m . buttons . CLOSE & & ( n = ! 0 ) , a . type = = = m . buttons . DELETE & & ( l = l | | a . confirm ) } ) , n | | ( k = c . pop ( ) , c . push ( m . createCloseButton ( " Cancel " ) ) , c . push ( k ) ) ) : c . push ( m . createCloseButton ( " Close " ) ) , j ? ( $ ( " # " + j ) . html ( this . baseTemplate . render ( { title : b , buttons : c , hideFooter : this . hideFooter , confirm : l , tabBar : i } ) ) , $ ( " # " + j + " # modal - dialog " ) . removeClass ( " fade hide modal " ) , $ ( " # " + j + " . modal - header " ) . remove ( ) , $ ( " # " + j + " . modal - tabbar " ) . remove ( ) , $ ( " # " + j + " . modal - tabbar " ) . remove ( ) , $ ( " # " + j + " . button - close " ) . remove ( ) , 0 = = = $ ( " # " + j + " . modal - footer " ) . children ( ) . length & & $ ( " # " + j + " . modal - footer " ) . remove ( ) ) : $ ( this . el ) . html ( this . baseTemplate . render ( { title : b , buttons : c , hideFooter : this . hideFooter , confirm : l , tabBar : i } ) ) , _ . each ( c , function ( a , b ) { return ! a . disabled & & a . callback ? a . type ! = = m . buttons . DELETE | | h ? void $ ( " # modalButton " + b ) . bind ( " click " , a . callback ) : void $ ( " # modalButton " + b ) . bind ( " click " , function ( ) { $ ( m . confirm . yes ) . unbind ( " click " ) , $ ( m . confirm . yes ) . bind ( " click " , a . callback ) , $ ( m . confirm . list ) . css ( " display " , " block " ) } ) : void 0 } ) , $ ( this . confirm . no ) . bind ( " click " , function ( ) { $ ( m . confirm . list ) . css ( " display " , " none " ) } ) ; var o ; if ( " string " = = typeof a ) o = templateEngine . createTemplate ( a ) , j ? $ ( " # " + j + " . createModalDialog . modal - body " ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) : $ ( " # modalPlaceholder . createModalDialog . modal - body " ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) ; else { var p = 0 ; _ . each ( a , function ( a ) { o = templateEngine . createTemplate ( a ) , $ ( " . createModalDialog . modal - body . tab - content # " + i [ p ] ) . html ( o . render ( { content : d , advancedContent : e , info : f } ) ) , p + + } ) } $ ( " . createModalDialog . modalTooltips " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) ; var q = d | | [ ] ; e & & e . content & & ( q = q . concat ( e . content ) ) , _ . each ( q , function ( a ) { m . modalBindValidation ( a ) , a . type = = = m . tables . SELECT2 & & $ ( " # " + a . id ) . select2 ( { tags : a . tags | | [ ] , showSearchBox : ! 1 , minimumResultsForSearch : - 1 , width : " 336px " , maximumSelectionSize : a . maxEntrySize | | 8 } ) } ) , g & & ( this . events = g , this . delegateEvents ( ) ) , $ ( " # accordion2 " ) & & ( $ ( " # accordion2 . accordion - toggle " ) . bind ( " click " , function ( ) { $ ( " # collapseOne " ) . is ( " : visible " ) ? ( $ ( " # collapseOne " ) . hide ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . addClass ( " collapsed " ) } , 100 ) ) : ( $ ( " # collapseOne " ) . show ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . removeClass ( " collapsed " ) } , 100 ) ) } ) , $ ( " # collapseOne " ) . hide ( ) , setTimeout ( function ( ) { $ ( " . accordion - toggle " ) . addClass ( " collapsed " ) } , 100 ) ) , j | | $ ( " # modal - dialog " ) . modal ( " show " ) , this . enabledHotkey = = = ! 1 & & ( this . createInitModalHotkeys ( ) , this . enabledHotkey = ! 0 ) , this . enableHotKeys & & this . createModalHotkeys ( ) ; var r = $ ( " # modal - dialog " ) . find ( " input " ) ; r & & setTimeout ( function ( ) { var a = $ ( " # modal - dialog " ) ; a . length > 0 & & ( a = a . find ( " input " ) , a . length > 0 & & $ ( a [ 0 ] ) . focus ( ) ) } , 400 ) } , modalBindValidation : function ( a ) { var b = this ; if ( a . hasOwnProperty ( " id " ) & & a . hasOwnProperty ( " validateInput " ) ) { var c = function ( ) { var b = $ ( " # " + a . id ) , c = a . validateInput ( b ) , d = ! 1 ; return _ . each ( c , function ( a ) { var c = b . val ( ) ; if ( a . rule | | ( a = { rule : a } ) , " function " = = typeof a . rule ) try { a . rule ( c ) } catch ( e ) { d = a . msg | | e . message } else { var f = Joi . validate ( c , a . rule ) ; f . error & & ( d = a . msg | | f . error . message ) } return d ? ! 1 : void 0 } ) , d ? d : void 0 } , d = $ ( " # " + a . id ) ; d . on ( " keyup focusout " , function ( ) { var a = c ( ) , e = d . next ( ) [ 0 ] ; a ? ( d . addClass ( " invalid - input " ) , e ? $ ( e ) . text ( a ) : d . after ( ' < p class = " errorMessage " > ' + a + " < / p > " ) , $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 0 ) . addClass ( " disabled " ) ) : ( d . removeClass ( " invalid - input " ) , e & & $ ( e ) . remove ( ) , b . modalTestAll ( ) ) } ) , this . _validators . push ( c ) , this . _validateWatchers . push ( d ) } } , modalTestAll : function ( ) { var a = _ . map ( this . _validators , function ( a ) { return a ( ) } ) , b = _ . any ( a ) ; return b ? $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 0 ) . addClass ( " disabled " ) : $ ( " . createModalDialog . modal - footer . button - success " ) . prop ( " disabled " , ! 1 ) . removeClass ( " disabled " ) , ! b } , clearValidators : function ( ) { this . _validators = [ ] , _ . each ( this . _validateWatchers , function ( a ) { a . unbind ( " keyup focusout " ) } ) , this . _validateWatchers = [ ] } , hide : function ( ) { this . clearValidators ( ) , $ ( " # modal - dialog " ) . modal ( " hide " ) } } ) } ( ) , function ( ) { " use strict " ; window . NavigationView = Backbone . View . extend ( { el : " # navigationBar " , subEl : " # subNavigationBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " click li " : " switchTab " , " click . arangodbLogo " : " selectMenuItem " , " mouseenter . dropdown > * " : " showDropdown " , " click . shortcut - icons p " : " showShortcutModal " , " mouseleave . dropdown " : " hideDropdown " } , renderFirst : ! 0 , activeSubMenu : void 0 , changeDB : function ( ) { window . location . hash = " # login " } , initialize : function ( a ) { var b = this ; this . userCollection = a . userCollection , this . currentDB = a . currentDB , this . dbSelectionView = new window . DBSelectionView ( { collection : a . database , current : this . currentDB } ) , this . userBarView = new window . UserBarView ( { userCollection : this . userCollection } ) , this . notificationView = new window . NotificationView ( { collection : a . notificationCollection } ) , this . statisticBarView = new window . StatisticBarView ( { currentDB : this . currentDB } ) , this . isCluster = a . isCluster , this . handleKeyboardHotkeys ( ) , Backbone . history . on ( " all " , function ( ) { b . selectMenuItem ( ) } ) } , showShortcutModal : function ( ) { arangoHelper . hotkeysFunctions . showHotkeysModal ( ) } , handleSelectDatabase : function ( ) { this . dbSelectionView . render ( $ ( " # dbSelect " ) ) } , template : templateEngine . createTemplate ( " navigationView . ejs " ) , templateSub : templateEngine . createTemplate ( " subNavigationView . ejs " ) , render : function ( ) { var a = this ; $ ( this . el ) . html ( this . template . render ( { currentDB : this . currentDB , isCluster : this . isCluster } ) ) , " _system " ! = = this . currentDB . get ( " name " ) & & $ ( " # dashboard " ) . parent ( ) . remove ( ) , $ ( this . subEl ) . html ( this . templateSub . render ( { currentDB : this . currentDB . toJSON ( ) } ) ) , this . dbSelectionView . render ( $ ( " # dbSelect " ) ) ; var b = function ( a ) { a | | this . userBarView . render ( ) } . bind ( this ) ; return this . userCollection . whoAmI ( b ) , this . renderFirst & & ( this . renderFirst = ! 1 , this . selectMenuItem ( ) , $ ( " . arangodbLogo " ) . on ( " click " , function ( ) { a . selectMenuItem ( ) } ) , $ ( " # dbStatus " ) . on ( " click " , function ( ) { a . changeDB ( ) } ) ) , this } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , handleKeyboardHotkeys : function ( ) { arangoHelper . enableKeyboardHotkeys ( ! 0 ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id , d = ! 1 ; $ ( b ) . hasClass ( " fa " ) | | ( " " = = = c & & ( c = $ ( b ) . attr ( " class " ) ) , " links " = = = c ? ( d = ! 0 , $ ( " # link_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) : " tools " = = = c ? ( d = ! 0 , $ ( " # tools_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) : " dbselection " = = = c & & ( d = ! 0 , $ ( " # dbs_dropdown " ) . slideToggle ( 1 ) , a . preventDefault ( ) ) , d | | ( window . App . navigate ( c , { trigger : ! 0 } ) , a . preventDefault ( ) ) ) } , handleSelectNavigation : function ( ) { var a = this ; $ ( " # arangoCollectionSelect " ) . change ( function ( ) { a . navigateBySelect ( ) } ) } , subViewConfig : { documents : " collections " , collection : " collections " } , subMenuConfig : { cluster : [ { name : " Dashboard " , view : void 0 , active : ! 0 } , { name : " Logs " , view : void 0 , disabled : ! 0 } ] , collections : [ { name : " " , view : void 0 , active : ! 1 } ] , queries : [ { name : " Editor " , route : " query " , active : ! 0 } , { name : " Running Queries " , route : " queryManagement " , params : { active : ! 0 } , active : void 0 } , { name : " Slow Query History " , route : " queryManagement " , params : { active : ! 1 } , active : void 0 } ] } , renderSubMenu : function ( a ) { var b = this ; if ( void 0 = = = a & & ( a = window . isCluster ? " cluster " : " dashboard " ) , this . subMenuConfig [ a ] ) { $ ( this . subEl + " . bottom " ) . html ( " " ) ; var c = " " ; _ . each ( this . subMenuConfig [ a ] , function ( a ) { c = a . active ? " active " : " " , a . disabled & & ( c = " disabled " ) , $ ( b . subEl + " . bottom " ) . append ( ' < li class = " subMenuEntry ' + c + ' " > < a > ' + a . name + " < / a > < / li > " ) , a . disabled | | $ ( b . subEl + " . bottom " ) . children ( ) . last ( ) . bind ( " click " , function ( c ) { b . activeSubMenu = a , b . renderSubView ( a , c ) } ) } ) } } , renderSubView : function ( a , b ) { window . App [ a . route ] & & ( window . App [ a . route ] . resetState & & window . App [ a . route ] . resetState ( ) , window . App [ a . route ] ( ) ) , $ ( this . subEl + " . bottom " ) . children ( ) . removeClass ( " active " ) , $ ( b . currentTarget ) . addClass ( " active " ) } , switchTab : function ( a ) { var b = $ ( a . currentTarget ) . children ( ) . first ( ) . attr ( " id " ) ; b & & this . selectMenuItem ( b + " - menu " ) } , selectMenuItem : function ( a , b ) { void 0 = = = a & & ( a = window . location . hash . split ( " / " ) [ 0 ] , a = a . substr ( 1 , a . length - 1 ) ) , " " = = = a ? a = window . App . isCluster ? " cluster " : " dashboard " : " cNodes " ! = = a & & " dNodes " ! = = a | | ( a = " nodes " ) ; try { this . renderSubMenu ( a . split ( " - " ) [ 0 ] ) } catch ( c ) { this . renderSubMenu ( a ) } $ ( " . navlist li " ) . removeClass ( " active " ) , " string " = = typeof a & & ( b ? $ ( " . " + this . subViewConfig [ a ] + " - menu " ) . addClass ( " active " ) : a & & ( $ ( " . " + a ) . addClass ( " active " ) , $ ( " . " + a + " - menu " ) . addClass ( " active " ) ) ) , arangoHelper . hideArangoNotifications ( ) } , showSubDropdown : function ( a ) { console . log ( $ ( a . currentTarget ) ) , console . log ( $ ( a . currentTarget ) . find ( " . subBarDropdown " ) ) , $ ( a . currentTarget ) . find ( " . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; " links " = = = c | | " link_dropdown " = = = c | | " links " = = = a . currentTarget . id ? $ ( " # link_dropdown " ) . fadeIn ( 1 ) : " tools " = = = c | | " tools_dropdown " = = = c | | " tools " = = = a . currentTarget . id ? $ ( " # tools_dropdown " ) . fadeIn ( 1 ) : " dbselection " ! = = c & & " dbs_dropdown " ! = = c & & " dbselection " ! = = a . currentTarget . id | | $ ( " # dbs_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( a ) { var b = a . target | | a . srcElement ; b = $ ( b ) . parent ( ) , $ ( " # link_dropdown " ) . fadeOut ( 1 ) , $ ( " # tools_dropdown " ) . fadeOut ( 1 ) , $ ( " # dbs_dropdown " ) . fadeOut ( 1 ) } } ) } ( ) , function ( ) { " use strict " ; window . NodeView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodeView . ejs " ) , interval : 5e3 , dashboards : [ ] , events : { } , initialize : function ( a ) { window . App . isCluster & & ( this . coordinators = a . coordinators , this . dbServers = a . dbServers , this . coordname = a . coordname , this . updateServerTime ( ) , window . setInterval ( function ( ) { if ( 0 = = = window . location . hash . indexOf ( " # node / " ) ) ; } , this . interval ) ) } , breadcrumb : function ( a ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Node : " + a ) } , render : function ( ) { this . $ el . html ( this . template . render ( { coords : [ ] } ) ) ; var a = function ( ) { this . continueRender ( ) , this . breadcrumb ( this . coordname ) , $ ( window ) . trigger ( " resize " ) } . bind ( this ) , b = function ( ) { console . log ( " " ) } ; this . initCoordDone | | this . waitForCoordinators ( b ) , this . initDBDone ? ( this . coordname = window . location . hash . split ( " / " ) [ 1 ] , this . coordinator = this . coordinators . findWhere ( { name : this . coordname } ) , a ( ) ) : this . waitForDBServers ( a ) } , continueRender : function ( ) { var a = this ; this . dashboards [ this . coordinator . get ( " name " ) ] = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : window . App . arangoDatabase , serverToShow : { raw : this . coordinator . get ( " address " ) , isDBServer : ! 1 , endpoint : this . coordinator . get ( " protocol " ) + " : / / " + this . coordinator . get ( " address " ) , target : this . coordinator . get ( " name " ) } } ) , this . dashboards [ this . coordinator . get ( " name " ) ] . render ( ) , window . setTimeout ( function ( ) { a . dashboards [ a . coordinator . get ( " name " ) ] . resize ( ) } , 500 ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( b . coordinator = b . coordinators . findWhere ( { name : b . coordname } ) , b . initCoordDone = ! 0 , a ( ) ) } , 200 ) } , waitForDBServers : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . dbServers [ 0 ] . length ? b . waitForDBServers ( a ) : ( b . initDBDone = ! 0 , b . dbServer = b . dbServers [ 0 ] , b . dbServer . each ( function ( a ) { " DBServer1 " = = = a . get ( " name " ) & & ( b . dbServer = a ) } ) , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NodesView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " nodesView . ejs " ) , interval : 5e3 , knownServers : [ ] , events : { " click # nodesContent . pure - table - body . pure - table - row " : " navigateToNode " } , initialize : function ( a ) { window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , this . toRender = a . toRender , window . setInterval ( function ( ) { if ( " # cNodes " = = = window . location . hash | | " # dNodes " = = = window . location . hash ) ; } , this . interval ) ) } , navigateToNode : function ( a ) { if ( " # dNodes " ! = = window . location . hash ) { var b = $ ( a . currentTarget ) . attr ( " node " ) ; window . App . navigate ( " # node / " + encodeURIComponent ( b ) , { trigger : ! 0 } ) } } , render : function ( ) { var a = function ( ) { this . continueRender ( ) } . bind ( this ) ; this . initDoneCoords ? a ( ) : this . waitForCoordinators ( a ) } , continueRender : function ( ) { var a ; a = " coordinator " = = = this . toRender ? this . coordinators . toJSON ( ) : this . dbServers . toJSON ( ) , this . $ el . html ( this . template . render ( { coords : a , type : this . toRender } ) ) , window . arangoHelper . buildNodesSubNav ( this . toRender ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( this . initDoneCoords = ! 0 , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . NotificationView = Backbone . View . extend ( { events : { " click . navlogo # stat_hd " : " toggleNotification " , " click . notificationItem . fa " : " removeNotification " , " click # removeAllNotifications " : " removeAllNotifications " } , initialize : function ( ) { this . collection . bind ( " add " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " remove " , this . renderNotifications . bind ( this ) ) , this . collection . bind ( " reset " , this . renderNotifications . bind ( this ) ) , window . setTimeout ( function ( ) { frontendConfig . authenticationEnabled = = = ! 1 & & window . arangoHelper . arangoWarning ( " Warning " , " Authentication is disabled . Do not use this setup in production mode . " ) } , 2e3 ) } , notificationItem : templateEngine . createTemplate ( " notificationItem . ejs " ) , el : " # notificationBar " , template : templateEngine . createTemplate ( " notificationView . ejs " ) , toggleNotification : function ( ) { var a = this . collection . length ; 0 ! = = a & & $ ( " # notification_menu " ) . toggle ( ) } , removeAllNotifications : function ( ) { $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , this . collection . reset ( ) , $ ( " # notification_menu " ) . hide ( ) } , removeNotification : function ( a ) { var b = a . target . id ; this . collection . get ( b ) . destroy ( ) } , renderNotifications : function ( a , b , c ) { if ( c & & c . add ) { var d , e = this . collection . at ( this . collection . length - 1 ) , f = e . get ( " title " ) , g = 3e3 , h = [ " click " ] ; if ( e . get ( " content " ) & & ( f = f + " : " + e . get ( " content " ) ) , " error " = = = e . get ( " type " ) ? ( g = ! 1 , h = [ " button " ] , d = [ { addClass : " button - danger " , text : " Close " , onClick : function ( a ) { a . close ( ) } } ] ) : " warning " = = = e . get ( " type " ) & & ( g = 2e4 ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , noty ( { theme : " relax " , text : f , template : ' < div class = " noty_message arango_message " > < div > < i class = " fa fa - close " > < / i > < / div > < span class = " noty_text arango_text " > < / span > < div class = " noty_close arango_close " > < / div > < / div > ' , maxVisible : 1 , closeWith : [ " click " ] , type : e . get ( " type " ) , layout : " bottom " , timeout : g , buttons : d , animation : { open : { height : " show " } , close : { height : " hide " } , easing : " swing " , speed : 200 , closeWith : h } } ) , " success " = = = e . get ( " type " ) ) return void e . destroy ( ) } $ ( " # stat_hd_counter " ) . text ( this . collection . length ) , 0 = = = this . collection . length ? ( $ ( " # stat_hd " ) . removeClass ( " fullNotification " ) , $ ( " # notification_menu " ) . hide ( ) ) : $ ( " # stat_hd " ) . addClass ( " fullNotification " ) , $ ( " . innerDropdownInnerUL " ) . html ( this . notificationItem . render ( { notifications : this . collection } ) ) , $ ( " . notificationInfoIcon " ) . tooltip ( { position : { my : " left top " , at : " right + 55 top - 1 " } } ) } , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { notifications : this . collection } ) ) , this . renderNotifications ( ) , this . delegateEvents ( ) , this . el } } ) } ( ) , function ( ) { " use strict " ; window . ProgressView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " progressBase . ejs " ) , el : " # progressPlaceholder " , el2 : " # progressPlaceholderIcon " , toShow : ! 1 , lastDelay : 0 , action : function ( ) { } , events : { " click . progress - action button " : " performAction " } , performAction : function ( ) { " function " = = typeof this . action & & this . action ( ) , window . progressView . hide ( ) } , initialize : function ( ) { } , showWithDelay : function ( a , b , c , d ) { var e = this ; e . toShow = ! 0 , e . lastDelay = a , setTimeout ( function ( ) { e . toShow = = = ! 0 & & e . show ( b , c , d ) } , e . lastDelay ) } , show : function ( a , b , c ) { $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( " . progress - text " ) . text ( a ) , c ? $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > ' + c + " < / button > " ) : $ ( " . progress - action " ) . html ( ' < button class = " button - danger " > Cancel < / button > ' ) , b ? this . action = b : this . action = this . hide ( ) , $ ( this . el ) . show ( ) } , hide : function ( ) { var a = this ; a . toShow = ! 1 , $ ( this . el ) . hide ( ) , this . action = function ( ) { } } } ) } ( ) , function ( ) { " use strict " ; window . queryManagementView = Backbone . View . extend ( { el : " # content " , id : " # queryManagementContent " , templateActive : templateEngine . createTemplate ( " queryManagementViewActive . ejs " ) , templateSlow : templateEngine . createTemplate ( " queryManagementViewSlow . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , active : ! 0 , shouldRender : ! 0 , timer : 0 , refreshRate : 2e3 , initialize : function ( ) { var a = this ; this . activeCollection = new window . QueryManagementActive , this . slowCollection = new window . QueryManagementSlow , this . convertModelToJSON ( ! 0 ) , window . setInterval ( function ( ) { " # queries " = = = window . location . hash & & window . VISIBLE & & a . shouldRender & & " queryManagement " = = = arangoHelper . getCurrentSub ( ) . route & & ( a . active ? $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 0 ) : $ ( " # arangoQueryManagementTable " ) . is ( " : visible " ) & & a . convertModelToJSON ( ! 1 ) ) } , a . refreshRate ) } , events : { " click # deleteSlowQueryHistory " : " deleteSlowQueryHistoryModal " , " click # arangoQueryManagementTable . fa - minus - circle " : " deleteRunningQueryModal " } , tableDescription : { id : " arangoQueryManagementTable " , titles : [ " ID " , " Query String " , " Runtime " , " Started " , " " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 0 ] } , deleteRunningQueryModal : function ( a ) { this . killQueryId = $ ( a . currentTarget ) . attr ( " data - id " ) ; var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , " Running Query " , " Do you want to kill the running query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Kill " , this . killRunningQuery . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Kill Running Query " , b , c ) , $ ( " . modal - delete - confirmation strong " ) . html ( " Really kill ? " ) } , killRunningQuery : function ( ) { this . collection . killRunningQuery ( this . killQueryId , this . killRunningQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , killRunningQueryCallback : function ( ) { this . convertModelToJSON ( ! 0 ) , this . renderActive ( ) } , deleteSlowQueryHistoryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createReadOnlyEntry ( void 0 , " Slow Query Log " , " Do you want to delete the slow query log entries ? " , void 0 , void 0 , ! 1 , void 0 ) ) , a . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteSlowQueryHistory . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Slow Query Log " , a , b ) } , deleteSlowQueryHistory : function ( ) { this . collection . deleteSlowQueryHistory ( this . slowQueryCallback . bind ( this ) ) , window . modalView . hide ( ) } , slowQueryCallback : function ( ) { this . convertModelToJSON ( ! 1 ) , this . renderSlow ( ) } , render : function ( ) { var a = arangoHelper . getCurrentSub ( ) ; a . params . active ? ( this . active = ! 0 , this . convertModelToJSON ( ! 0 ) ) : ( this . active = ! 1 , this . convertModelToJSON ( ! 1 ) ) } , addEvents : function ( ) { var a = this ; $ ( " # queryManagementContent tbody " ) . on ( " mousedown " , function ( ) { clearTimeout ( a . timer ) , a . shouldRender = ! 1 } ) , $ ( " # queryManagementContent tbody " ) . on ( " mouseup " , function ( ) { a . timer = window . setTimeout ( function ( ) { a . shouldRender = ! 0 } , 3e3 ) } ) } , renderActive : function ( ) { this . $ el . html ( this . templateActive . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # activequeries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , renderSlow : function ( ) { this . $ el . html ( this . templateSlow . render ( { } ) ) , $ ( this . id ) . append ( this . table . render ( { content : this . tableDescription } ) ) , $ ( " # slowqueries " ) . addClass ( " arango - active - tab " ) , this . addEvents ( ) } , convertModelToJSON : function ( a ) { var b = this , c = [ ] ; a = = = ! 0 ? this . collection = this . activeCollection : this . collection = this . slowCollection , this . collection . fetch ( { success : function ( ) { b . collection . each ( function ( b ) { var d = " " ; a & & ( d = ' < i data - id = " ' + b . get ( " id " ) + ' " class = " fa fa - minus - circle " > < / i > ' ) , c . push ( [ b . get ( " id " ) , b . get ( " query " ) , b . get ( " runTime " ) . toFixed ( 2 ) + " s " , b . get ( " started " ) , d ] ) } ) ; var d = " No running queries . " ; a | | ( d = " No slow queries . " ) , 0 = = = c . length & & c . push ( [ d , " " , " " , " " , " " ] ) , b . tableDescription . rows = c , a ? b . renderActive ( ) : b . renderSlow ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . queryView = Backbone . View . extend ( { el : " # content " , id : " # customsDiv " , warningTemplate : templateEngine . createTemplate ( " warningList . ejs " ) , tabArray : [ ] , execPending : ! 1 , initialize : function ( ) { this . refreshAQL ( ) , this . tableDescription . rows = this . customQueries } , events : { " click # result - switch " : " switchTab " , " click # query - switch " : " switchTab " , " click # customs - switch " : " switchTab " , " click # submitQueryButton " : " submitQuery " , " click # explainQueryButton " : " explainQuery " , " click # commentText " : " commentText " , " click # uncommentText " : " uncommentText " , " click # undoText " : " undoText " , " click # redoText " : " redoText " , " click # smallOutput " : " smallOutput " , " click # bigOutput " : " bigOutput " , " click # clearOutput " : " clearOutput " , " click # clearInput " : " clearInput " , " click # clearQueryButton " : " clearInput " , " click # addAQL " : " addAQL " , " mouseover # querySelect " : function ( ) { this . refreshAQL ( ! 0 ) } , " change # querySelect " : " importSelected " , " keypress # aqlEditor " : " aqlShortcuts " , " click # arangoQueryTable . table - cell0 " : " editCustomQuery " , " click # arangoQueryTable . table - cell1 " : " editCustomQuery " , " click # arangoQueryTable . table - cell2 a " : " deleteAQL " , " click # confirmQueryImport " : " importCustomQueries " , " click # confirmQueryExport " : " exportCustomQueries " , " click # export - query " : " exportCustomQueries " , " click # import - query " : " openExportDialog " , " click # closeQueryModal " : " closeExportDialog " , " click # downloadQueryResult " : " downloadQueryResult " } , openExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , createCustomQueryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " new - query - name " , " Name " , " " , void 0 , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No query name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . saveAQL . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Save Query " , a , b , void 0 , void 0 , { " keyup # new - query - name " : this . listenKey . bind ( this ) } ) } , updateTable : function ( ) { this . tableDescription . rows = this . customQueries , _ . each ( this . tableDescription . rows , function ( a ) { a . thirdRow = ' < a class = " deleteButton " > < span class = " icon_arangodb_roundminus " title = " Delete query " > < / span > < / a > ' , a . hasOwnProperty ( " parameter " ) & & delete a . parameter } ) , this . tableDescription . unescaped = [ ! 1 , ! 1 , ! 0 ] , this . $ ( this . id ) . html ( this . table . render ( { content : this . tableDescription } ) ) } , editCustomQuery : function ( a ) { var b = $ ( a . target ) . parent ( ) . children ( ) . first ( ) . text ( ) , c = ace . edit ( " aqlEditor " ) , d = ace . edit ( " varsEditor " ) ; c . setValue ( this . getCustomQueryValueByName ( b ) ) , d . setValue ( JSON . stringify ( this . getCustomQueryParameterByName ( b ) ) ) , this . deselect ( d ) , this . deselect ( c ) , $ ( " # querySelect " ) . val ( b ) , this . switchTab ( " query - switch " ) } , initTabArray : function ( ) { var a = this ; $ ( " . arango - tab " ) . children ( ) . each ( function ( ) { a . tabArray . push ( $ ( this ) . children ( ) . first ( ) . attr ( " id " ) ) } ) } , listenKey : function ( a ) { 13 = = = a . keyCode & & this . saveAQL ( a ) , this . checkSaveName ( ) } , checkSaveName : function ( ) { var a = $ ( " # new - query - name " ) . val ( ) ; if ( " Insert Query " = = = a ) return void $ ( " # new - query - name " ) . val ( " " ) ; var b = this . customQueries . some ( function ( b ) { return b . name = = = a } ) ; b ? ( $ ( " # modalButton1 " ) . removeClass ( " button - success " ) , $ ( " # modalButton1 " ) . addClass ( " button - warning " ) , $ ( " # modalButton1 " ) . text ( " Update " ) ) : ( $ ( " # modalButton1 " ) . removeClass ( " button - warning " ) , $ ( " # modalButton1 " ) . addClass ( " button - success " ) , $ ( " # modalButton1 " ) . text ( " Save " ) ) } , clearOutput : function ( ) { var a = ace . edit ( " queryOutput " ) ; a . setValue ( " " ) } , clearInput : function ( ) { var a = ace . edit ( " aqlEditor " ) , b = ace . edit ( " varsEditor " ) ; this . setCachedQuery ( a . getValue ( ) , b . getValue ( ) ) , a . setValue ( " " ) , b . setValue ( " " ) } , smallOutput : function ( ) { var a = ace . edit ( " queryOutput " ) ; a . getSession ( ) . foldAll ( ) } , bigOutput : function ( ) { var a = ace . edit ( " queryOutput " ) ; a . getSession ( ) . unfold ( ) } , aqlShortcuts : function ( a ) { a . ctrlKey & & 13 = = = a . keyCode ? this . submitQuery ( ) : a . metaKey & & ! a . ctrlKey & & 13 = = = a . keyCode & & this . submitQuery ( ) } , queries : [ ] , customQueries : [ ] , tableDescription : { id : " arangoQueryTable " , titles : [ " Name " , " Content " , " " ] , rows : [ ] } , template : templateEngine . createTemplate ( " queryView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , render : function ( ) { var a = this ; this . $ el . html ( this . template . render ( { } ) ) , this . $ ( this . id ) . html ( this . table . render ( { <nl> + content : this . tableDescription } ) ) ; var b = 1e3 , c = $ ( " # querySize " ) ; c . empty ( ) , [ 100 , 250 , 500 , 1e3 , 2500 , 5e3 , 1e4 , " all " ] . forEach ( function ( a ) { c . append ( ' < option value = " ' + _ . escape ( a ) + ' " ' + ( b = = = a ? " selected " : " " ) + " > " + _ . escape ( a ) + " results < / option > " ) } ) ; var d = ace . edit ( " queryOutput " ) ; d . setReadOnly ( ! 0 ) , d . setHighlightActiveLine ( ! 1 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setFontSize ( " 13px " ) , d . setValue ( " " ) ; var e = ace . edit ( " aqlEditor " ) ; e . getSession ( ) . setMode ( " ace / mode / aql " ) , e . setFontSize ( " 13px " ) , e . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) ; var f = ace . edit ( " varsEditor " ) ; f . getSession ( ) . setMode ( " ace / mode / aql " ) , f . setFontSize ( " 13px " ) , f . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) ; var g = this . getCachedQuery ( ) ; null ! = = g & & void 0 ! = = g & & " " ! = = g & & ( e . setValue ( g . query ) , " " = = = g . parameter | | void 0 = = = g ? f . setValue ( " { } " ) : f . setValue ( g . parameter ) ) ; var h = function ( ) { var b = e . getSession ( ) , c = e . getCursorPosition ( ) , d = b . getTokenAt ( c . row , c . column ) ; d & & ( " comment " = = = d . type ? $ ( " # commentText i " ) . removeClass ( " fa - comment " ) . addClass ( " fa - comment - o " ) . attr ( " data - original - title " , " Uncomment " ) : $ ( " # commentText i " ) . removeClass ( " fa - comment - o " ) . addClass ( " fa - comment " ) . attr ( " data - original - title " , " Comment " ) ) ; var g = e . getValue ( ) , h = f . getValue ( ) ; 1 = = = g . length & & ( g = " " ) , 1 = = = h . length & & ( h = " " ) , a . setCachedQuery ( g , h ) } ; e . getSession ( ) . selection . on ( " changeCursor " , function ( ) { h ( ) } ) , f . getSession ( ) . selection . on ( " changeCursor " , function ( ) { h ( ) } ) , $ ( " # queryOutput " ) . resizable ( { handles : " s " , ghost : ! 0 , stop : function ( ) { setTimeout ( function ( ) { var a = ace . edit ( " queryOutput " ) ; a . resize ( ) } , 200 ) } } ) , arangoHelper . fixTooltips ( " . vars - editor - header i , . queryTooltips , . icon_arangodb " , " top " ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) ; var i = $ ( window ) . height ( ) - 295 ; return $ ( " # aqlEditor " ) . height ( i - 100 - 29 ) , $ ( " # varsEditor " ) . height ( 100 ) , $ ( " # queryOutput " ) . height ( i ) , e . resize ( ) , d . resize ( ) , this . initTabArray ( ) , this . renderSelectboxes ( ) , this . deselect ( f ) , this . deselect ( d ) , this . deselect ( e ) , $ ( " # queryDiv " ) . show ( ) , $ ( " # customsDiv " ) . show ( ) , this . initQueryImport ( ) , this . switchTab ( " query - switch " ) , this } , getCachedQuery : function ( ) { if ( " undefined " ! = = Storage ) { var a = localStorage . getItem ( " cachedQuery " ) ; if ( void 0 ! = = a ) { var b = JSON . parse ( a ) ; return b } } } , setCachedQuery : function ( a , b ) { if ( " undefined " ! = = Storage ) { var c = { query : a , parameter : b } ; localStorage . setItem ( " cachedQuery " , JSON . stringify ( c ) ) } } , initQueryImport : function ( ) { var a = this ; a . allowUpload = ! 1 , $ ( " # importQueries " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , a . allowUpload = ! 0 , $ ( " # confirmQueryImport " ) . removeClass ( " disabled " ) } ) } , importCustomQueries : function ( ) { var a = this ; if ( this . allowUpload = = = ! 0 ) { var b = function ( ) { this . collection . fetch ( { success : function ( ) { a . updateLocalQueries ( ) , a . renderSelectboxes ( ) , a . updateTable ( ) , a . allowUpload = ! 1 , $ ( " # customs - switch " ) . click ( ) , $ ( " # confirmQueryImport " ) . addClass ( " disabled " ) , $ ( " # queryImportDialog " ) . modal ( " hide " ) } , error : function ( a ) { arangoHelper . arangoError ( " Custom Queries " , a . responseText ) } } ) } . bind ( this ) ; a . collection . saveImportQueries ( a . file , b . bind ( this ) ) } } , downloadQueryResult : function ( ) { var a = ace . edit ( " aqlEditor " ) , b = a . getValue ( ) ; " " ! = = b | | void 0 ! = = b | | null ! = = b ? window . open ( " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : b } ) ) ) ) : arangoHelper . arangoError ( " Query error " , " could not query result . " ) } , exportCustomQueries : function ( ) { var a , b = { } , c = [ ] ; _ . each ( this . customQueries , function ( a ) { c . push ( { name : a . name , value : a . value , parameter : a . parameter } ) } ) , b = { extra : { queries : c } } , $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a = b . user , null ! = = a & & a ! = = ! 1 | | ( a = " root " ) , window . open ( " query / download / " + encodeURIComponent ( a ) ) } ) } , deselect : function ( a ) { var b = a . getSelection ( ) , c = b . lead . row , d = b . lead . column ; b . setSelectionRange ( { start : { row : c , column : d } , end : { row : c , column : d } } ) , a . focus ( ) } , addAQL : function ( ) { this . refreshAQL ( ! 0 ) , this . createCustomQueryModal ( ) , $ ( " # new - query - name " ) . val ( $ ( " # querySelect " ) . val ( ) ) , setTimeout ( function ( ) { $ ( " # new - query - name " ) . focus ( ) } , 500 ) , this . checkSaveName ( ) } , getAQL : function ( a ) { var b = this ; this . collection . fetch ( { success : function ( ) { var c = localStorage . getItem ( " customQueries " ) ; if ( c ) { var d = JSON . parse ( c ) ; _ . each ( d , function ( a ) { b . collection . add ( { value : a . value , name : a . name } ) } ) ; var e = function ( a , b ) { a ? arangoHelper . arangoError ( " Custom Queries " , " Could not import old local storage queries " ) : localStorage . removeItem ( " customQueries " ) } . bind ( b ) ; b . collection . saveCollectionQueries ( e ) } b . updateLocalQueries ( ) , a & & a ( ) } } ) } , deleteAQL : function ( a ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Query " , " Could not delete query . " ) : ( this . updateLocalQueries ( ) , this . renderSelectboxes ( ) , this . updateTable ( ) ) } . bind ( this ) , c = $ ( a . target ) . parent ( ) . parent ( ) . parent ( ) . children ( ) . first ( ) . text ( ) , d = this . collection . findWhere ( { name : c } ) ; this . collection . remove ( d ) , this . collection . saveCollectionQueries ( b ) } , updateLocalQueries : function ( ) { var a = this ; this . customQueries = [ ] , this . collection . each ( function ( b ) { a . customQueries . push ( { name : b . get ( " name " ) , value : b . get ( " value " ) , parameter : b . get ( " parameter " ) } ) } ) } , saveAQL : function ( a ) { a . stopPropagation ( ) , this . refreshAQL ( ) ; var b = ace . edit ( " aqlEditor " ) , c = ace . edit ( " varsEditor " ) , d = $ ( " # new - query - name " ) . val ( ) , e = c . getValue ( ) ; if ( ! $ ( " # new - query - name " ) . hasClass ( " invalid - input " ) & & " " ! = = d . trim ( ) ) { var f = b . getValue ( ) , g = ! 1 ; if ( $ . each ( this . customQueries , function ( a , b ) { return b . name = = = d ? ( b . value = f , void ( g = ! 0 ) ) : void 0 } ) , g = = = ! 0 ) this . collection . findWhere ( { name : d } ) . set ( " value " , f ) ; else { if ( " " ! = = e & & void 0 ! = = e | | ( e = " { } " ) , " string " = = typeof e ) try { e = JSON . parse ( e ) } catch ( h ) { console . log ( " could not parse bind parameter " ) } this . collection . add ( { name : d , parameter : e , value : f } ) } var i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var b = this ; this . collection . fetch ( { success : function ( ) { b . updateLocalQueries ( ) , b . renderSelectboxes ( ) , $ ( " # querySelect " ) . val ( d ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( i ) , window . modalView . hide ( ) } } , getSystemQueries : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : " js / arango / aqltemplates . json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a & & a ( ! 1 ) , b . queries = c } , error : function ( ) { a & & a ( ! 0 ) , arangoHelper . arangoNotification ( " Query " , " Error while loading system templates " ) } } ) } , getCustomQueryValueByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " value " ) } , getCustomQueryParameterByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " parameter " ) } , refreshAQL : function ( a ) { var b = this , c = function ( c ) { if ( c ) arangoHelper . arangoError ( " Query " , " Could not reload Queries " ) ; else if ( b . updateLocalQueries ( ) , a ) { var d = $ ( " # querySelect " ) . val ( ) ; b . renderSelectboxes ( ) , $ ( " # querySelect " ) . val ( d ) } } . bind ( b ) , d = function ( ) { b . getSystemQueries ( c ) } . bind ( b ) ; this . getAQL ( d ) } , importSelected : function ( a ) { var b = ace . edit ( " aqlEditor " ) , c = ace . edit ( " varsEditor " ) ; _ . each ( this . queries , function ( d ) { $ ( " # " + a . currentTarget . id ) . val ( ) = = = d . name & & ( b . setValue ( d . value ) , d . hasOwnProperty ( " parameter " ) ? ( " " ! = = d . parameter & & void 0 ! = = d . parameter | | ( d . parameter = " { } " ) , " object " = = typeof d . parameter ? c . setValue ( JSON . stringify ( d . parameter ) ) : c . setValue ( d . parameter ) ) : c . setValue ( " { } " ) ) } ) , _ . each ( this . customQueries , function ( d ) { $ ( " # " + a . currentTarget . id ) . val ( ) = = = d . name & & ( b . setValue ( d . value ) , d . hasOwnProperty ( " parameter " ) ? ( " " ! = = d . parameter & & void 0 ! = = d . parameter & & " { } " ! = = JSON . stringify ( d . parameter ) | | ( d . parameter = " { } " ) , c . setValue ( d . parameter ) ) : c . setValue ( " { } " ) ) } ) , this . deselect ( ace . edit ( " varsEditor " ) ) , this . deselect ( ace . edit ( " aqlEditor " ) ) } , renderSelectboxes : function ( ) { this . sortQueries ( ) ; var a = " " ; a = " # querySelect " , $ ( a ) . empty ( ) , $ ( a ) . append ( ' < option id = " emptyquery " > Insert Query < / option > ' ) , $ ( a ) . append ( ' < optgroup label = " Example queries " > ' ) , jQuery . each ( this . queries , function ( b , c ) { $ ( a ) . append ( ' < option id = " ' + _ . escape ( c . name ) + ' " > ' + _ . escape ( c . name ) + " < / option > " ) } ) , $ ( a ) . append ( " < / optgroup > " ) , this . customQueries . length > 0 & & ( $ ( a ) . append ( ' < optgroup label = " Custom queries " > ' ) , jQuery . each ( this . customQueries , function ( b , c ) { $ ( a ) . append ( ' < option id = " ' + _ . escape ( c . name ) + ' " > ' + _ . escape ( c . name ) + " < / option > " ) } ) , $ ( a ) . append ( " < / optgroup > " ) ) } , undoText : function ( ) { var a = ace . edit ( " aqlEditor " ) ; a . undo ( ) } , redoText : function ( ) { var a = ace . edit ( " aqlEditor " ) ; a . redo ( ) } , commentText : function ( ) { var a = ace . edit ( " aqlEditor " ) ; a . toggleCommentLines ( ) } , sortQueries : function ( ) { this . queries = _ . sortBy ( this . queries , " name " ) , this . customQueries = _ . sortBy ( this . customQueries , " name " ) } , readQueryData : function ( ) { var a = ace . edit ( " aqlEditor " ) , b = ace . edit ( " varsEditor " ) , c = a . session . getTextRange ( a . getSelectionRange ( ) ) , d = $ ( " # querySize " ) , e = { query : c | | a . getValue ( ) , id : " currentFrontendQuery " } ; " all " ! = = d . val ( ) & & ( e . batchSize = parseInt ( d . val ( ) , 10 ) ) ; var f = b . getValue ( ) ; if ( f . length > 0 ) try { var g = JSON . parse ( f ) ; 0 ! = = Object . keys ( g ) . length & & ( e . bindVars = g ) } catch ( h ) { return arangoHelper . arangoError ( " Query error " , " Could not parse bind parameters . " ) , ! 1 } return JSON . stringify ( e ) } , heatmapColors : [ " # 313695 " , " # 4575b4 " , " # 74add1 " , " # abd9e9 " , " # e0f3f8 " , " # ffffbf " , " # fee090 " , " # fdae61 " , " # f46d43 " , " # d73027 " , " # a50026 " ] , heatmap : function ( a ) { return this . heatmapColors [ Math . floor ( 10 * a ) ] } , followQueryPath : function ( a , b ) { var c = { } , d = 0 ; c [ b [ 0 ] . id ] = a ; var e , f , g , h ; for ( e = 1 ; e < b . length ; + + e ) for ( f = this . preparePlanNodeEntry ( b [ e ] , b [ e - 1 ] . estimatedCost ) , c [ b [ e ] . id ] = f , h = b [ e ] . dependencies , d = f . estimatedCost , g = 0 ; g < h . length ; + + g ) c [ h [ g ] ] . children . push ( f ) ; return console . log ( d ) , d } , preparePlanNodeEntry : function ( a , b ) { var c = { estimatedCost : a . estimatedCost , estimatedNrItems : a . estimatedNrItems , type : a . type , children : [ ] } ; switch ( a . type ) { case " SubqueryNode " : c . relativeCost = c . estimatedCost - this . followQueryPath ( c , a . subquery . nodes ) ; break ; default : c . relativeCost = c . estimatedCost - b | | c . estimatedCost } return c } , fillExplain : function ( a ) { var b = this , c = ace . edit ( " queryOutput " ) , d = this . readQueryData ( ) ; $ ( " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 , d & & ( window . progressView . show ( " Explain is operating . . . " ) , $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / query / explain / " ) , data : d , contentType : " application / json " , processData : ! 1 , success : function ( d ) { c . setValue ( d . msg ) , b . switchTab ( " result - switch " ) , window . progressView . hide ( ) , b . deselect ( c ) , $ ( " # downloadQueryResult " ) . hide ( ) , " function " = = typeof a & & a ( ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) } , error : function ( b ) { window . progressView . hide ( ) ; try { var c = JSON . parse ( b . responseText ) ; arangoHelper . arangoError ( " Explain error " , c . errorNum ) } catch ( d ) { arangoHelper . arangoError ( " Explain error " , " ERROR " ) } window . progressView . hide ( ) , " function " = = typeof a & & a ( ) } } ) ) } , resize : function ( ) { } , checkQueryTimer : void 0 , queryCallbackFunction : function ( a , b ) { var c = this , d = ace . edit ( " queryOutput " ) , e = function ( ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( c . checkQueryTimer ) , arangoHelper . arangoNotification ( " Query " , " Query canceled . " ) , window . progressView . hide ( ) } } ) } ; window . progressView . show ( " Query is operating . . . " , e , " Cancel Query " ) , $ ( " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 ; var f = function ( a ) { var b = " " ; a . extra & & a . extra . warnings & & a . extra . warnings . length > 0 & & ( b + = " Warnings : \ r \ n \ r \ n " , a . extra . warnings . forEach ( function ( a ) { b + = " [ " + a . code + " ] , ' " + a . message + " ' \ r \ n " } ) ) , " " ! = = b & & ( b + = " \ r \ nResult : \ r \ n \ r \ n " ) , d . setValue ( b + JSON . stringify ( a . result , void 0 , 2 ) ) } , g = function ( a ) { f ( a ) , c . switchTab ( " result - switch " ) , window . progressView . hide ( ) ; var e = " - " ; a & & a . extra & & a . extra . stats & & ( e = a . extra . stats . executionTime . toFixed ( 3 ) + " s " ) , $ ( " . queryExecutionTime " ) . text ( " Execution time : " + e ) , c . deselect ( d ) , $ ( " # downloadQueryResult " ) . show ( ) , " function " = = typeof b & & b ( ) } , h = function ( ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a , b , d ) { 201 = = = d . status ? g ( a ) : 204 = = = d . status & & ( c . checkQueryTimer = window . setTimeout ( function ( ) { h ( ) } , 500 ) ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; b . errorMessage & & arangoHelper . arangoError ( " Query " , b . errorMessage ) } catch ( c ) { arangoHelper . arangoError ( " Query " , " Something went wrong . " ) } window . progressView . hide ( ) } } ) } ; h ( ) } , fillResult : function ( a ) { var b = this , c = ace . edit ( " queryOutput " ) ; c . setValue ( " " ) ; var d = this . readQueryData ( ) ; d & & $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , headers : { " x - arango - async " : " store " } , data : d , contentType : " application / json " , processData : ! 1 , success : function ( c , d , e ) { e . getResponseHeader ( " x - arango - async - id " ) & & b . queryCallbackFunction ( e . getResponseHeader ( " x - arango - async - id " ) , a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) } , error : function ( d ) { b . switchTab ( " result - switch " ) , $ ( " # downloadQueryResult " ) . hide ( ) ; try { var e = JSON . parse ( d . responseText ) ; c . setValue ( " [ " + e . errorNum + " ] " + e . errorMessage ) } catch ( f ) { c . setValue ( " ERROR " ) , arangoHelper . arangoError ( " Query error " , " ERROR " ) } window . progressView . hide ( ) , " function " = = typeof a & & a ( ) } } ) } , submitQuery : function ( ) { var a = ace . edit ( " queryOutput " ) ; this . fillResult ( this . switchTab . bind ( this , " result - switch " ) ) , a . resize ( ) ; var b = ace . edit ( " aqlEditor " ) ; this . deselect ( b ) , $ ( " # downloadQueryResult " ) . show ( ) } , explainQuery : function ( ) { this . fillExplain ( ) } , switchTab : function ( a ) { var b ; b = " string " = = typeof a ? a : a . target . id ; var c = this , d = function ( a ) { var d = " # " + a . replace ( " - switch " , " " ) , e = " # tabContent " + d . charAt ( 1 ) . toUpperCase ( ) + d . substr ( 2 ) ; a = = = b ? ( $ ( " # " + a ) . parent ( ) . addClass ( " active " ) , $ ( d ) . addClass ( " active " ) , $ ( e ) . show ( ) , " query - switch " = = = b ? $ ( " # aqlEditor . ace_text - input " ) . focus ( ) : " result - switch " = = = b & & c . execPending & & c . fillResult ( ) ) : ( $ ( " # " + a ) . parent ( ) . removeClass ( " active " ) , $ ( d ) . removeClass ( " active " ) , $ ( e ) . hide ( ) ) } ; this . tabArray . forEach ( d ) , this . updateTable ( ) } } ) } ( ) , function ( ) { " use strict " ; window . queryView2 = Backbone . View . extend ( { el : " # content " , bindParamId : " # bindParamEditor " , myQueriesId : " # queryTable " , template : templateEngine . createTemplate ( " queryView2 . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , outputDiv : " # outputEditors " , outputTemplate : templateEngine . createTemplate ( " queryViewOutput . ejs " ) , outputCounter : 0 , allowUpload : ! 1 , customQueries : [ ] , queries : [ ] , state : { lastQuery : { query : void 0 , bindParam : void 0 } } , settings : { aqlWidth : void 0 } , currentQuery : { } , initDone : ! 1 , bindParamRegExp : / @ ( @ ? \ w + \ d * ) / , bindParamTableObj : { } , bindParamTableDesc : { id : " arangoBindParamTable " , titles : [ " Key " , " Value " ] , rows : [ ] } , myQueriesTableDesc : { id : " arangoMyQueriesTable " , titles : [ " Name " , " Actions " ] , rows : [ ] } , execPending : ! 1 , aqlEditor : null , queryPreview : null , initialize : function ( ) { this . refreshAQL ( ) } , allowParamToggle : ! 0 , events : { " click # executeQuery " : " executeQuery " , " click # explainQuery " : " explainQuery " , " click # clearQuery " : " clearQuery " , " click . outputEditorWrapper # downloadQueryResult " : " downloadQueryResult " , " click . outputEditorWrapper . switchAce " : " switchAce " , " click . outputEditorWrapper . fa - close " : " closeResult " , " click # toggleQueries1 " : " toggleQueries " , " click # toggleQueries2 " : " toggleQueries " , " click # saveCurrentQuery " : " addAQL " , " click # exportQuery " : " exportCustomQueries " , " click # importQuery " : " openImportDialog " , " click # removeResults " : " removeResults " , " click # querySpotlight " : " showSpotlight " , " click # deleteQuery " : " selectAndDeleteQueryFromTable " , " click # explQuery " : " selectAndExplainQueryFromTable " , " keydown # arangoBindParamTable input " : " updateBindParams " , " change # arangoBindParamTable input " : " updateBindParams " , " click # arangoMyQueriesTable tbody tr " : " showQueryPreview " , " dblclick # arangoMyQueriesTable tbody tr " : " selectQueryFromTable " , " click # arangoMyQueriesTable # copyQuery " : " selectQueryFromTable " , " click # closeQueryModal " : " closeExportDialog " , " click # confirmQueryImport " : " importCustomQueries " , " click # switchTypes " : " toggleBindParams " , " click # arangoMyQueriesTable # runQuery " : " selectAndRunQueryFromTable " } , clearQuery : function ( ) { this . aqlEditor . setValue ( " " , 1 ) } , toggleBindParams : function ( ) { this . allowParamToggle ? ( $ ( " # bindParamEditor " ) . toggle ( ) , $ ( " # bindParamAceEditor " ) . toggle ( ) , " JSON " = = = $ ( " # switchTypes " ) . text ( ) ? ( $ ( " # switchTypes " ) . text ( " Table " ) , this . updateQueryTable ( ) , this . bindParamAceEditor . setValue ( JSON . stringify ( this . bindParamTableObj , null , " " ) , 1 ) , this . deselect ( this . bindParamAceEditor ) ) : ( $ ( " # switchTypes " ) . text ( " JSON " ) , this . renderBindParamTable ( ) ) ) : arangoHelper . arangoError ( " Bind parameter " , " Could not parse bind parameter " ) , this . resize ( ) } , openExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeExportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , initQueryImport : function ( ) { var a = this ; a . allowUpload = ! 1 , $ ( " # importQueries " ) . change ( function ( b ) { a . files = b . target . files | | b . dataTransfer . files , a . file = a . files [ 0 ] , a . allowUpload = ! 0 , $ ( " # confirmQueryImport " ) . removeClass ( " disabled " ) } ) } , importCustomQueries : function ( ) { var a = this ; if ( this . allowUpload = = = ! 0 ) { var b = function ( ) { this . collection . fetch ( { success : function ( ) { a . updateLocalQueries ( ) , a . updateQueryTable ( ) , a . resize ( ) , a . allowUpload = ! 1 , $ ( " # confirmQueryImport " ) . addClass ( " disabled " ) , $ ( " # queryImportDialog " ) . modal ( " hide " ) } , error : function ( a ) { arangoHelper . arangoError ( " Custom Queries " , a . responseText ) } } ) } . bind ( this ) ; a . collection . saveImportQueries ( a . file , b . bind ( this ) ) } } , removeResults : function ( ) { $ ( " . outputEditorWrapper " ) . hide ( " fast " , function ( ) { $ ( " . outputEditorWrapper " ) . remove ( ) } ) , $ ( " # removeResults " ) . hide ( ) } , getCustomQueryParameterByName : function ( a ) { return this . collection . findWhere ( { name : a } ) . get ( " parameter " ) } , getCustomQueryValueByName : function ( a ) { var b ; return a & & ( b = this . collection . findWhere ( { name : a } ) ) , b ? b = b . get ( " value " ) : _ . each ( this . queries , function ( c ) { c . name = = = a & & ( b = c . value ) } ) , b } , openImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " show " ) } , closeImportDialog : function ( ) { $ ( " # queryImportDialog " ) . modal ( " hide " ) } , exportCustomQueries : function ( ) { var a ; $ . ajax ( " whoAmI ? _ = " + Date . now ( ) ) . success ( function ( b ) { a = b . user , null ! = = a & & a ! = = ! 1 | | ( a = " root " ) , window . open ( " query / download / " + encodeURIComponent ( a ) ) } ) } , toggleQueries : function ( a ) { a & & " toggleQueries1 " = = = a . currentTarget . id ? ( this . updateQueryTable ( ) , $ ( " # bindParamAceEditor " ) . hide ( ) , $ ( " # bindParamEditor " ) . show ( ) , $ ( " # switchTypes " ) . text ( " JSON " ) , $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) , this . queryPreview . setValue ( " No query selected . " , 1 ) , this . deselect ( this . queryPreview ) ) : void 0 = = = this . settings . aqlWidth ? $ ( " . aqlEditorWrapper " ) . first ( ) . width ( . 33 * $ ( window ) . width ( ) ) : $ ( " . aqlEditorWrapper " ) . first ( ) . width ( this . settings . aqlWidth ) , this . resize ( ) ; var b = [ " aqlEditor " , " queryTable " , " previewWrapper " , " querySpotlight " , " bindParamEditor " , " toggleQueries1 " , " toggleQueries2 " , " saveCurrentQuery " , " querySize " , " executeQuery " , " switchTypes " , " explainQuery " , " importQuery " , " exportQuery " ] ; _ . each ( b , function ( a ) { $ ( " # " + a ) . toggle ( ) } ) , this . resize ( ) } , showQueryPreview : function ( a ) { $ ( " # arangoMyQueriesTable tr " ) . removeClass ( " selected " ) , $ ( a . currentTarget ) . addClass ( " selected " ) ; var b = this . getQueryNameFromTable ( a ) ; this . queryPreview . setValue ( this . getCustomQueryValueByName ( b ) , 1 ) , this . deselect ( this . queryPreview ) } , getQueryNameFromTable : function ( a ) { var b ; return $ ( a . currentTarget ) . is ( " tr " ) ? b = $ ( a . currentTarget ) . children ( ) . first ( ) . text ( ) : $ ( a . currentTarget ) . is ( " span " ) & & ( b = $ ( a . currentTarget ) . parent ( ) . parent ( ) . prev ( ) . text ( ) ) , b } , deleteQueryModal : function ( a ) { var b = [ ] , c = [ ] ; c . push ( window . modalView . createReadOnlyEntry ( void 0 , a , " Do you want to delete the query ? " , void 0 , void 0 , ! 1 , void 0 ) ) , b . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteAQL . bind ( this , a ) ) ) , window . modalView . show ( " modalTable . ejs " , " Delete Query " , b , c ) } , selectAndDeleteQueryFromTable : function ( a ) { var b = this . getQueryNameFromTable ( a ) ; this . deleteQueryModal ( b ) } , selectAndExplainQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . explainQuery ( ) } , selectAndRunQueryFromTable : function ( a ) { this . selectQueryFromTable ( a , ! 1 ) , this . executeQuery ( ) } , selectQueryFromTable : function ( a , b ) { var c = this . getQueryNameFromTable ( a ) , d = this ; void 0 = = = b & & this . toggleQueries ( ) , this . state . lastQuery . query = this . aqlEditor . getValue ( ) , this . state . lastQuery . bindParam = this . bindParamTableObj , this . aqlEditor . setValue ( this . getCustomQueryValueByName ( c ) , 1 ) , this . fillBindParamTable ( this . getCustomQueryParameterByName ( c ) ) , this . updateBindParams ( ) , $ ( " # lastQuery " ) . remove ( ) , $ ( " # queryContent . arangoToolbarTop . pull - left " ) . append ( ' < span id = " lastQuery " class = " clickable " > Previous Query < / span > ' ) , $ ( " # lastQuery " ) . hide ( ) . fadeIn ( 500 ) . on ( " click " , function ( ) { d . aqlEditor . setValue ( d . state . lastQuery . query , 1 ) , d . fillBindParamTable ( d . state . lastQuery . bindParam ) , d . updateBindParams ( ) , $ ( " # lastQuery " ) . fadeOut ( 500 , function ( ) { $ ( this ) . remove ( ) } ) } ) } , deleteAQL : function ( a ) { var b = function ( a ) { a ? arangoHelper . arangoError ( " Query " , " Could not delete query . " ) : ( this . updateLocalQueries ( ) , this . updateQueryTable ( ) , this . resize ( ) , window . modalView . hide ( ) ) } . bind ( this ) , c = this . collection . findWhere ( { name : a } ) ; this . collection . remove ( c ) , this . collection . saveCollectionQueries ( b ) } , switchAce : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) ; " Result " = = = $ ( a . currentTarget ) . text ( ) ? $ ( a . currentTarget ) . text ( " AQL " ) : $ ( a . currentTarget ) . text ( " Result " ) , $ ( " # outputEditor " + b ) . toggle ( ) , $ ( " # sentWrapper " + b ) . toggle ( ) , this . deselect ( ace . edit ( " outputEditor " + b ) ) , this . deselect ( ace . edit ( " sentQueryEditor " + b ) ) , this . deselect ( ace . edit ( " sentBindParamEditor " + b ) ) } , downloadQueryResult : function ( a ) { var b = $ ( a . currentTarget ) . attr ( " counter " ) , c = ace . edit ( " sentQueryEditor " + b ) , d = c . getValue ( ) ; " " ! = = d | | void 0 ! = = d | | null ! = = d ? 0 = = = Object . keys ( this . bindParamTableObj ) . length ? window . open ( " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d } ) ) ) ) : window . open ( " query / result / download / " + encodeURIComponent ( btoa ( JSON . stringify ( { query : d , bindVars : this . bindParamTableObj } ) ) ) ) : arangoHelper . arangoError ( " Query error " , " could not query result . " ) } , explainQuery : function ( ) { if ( ! this . verifyQueryAndParams ( ) ) { this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : this . outputCounter , type : " Explain " } ) ) ; var a = this . outputCounter , b = ace . edit ( " outputEditor " + a ) , c = ace . edit ( " sentQueryEditor " + a ) , d = ace . edit ( " sentBindParamEditor " + a ) ; c . getSession ( ) . setMode ( " ace / mode / aql " ) , c . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , c . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( c ) , b . setReadOnly ( ! 0 ) , b . getSession ( ) . setMode ( " ace / mode / json " ) , b . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , this . setEditorAutoHeight ( b ) , d . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( d ) , this . fillExplain ( b , c , a ) , this . outputCounter + + } } , fillExplain : function ( a , b , c ) { b . setValue ( this . aqlEditor . getValue ( ) , 1 ) ; var d = this , e = this . readQueryData ( ) ; if ( $ ( " # outputEditorWrapper " + c + " . queryExecutionTime " ) . text ( " " ) , this . execPending = ! 1 , e ) { var f = function ( ) { $ ( " # outputEditorWrapper " + c + " # spinner " ) . remove ( ) , $ ( " # outputEditor " + c ) . css ( " opacity " , " 1 " ) , $ ( " # outputEditorWrapper " + c + " . fa - close " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " . switchAce " ) . show ( ) } ; $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / aardvark / query / explain / " ) , data : e , contentType : " application / json " , processData : ! 1 , success : function ( b ) { b . msg . includes ( " errorMessage " ) ? ( d . removeOutputEditor ( c ) , arangoHelper . arangoError ( " Explain " , b . msg ) ) : ( a . setValue ( b . msg , 1 ) , d . deselect ( a ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , d . handleResult ( c ) ) , f ( ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " Explain " , b . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Explain " , " ERROR " ) } d . handleResult ( c ) , d . removeOutputEditor ( c ) , f ( ) } } ) } } , removeOutputEditor : function ( a ) { $ ( " # outputEditorWrapper " + a ) . hide ( ) , $ ( " # outputEditorWrapper " + a ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & $ ( " # removeResults " ) . hide ( ) } , getCachedQueryAfterRender : function ( ) { var a = this . getCachedQuery ( ) , b = this ; if ( null ! = = a & & void 0 ! = = a & & " " ! = = a & & ( this . aqlEditor . setValue ( a . query , 1 ) , this . aqlEditor . getSession ( ) . setUndoManager ( new ace . UndoManager ) , " " ! = = a . parameter | | void 0 ! = = a ) ) try { b . bindParamTableObj = JSON . parse ( a . parameter ) ; var c ; _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { c = $ ( a ) . attr ( " name " ) , $ ( a ) . val ( b . bindParamTableObj [ c ] ) } ) , b . setCachedQuery ( b . aqlEditor . getValue ( ) , JSON . stringify ( b . bindParamTableObj ) ) } catch ( d ) { } } , getCachedQuery : function ( ) { if ( " undefined " ! = = Storage ) { var a = localStorage . getItem ( " cachedQuery " ) ; if ( void 0 ! = = a ) { var b = JSON . parse ( a ) ; this . currentQuery = b ; try { this . bindParamTableObj = JSON . parse ( b . parameter ) } catch ( c ) { } return b } } } , setCachedQuery : function ( a , b ) { if ( " undefined " ! = = Storage ) { var c = { query : a , parameter : b } ; this . currentQuery = c , localStorage . setItem ( " cachedQuery " , JSON . stringify ( c ) ) } } , closeResult : function ( a ) { var b = $ ( " # " + $ ( a . currentTarget ) . attr ( " element " ) ) . parent ( ) ; $ ( b ) . hide ( " fast " , function ( ) { $ ( b ) . remove ( ) , 0 = = = $ ( " . outputEditorWrapper " ) . length & & $ ( " # removeResults " ) . hide ( ) } ) } , fillSelectBoxes : function ( ) { var a = 1e3 , b = $ ( " # querySize " ) ; b . empty ( ) , [ 100 , 250 , 500 , 1e3 , 2500 , 5e3 , 1e4 , " all " ] . forEach ( function ( c ) { b . append ( ' < option value = " ' + _ . escape ( c ) + ' " ' + ( a = = = c ? " selected " : " " ) + " > " + _ . escape ( c ) + " results < / option > " ) } ) } , render : function ( ) { this . $ el . html ( this . template . render ( { } ) ) , this . afterRender ( ) , this . initDone | | ( this . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) ) , this . initDone = ! 0 , this . renderBindParamTable ( ! 0 ) } , afterRender : function ( ) { var a = this ; this . initAce ( ) , this . initTables ( ) , this . fillSelectBoxes ( ) , this . makeResizeable ( ) , this . initQueryImport ( ) , this . getCachedQueryAfterRender ( ) , $ ( " . inputEditorWrapper " ) . height ( $ ( window ) . height ( ) / 10 * 5 + 25 ) , window . setTimeout ( function ( ) { a . resize ( ) } , 10 ) , a . deselect ( a . aqlEditor ) } , showSpotlight : function ( a ) { var b , c ; if ( void 0 ! = = a & & " click " ! = = a . type | | ( a = " aql " ) , " aql " = = = a ) b = function ( a ) { this . aqlEditor . insert ( a ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } . bind ( this ) , c = function ( ) { $ ( " # aqlEditor . ace_text - input " ) . focus ( ) } ; else { var d = $ ( " : focus " ) ; b = function ( a ) { var b = $ ( d ) . val ( ) ; $ ( d ) . val ( b + a ) , $ ( d ) . focus ( ) } . bind ( this ) , c = function ( ) { $ ( d ) . focus ( ) } } window . spotlightView . show ( b , c , a ) } , resize : function ( ) { this . resizeFunction ( ) } , resizeFunction : function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) ? ( this . aqlEditor . resize ( ) , $ ( " # arangoBindParamTable thead " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable thead th " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) , $ ( " # arangoBindParamTable tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody " ) . css ( " height " , $ ( " # aqlEditor " ) . height ( ) - 35 ) , $ ( " # arangoBindParamTable tbody " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody tr " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) ) , $ ( " # arangoBindParamTable tbody td " ) . css ( " width " , $ ( " # bindParamEditor " ) . width ( ) / 2 ) ) : ( this . queryPreview . resize ( ) , $ ( " # arangoMyQueriesTable thead " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable thead th " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) , $ ( " # arangoMyQueriesTable tr " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " height " , $ ( " # queryTable " ) . height ( ) - 35 ) , $ ( " # arangoMyQueriesTable tbody " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) ) , $ ( " # arangoMyQueriesTable tbody td " ) . css ( " width " , $ ( " # queryTable " ) . width ( ) / 2 ) ) } , makeResizeable : function ( ) { var a = this ; $ ( " . aqlEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) , a . settings . aqlWidth = $ ( " . aqlEditorWrapper " ) . width ( ) } , handles : " e " } ) , $ ( " . inputEditorWrapper " ) . resizable ( { resize : function ( ) { a . resizeFunction ( ) } , handles : " s " } ) , this . resizeFunction ( ) } , initTables : function ( ) { this . $ ( this . bindParamId ) . html ( this . table . render ( { content : this . bindParamTableDesc } ) ) , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , checkType : function ( a ) { var b = " stringtype " ; try { a = JSON . parse ( a ) , b = a instanceof Array ? " arraytype " : typeof a + " type " } catch ( c ) { } return b } , updateBindParams : function ( a ) { var b , c = this ; if ( a ) { b = $ ( a . currentTarget ) . attr ( " name " ) , this . bindParamTableObj [ b ] = arangoHelper . parseInput ( a . currentTarget ) ; var d = [ " arraytype " , " objecttype " , " booleantype " , " numbertype " , " stringtype " ] ; _ . each ( d , function ( b ) { $ ( a . currentTarget ) . removeClass ( b ) } ) , $ ( a . currentTarget ) . addClass ( c . checkType ( $ ( a . currentTarget ) . val ( ) ) ) } else _ . each ( $ ( " # arangoBindParamTable input " ) , function ( a ) { b = $ ( a ) . attr ( " name " ) , c . bindParamTableObj [ b ] = arangoHelper . parseInput ( a ) } ) ; this . setCachedQuery ( this . aqlEditor . getValue ( ) , JSON . stringify ( this . bindParamTableObj ) ) , a & & ( ( a . ctrlKey | | a . metaKey ) & & 13 = = = a . keyCode & & ( a . preventDefault ( ) , this . executeQuery ( ) ) , ( a . ctrlKey | | a . metaKey ) & & 32 = = = a . keyCode & & ( a . preventDefault ( ) , this . showSpotlight ( " bind " ) ) ) } , parseQuery : function ( a ) { var b = 0 , c = 1 , d = 2 , e = 3 , f = 4 , g = 5 , h = 6 , i = 7 ; a + = " " ; var j , k , l , m = this , n = b , o = a . length , p = [ ] ; for ( k = 0 ; o > k ; + + k ) switch ( l = a . charAt ( k ) , n ) { case b : " @ " = = = l ? ( n = h , j = k ) : " ' " = = = l ? n = c : ' " ' = = = l ? n = d : " ` " = = = l ? n = e : " ´ " = = = l ? n = i : " / " = = = l & & o > k + 1 & & ( " / " = = = a . charAt ( k + 1 ) ? ( n = f , + + k ) : " * " = = = a . charAt ( k + 1 ) & & ( n = g , + + k ) ) ; break ; case f : " \ r " ! = = l & & " \ n " ! = = l | | ( n = b ) ; break ; case g : " * " = = = l & & o > = k + 1 & & " / " = = = a . charAt ( k + 1 ) & & ( n = b , + + k ) ; break ; case c : " \ \ " = = = l ? + + k : " ' " = = = l & & ( n = b ) ; break ; case d : " \ \ " = = = l ? + + k : ' " ' = = = l & & ( n = b ) ; break ; case e : " ` " = = = l & & ( n = b ) ; break ; case i : " ´ " = = = l & & ( n = b ) ; break ; case h : / ^ [ @ a - zA - Z0 - 9_ ] + $ / . test ( l ) | | ( p . push ( a . substring ( j , k ) ) , n = b , j = void 0 ) } var q ; return _ . each ( p , function ( a , b ) { q = a . match ( m . bindParamRegExp ) , q & & ( p [ b ] = q [ 1 ] ) } ) , { query : a , bindParams : p } } , checkForNewBindParams : function ( ) { var a = this , b = this . parseQuery ( this . aqlEditor . getValue ( ) ) . bindParams , c = { } ; _ . each ( b , function ( b ) { a . bindParamTableObj [ b ] ? c [ b ] = a . bindParamTableObj [ b ] : c [ b ] = " " } ) , Object . keys ( b ) . forEach ( function ( b ) { Object . keys ( a . bindParamTableObj ) . forEach ( function ( d ) { b = = = d & & ( c [ b ] = a . bindParamTableObj [ d ] ) } ) } ) , a . bindParamTableObj = c } , renderBindParamTable : function ( a ) { $ ( " # arangoBindParamTable tbody " ) . html ( " " ) , a & & this . getCachedQuery ( ) ; var b = 0 ; _ . each ( this . bindParamTableObj , function ( a , c ) { $ ( " # arangoBindParamTable tbody " ) . append ( " < tr > < td > " + c + " < / td > < td > < input name = " + c + ' type = " text " > < / input > < / td > < / tr > ' ) , b + + , _ . each ( $ ( " # arangoBindParamTable input " ) , function ( b ) { $ ( b ) . attr ( " name " ) = = = c & & ( a instanceof Array ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( " arraytype " ) : " object " = = typeof a ? $ ( b ) . val ( JSON . stringify ( a ) ) . addClass ( typeof a + " type " ) : $ ( b ) . val ( a ) . addClass ( typeof a + " type " ) ) } ) } ) , 0 = = = b & & $ ( " # arangoBindParamTable tbody " ) . append ( ' < tr class = " noBgColor " > < td > No bind parameters defined . < / td > < td > < / td > < / tr > ' ) } , fillBindParamTable : function ( a ) { _ . each ( a , function ( a , b ) { _ . each ( $ ( " # arangoBindParamTable input " ) , function ( c ) { $ ( c ) . attr ( " name " ) = = = b & & $ ( c ) . val ( a ) } ) } ) } , initAce : function ( ) { var a = this ; this . aqlEditor = ace . edit ( " aqlEditor " ) , this . aqlEditor . getSession ( ) . setMode ( " ace / mode / aql " ) , this . aqlEditor . setFontSize ( " 10pt " ) , this . aqlEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor = ace . edit ( " bindParamAceEditor " ) , this . bindParamAceEditor . getSession ( ) . setMode ( " ace / mode / json " ) , this . bindParamAceEditor . setFontSize ( " 10pt " ) , this . bindParamAceEditor . setShowPrintMargin ( ! 1 ) , this . bindParamAceEditor . getSession ( ) . on ( " change " , function ( ) { try { a . bindParamTableObj = JSON . parse ( a . bindParamAceEditor . getValue ( ) ) , a . allowParamToggle = ! 0 , a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) } catch ( b ) { " " = = = a . bindParamAceEditor . getValue ( ) ? ( _ . each ( a . bindParamTableObj , function ( b , c ) { a . bindParamTableObj [ c ] = " " } ) , a . allowParamToggle = ! 0 ) : a . allowParamToggle = ! 1 } } ) , this . aqlEditor . getSession ( ) . on ( " change " , function ( ) { a . checkForNewBindParams ( ) , a . renderBindParamTable ( ) , a . initDone & & a . setCachedQuery ( a . aqlEditor . getValue ( ) , JSON . stringify ( a . bindParamTableObj ) ) , a . bindParamAceEditor . setValue ( JSON . stringify ( a . bindParamTableObj , null , " " ) , 1 ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) , a . resize ( ) } ) , this . aqlEditor . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , this . aqlEditor . commands . addCommand ( { name : " executeQuery " , bindKey : { win : " Ctrl - Return " , mac : " Command - Return " , linux : " Ctrl - Return " } , exec : function ( ) { a . executeQuery ( ) } } ) , this . aqlEditor . commands . addCommand ( { name : " saveQuery " , bindKey : { win : " Ctrl - Shift - S " , mac : " Command - Shift - S " , linux : " Ctrl - Shift - S " } , exec : function ( ) { a . addAQL ( ) } } ) , this . aqlEditor . commands . addCommand ( { name : " explainQuery " , bindKey : { win : " Ctrl - Shift - Return " , mac : " Command - Shift - Return " , linux : " Ctrl - Shift - Return " } , exec : function ( ) { a . explainQuery ( ) } } ) , this . aqlEditor . commands . addCommand ( { name : " togglecomment " , bindKey : { win : " Ctrl - Shift - C " , linux : " Ctrl - Shift - C " , mac : " Command - Shift - C " } , exec : function ( a ) { a . toggleCommentLines ( ) } , multiSelectAction : " forEach " } ) , this . aqlEditor . commands . addCommand ( { name : " showSpotlight " , bindKey : { win : " Ctrl - Space " , mac : " Ctrl - Space " , linux : " Ctrl - Space " } , exec : function ( ) { a . showSpotlight ( ) } } ) , this . queryPreview = ace . edit ( " queryPreview " ) , this . queryPreview . getSession ( ) . setMode ( " ace / mode / aql " ) , this . queryPreview . setReadOnly ( ! 0 ) , this . queryPreview . setFontSize ( " 13px " ) , $ ( " # aqlEditor . ace_text - input " ) . focus ( ) ; <nl> + } , updateQueryTable : function ( ) { function a ( a , b ) { var c ; return c = a . name < b . name ? - 1 : a . name > b . name ? 1 : 0 } var b = this ; this . updateLocalQueries ( ) , this . myQueriesTableDesc . rows = this . customQueries , _ . each ( this . myQueriesTableDesc . rows , function ( a ) { a . secondRow = ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < span id = " explQuery " title = " Explain query " > < i class = " fa fa - comments " > < / i > < / i > < / span > < span id = " runQuery " title = " Run query " > < i class = " fa fa - play - circle - o " > < / i > < / i > < / span > < span id = " deleteQuery " title = " Delete query " > < i class = " fa fa - minus - circle " > < / i > < / span > < / span > ' , a . hasOwnProperty ( " parameter " ) & & delete a . parameter , delete a . value } ) , this . myQueriesTableDesc . rows . sort ( a ) , _ . each ( this . queries , function ( a ) { a . hasOwnProperty ( " parameter " ) & & delete a . parameter , b . myQueriesTableDesc . rows . push ( { name : a . name , thirdRow : ' < span class = " spanWrapper " > < span id = " copyQuery " title = " Copy query " > < i class = " fa fa - copy " > < / i > < / span > < / span > ' } ) } ) , this . myQueriesTableDesc . unescaped = [ ! 1 , ! 0 , ! 0 ] , this . $ ( this . myQueriesId ) . html ( this . table . render ( { content : this . myQueriesTableDesc } ) ) } , listenKey : function ( a ) { 13 = = = a . keyCode & & this . saveAQL ( a ) , this . checkSaveName ( ) } , addAQL : function ( ) { this . refreshAQL ( ! 0 ) , this . createCustomQueryModal ( ) , setTimeout ( function ( ) { $ ( " # new - query - name " ) . focus ( ) } , 500 ) } , createCustomQueryModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " new - query - name " , " Name " , " " , void 0 , void 0 , ! 1 , [ { rule : Joi . string ( ) . required ( ) , msg : " No query name given . " } ] ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . saveAQL . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Save Query " , a , b , void 0 , void 0 , { " keyup # new - query - name " : this . listenKey . bind ( this ) } ) } , checkSaveName : function ( ) { var a = $ ( " # new - query - name " ) . val ( ) ; if ( " Insert Query " = = = a ) return void $ ( " # new - query - name " ) . val ( " " ) ; var b = this . customQueries . some ( function ( b ) { return b . name = = = a } ) ; b ? ( $ ( " # modalButton1 " ) . removeClass ( " button - success " ) , $ ( " # modalButton1 " ) . addClass ( " button - warning " ) , $ ( " # modalButton1 " ) . text ( " Update " ) ) : ( $ ( " # modalButton1 " ) . removeClass ( " button - warning " ) , $ ( " # modalButton1 " ) . addClass ( " button - success " ) , $ ( " # modalButton1 " ) . text ( " Save " ) ) } , saveAQL : function ( a ) { a . stopPropagation ( ) , this . refreshAQL ( ) ; var b = $ ( " # new - query - name " ) . val ( ) , c = this . bindParamTableObj ; if ( ! $ ( " # new - query - name " ) . hasClass ( " invalid - input " ) & & " " ! = = b . trim ( ) ) { var d = this . aqlEditor . getValue ( ) , e = ! 1 ; if ( _ . each ( this . customQueries , function ( a ) { return a . name = = = b ? ( a . value = d , void ( e = ! 0 ) ) : void 0 } ) , e = = = ! 0 ) this . collection . findWhere ( { name : b } ) . set ( " value " , d ) ; else { if ( " " ! = = c & & void 0 ! = = c | | ( c = " { } " ) , " string " = = typeof c ) try { c = JSON . parse ( c ) } catch ( f ) { arangoHelper . arangoError ( " Query " , " Could not parse bind parameter " ) } this . collection . add ( { name : b , parameter : c , value : d } ) } var g = function ( a ) { if ( a ) arangoHelper . arangoError ( " Query " , " Could not save query " ) ; else { var b = this ; this . collection . fetch ( { success : function ( ) { b . updateLocalQueries ( ) } } ) } } . bind ( this ) ; this . collection . saveCollectionQueries ( g ) , window . modalView . hide ( ) } } , verifyQueryAndParams : function ( ) { var a = ! 1 ; 0 = = = this . aqlEditor . getValue ( ) . length & & ( arangoHelper . arangoError ( " Query " , " Your query is empty " ) , a = ! 0 ) ; var b = [ ] ; return _ . each ( this . bindParamTableObj , function ( c , d ) { " " = = = c & & ( a = ! 0 , b . push ( d ) ) } ) , b . length > 0 & & arangoHelper . arangoError ( " Bind Parameter " , JSON . stringify ( b ) + " not defined . " ) , a } , executeQuery : function ( ) { if ( ! this . verifyQueryAndParams ( ) ) { this . $ ( this . outputDiv ) . prepend ( this . outputTemplate . render ( { counter : this . outputCounter , type : " Query " } ) ) , $ ( " # outputEditorWrapper " + this . outputCounter ) . hide ( ) , $ ( " # outputEditorWrapper " + this . outputCounter ) . show ( " fast " ) ; var a = this . outputCounter , b = ace . edit ( " outputEditor " + a ) , c = ace . edit ( " sentQueryEditor " + a ) , d = ace . edit ( " sentBindParamEditor " + a ) ; c . getSession ( ) . setMode ( " ace / mode / aql " ) , c . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , c . setFontSize ( " 13px " ) , c . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( c ) , b . setFontSize ( " 13px " ) , b . getSession ( ) . setMode ( " ace / mode / json " ) , b . setReadOnly ( ! 0 ) , b . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , b . setShowPrintMargin ( ! 1 ) , this . setEditorAutoHeight ( b ) , d . setValue ( JSON . stringify ( this . bindParamTableObj ) , 1 ) , d . setOption ( " vScrollBarAlwaysVisible " , ! 0 ) , d . getSession ( ) . setMode ( " ace / mode / json " ) , d . setReadOnly ( ! 0 ) , this . setEditorAutoHeight ( d ) , this . fillResult ( b , c , a ) , this . outputCounter + + } } , readQueryData : function ( ) { var a = this . aqlEditor . session . getTextRange ( this . aqlEditor . getSelectionRange ( ) ) , b = $ ( " # querySize " ) , c = { query : a | | this . aqlEditor . getValue ( ) , id : " currentFrontendQuery " } ; return " all " = = = b . val ( ) ? c . batchSize = 1e6 : c . batchSize = parseInt ( b . val ( ) , 10 ) , Object . keys ( this . bindParamTableObj ) . length > 0 & & ( c . bindVars = this . bindParamTableObj ) , JSON . stringify ( c ) } , fillResult : function ( a , b , c ) { var d = this , e = this . readQueryData ( ) ; e & & ( b . setValue ( d . aqlEditor . getValue ( ) , 1 ) , $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _api / cursor " ) , headers : { " x - arango - async " : " store " } , data : e , contentType : " application / json " , processData : ! 1 , success : function ( b , e , f ) { f . getResponseHeader ( " x - arango - async - id " ) & & d . queryCallbackFunction ( f . getResponseHeader ( " x - arango - async - id " ) , a , c ) , $ . noty . clearQueue ( ) , $ . noty . closeAll ( ) , d . handleResult ( c ) } , error : function ( a ) { try { var b = JSON . parse ( a . responseText ) ; arangoHelper . arangoError ( " [ " + b . errorNum + " ] " , b . errorMessage ) } catch ( e ) { arangoHelper . arangoError ( " Query error " , " ERROR " ) } d . handleResult ( c ) } } ) ) } , handleResult : function ( ) { window . progressView . hide ( ) , $ ( " # removeResults " ) . show ( ) , $ ( " . centralRow " ) . animate ( { scrollTop : $ ( " # queryContent " ) . height ( ) } , " fast " ) } , setEditorAutoHeight : function ( a ) { var b = $ ( " . centralRow " ) . height ( ) , c = ( b - 250 ) / 17 ; a . setOptions ( { maxLines : c , minLines : 10 } ) } , deselect : function ( a ) { var b = a . getSelection ( ) , c = b . lead . row , d = b . lead . column ; b . setSelectionRange ( { start : { row : c , column : d } , end : { row : c , column : d } } ) , a . focus ( ) } , queryCallbackFunction : function ( a , b , c ) { var d = this , e = function ( a , b ) { $ . ajax ( { url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) + " / cancel " ) , type : " PUT " , success : function ( ) { window . clearTimeout ( d . checkQueryTimer ) , $ ( " # outputEditorWrapper " + b ) . remove ( ) , arangoHelper . arangoNotification ( " Query " , " Query canceled . " ) } } ) } ; $ ( " # outputEditorWrapper " + c + " # cancelCurrentQuery " ) . bind ( " click " , function ( ) { e ( a , c ) } ) , $ ( " # outputEditorWrapper " + c + " # copy2aqlEditor " ) . bind ( " click " , function ( ) { $ ( " # toggleQueries1 " ) . is ( " : visible " ) | | d . toggleQueries ( ) ; var a = ace . edit ( " sentQueryEditor " + c ) . getValue ( ) , b = JSON . parse ( ace . edit ( " sentBindParamEditor " + c ) . getValue ( ) ) ; d . aqlEditor . setValue ( a , 1 ) , d . deselect ( d . aqlEditor ) , Object . keys ( b ) . length > 0 & & ( d . bindParamTableObj = b , d . setCachedQuery ( d . aqlEditor . getValue ( ) , JSON . stringify ( d . bindParamTableObj ) ) , $ ( " # bindParamEditor " ) . is ( " : visible " ) ? d . renderBindParamTable ( ) : ( d . bindParamAceEditor . setValue ( JSON . stringify ( b ) , 1 ) , d . deselect ( d . bindParamAceEditor ) ) ) , $ ( " . centralRow " ) . animate ( { scrollTop : 0 } , " fast " ) , d . resize ( ) } ) , this . execPending = ! 1 ; var f = function ( a ) { var c = " " ; a . extra & & a . extra . warnings & & a . extra . warnings . length > 0 & & ( c + = " Warnings : \ r \ n \ r \ n " , a . extra . warnings . forEach ( function ( a ) { c + = " [ " + a . code + " ] , ' " + a . message + " ' \ r \ n " } ) ) , " " ! = = c & & ( c + = " \ r \ nResult : \ r \ n \ r \ n " ) , b . setValue ( c + JSON . stringify ( a . result , void 0 , 2 ) , 1 ) , b . getSession ( ) . setScrollTop ( 0 ) } , g = function ( a ) { f ( a ) , window . progressView . hide ( ) ; var e = function ( a , b ) { $ ( " # outputEditorWrapper " + c + " . arangoToolbarTop . pull - left " ) . append ( ' < span > < i class = " fa ' + b + ' " > < / i > < i class = " iconText " > ' + a + " < / i > < / span > " ) } ; $ ( " # outputEditorWrapper " + c + " . pull - left # spinner " ) . remove ( ) ; var g = " - " ; a & & a . extra & & a . extra . stats & & ( g = a . extra . stats . executionTime . toFixed ( 3 ) + " s " ) , e ( a . result . length + " elements " , " fa - calculator " ) , e ( g , " fa - clock - o " ) , a . extra & & a . extra . stats & & ( console . log ( a . result . length ) , ( a . extra . stats . writesExecuted > 0 | | a . extra . stats . writesIgnored > 0 ) & & ( e ( a . extra . stats . writesExecuted + " writes " , " fa - check - circle positive " ) , 0 = = = a . extra . stats . writesIgnored ? e ( a . extra . stats . writesIgnored + " writes ignored " , " fa - check - circle positive " ) : e ( a . extra . stats . writesIgnored + " writes ignored " , " fa - exclamation - circle warning " ) ) , a . extra . stats . scannedFull > 0 ? e ( " full collection scan " , " fa - exclamation - circle warning " ) : e ( " no full collection scan " , " fa - check - circle positive " ) ) , $ ( " # outputEditorWrapper " + c + " . switchAce " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " . fa - close " ) . show ( ) , $ ( " # outputEditor " + c ) . css ( " opacity " , " 1 " ) , $ ( " # outputEditorWrapper " + c + " # downloadQueryResult " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " # copy2aqlEditor " ) . show ( ) , $ ( " # outputEditorWrapper " + c + " # cancelCurrentQuery " ) . remove ( ) , d . setEditorAutoHeight ( b ) , d . deselect ( b ) , a . id & & $ . ajax ( { url : " / _api / cursor / " + encodeURIComponent ( a . id ) , type : " DELETE " , error : function ( a ) { console . log ( a ) } } ) } , h = function ( ) { $ . ajax ( { type : " PUT " , url : arangoHelper . databaseUrl ( " / _api / job / " + encodeURIComponent ( a ) ) , contentType : " application / json " , processData : ! 1 , success : function ( a , b , c ) { 201 = = = c . status ? g ( a ) : 204 = = = c . status & & ( d . checkQueryTimer = window . setTimeout ( function ( ) { h ( ) } , 500 ) ) } , error : function ( a ) { var b ; try { if ( " Gone " = = = a . statusText ) return arangoHelper . arangoNotification ( " Query " , " Query execution aborted . " ) , void d . removeOutputEditor ( c ) ; b = JSON . parse ( a . responseText ) , arangoHelper . arangoError ( " Query " , b . errorMessage ) , b . errorMessage & & ( null ! = = b . errorMessage . match ( / \ d + : \ d + / g ) ? d . markPositionError ( b . errorMessage . match ( / ' . * ' / g ) [ 0 ] , b . errorMessage . match ( / \ d + : \ d + / g ) [ 0 ] ) : d . markPositionError ( b . errorMessage . match ( / \ ( \ w + \ ) / g ) [ 0 ] ) , d . removeOutputEditor ( c ) ) } catch ( e ) { console . log ( b ) , 400 ! = = b . code & & arangoHelper . arangoError ( " Query " , " Successfully aborted . " ) , d . removeOutputEditor ( c ) } window . progressView . hide ( ) } } ) } ; h ( ) } , markPositionError : function ( a , b ) { var c ; b & & ( c = b . split ( " : " ) [ 0 ] , a = a . substr ( 1 , a . length - 2 ) ) ; var d = this . aqlEditor . find ( a ) ; ! d & & b & & ( this . aqlEditor . selection . moveCursorToPosition ( { row : c , column : 0 } ) , this . aqlEditor . selection . selectLine ( ) ) , window . setTimeout ( function ( ) { $ ( " . ace_start " ) . first ( ) . css ( " background " , " rgba ( 255 , 129 , 129 , 0 . 7 ) " ) } , 100 ) } , refreshAQL : function ( ) { var a = this , b = function ( b ) { b ? arangoHelper . arangoError ( " Query " , " Could not reload Queries " ) : ( a . updateLocalQueries ( ) , a . updateQueryTable ( ) ) } . bind ( a ) , c = function ( ) { a . getSystemQueries ( b ) } . bind ( a ) ; this . getAQL ( c ) } , getSystemQueries : function ( a ) { var b = this ; $ . ajax ( { type : " GET " , cache : ! 1 , url : " js / arango / aqltemplates . json " , contentType : " application / json " , processData : ! 1 , success : function ( c ) { a & & a ( ! 1 ) , b . queries = c } , error : function ( ) { a & & a ( ! 0 ) , arangoHelper . arangoNotification ( " Query " , " Error while loading system templates " ) } } ) } , updateLocalQueries : function ( ) { var a = this ; this . customQueries = [ ] , this . collection . each ( function ( b ) { a . customQueries . push ( { name : b . get ( " name " ) , value : b . get ( " value " ) , parameter : b . get ( " parameter " ) } ) } ) } , getAQL : function ( a ) { var b = this ; this . collection . fetch ( { success : function ( ) { var c = localStorage . getItem ( " customQueries " ) ; if ( c ) { var d = JSON . parse ( c ) ; _ . each ( d , function ( a ) { b . collection . add ( { value : a . value , name : a . name } ) } ) ; var e = function ( a ) { a ? arangoHelper . arangoError ( " Custom Queries " , " Could not import old local storage queries " ) : localStorage . removeItem ( " customQueries " ) } . bind ( b ) ; b . collection . saveCollectionQueries ( e ) } b . updateLocalQueries ( ) , a & & a ( ) } } ) } } ) } ( ) , function ( ) { " use strict " ; window . ScaleView = Backbone . View . extend ( { el : " # content " , template : templateEngine . createTemplate ( " scaleView . ejs " ) , interval : 5e3 , knownServers : [ ] , events : { " click # addCoord " : " addCoord " , " click # removeCoord " : " removeCoord " , " click # addDBs " : " addDBs " , " click # removeDBs " : " removeDBs " } , setCoordSize : function ( a ) { $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / cluster / setCoordSize " ) , contentType : " application / json " , data : JSON . stringify ( { value : a } ) , success : function ( ) { $ ( " # plannedCoords " ) . html ( a ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , setDBsSize : function ( a ) { $ . ajax ( { type : " POST " , url : arangoHelper . databaseUrl ( " / _admin / cluster / setDBsSize " ) , contentType : " application / json " , data : JSON . stringify ( { value : a } ) , success : function ( ) { $ ( " # plannedCoords " ) . html ( a ) } , error : function ( ) { arangoHelper . arangoError ( " Scale " , " Could not set coordinator size . " ) } } ) } , addCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 0 ) ) } , removeCoord : function ( ) { this . setCoordSize ( this . readNumberFromID ( " # plannedCoords " , ! 1 , ! 0 ) ) } , addDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 0 ) ) } , removeDBs : function ( ) { this . setDBsSize ( this . readNumberFromID ( " # plannedDBs " , ! 1 , ! 0 ) ) } , readNumberFromID : function ( a , b , c ) { var d = $ ( a ) . html ( ) , e = ! 1 ; try { e = JSON . parse ( d ) } catch ( f ) { } return b & & e + + , c & & 1 ! = = e & & e - - , e } , initialize : function ( a ) { window . App . isCluster & & ( this . dbServers = a . dbServers , this . coordinators = a . coordinators , this . updateServerTime ( ) , window . setInterval ( function ( ) { if ( " # sNodes " = = = window . location . hash ) ; } , this . interval ) ) } , render : function ( ) { var a = this , b = function ( ) { var b = function ( ) { a . continueRender ( ) } . bind ( this ) ; this . waitForDBServers ( b ) } . bind ( this ) ; this . initDoneCoords ? b ( ) : this . waitForCoordinators ( b ) , window . arangoHelper . buildNodesSubNav ( " scale " ) } , continueRender : function ( ) { var a , b , c = this ; a = this . coordinators . toJSON ( ) , b = this . dbServers . toJSON ( ) , this . $ el . html ( this . template . render ( { runningCoords : a . length , runningDBs : b . length , plannedCoords : void 0 , plannedDBs : void 0 } ) ) , $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _admin / cluster / numberOfServers " ) , contentType : " application / json " , processData : ! 1 , success : function ( a ) { c . updateTable ( a ) } } ) } , updateTable : function ( a ) { $ ( " # plannedCoords " ) . html ( a . numberOfCoordinators ) , $ ( " # plannedDBs " ) . html ( a . numberOfDBServers ) ; var b = ' < span class = " warning " > scaling in progress < / span > ' , c = ' < span class = " positive " > no scaling process active < / span > ' ; this . coordinators . toJSON ( ) . length = = = a . numberOfCoordinators ? $ ( " # statusCoords " ) . html ( c ) : $ ( " # statusCoords " ) . html ( b ) , this . dbServers . toJSON ( ) . length = = = a . numberOfDBServers ? $ ( " # statusDBs " ) . html ( c ) : $ ( " # statusDBs " ) . html ( b ) } , waitForDBServers : function ( a ) { var b = this ; 0 = = = this . dbServers . length ? window . setInterval ( function ( ) { b . waitForDBServers ( a ) } , 300 ) : a ( ) } , waitForCoordinators : function ( a ) { var b = this ; window . setTimeout ( function ( ) { 0 = = = b . coordinators . length ? b . waitForCoordinators ( a ) : ( this . initDoneCoords = ! 0 , a ( ) ) } , 200 ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } } ) } ( ) , function ( ) { " use strict " ; window . SettingsView = Backbone . View . extend ( { el : " # content " , initialize : function ( a ) { this . collectionName = a . collectionName , this . model = this . collection } , events : { } , render : function ( ) { this . breadcrumb ( ) , window . arangoHelper . buildCollectionSubNav ( this . collectionName , " Settings " ) , this . renderSettings ( ) } , breadcrumb : function ( ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " Collection : " + this . collectionName ) } , unloadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be unloaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " unloading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " unloaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " unloaded . " ) } . bind ( this ) ; this . model . unloadCollection ( a ) , window . modalView . hide ( ) } , loadCollection : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " Collection error " , this . model . get ( " name " ) + " could not be loaded . " ) : void 0 = = = a ? ( this . model . set ( " status " , " loading " ) , this . render ( ) ) : " # collections " = = = window . location . hash ? ( this . model . set ( " status " , " loaded " ) , this . render ( ) ) : arangoHelper . arangoNotification ( " Collection " + this . model . get ( " name " ) + " loaded . " ) } . bind ( this ) ; this . model . loadCollection ( a ) , window . modalView . hide ( ) } , truncateCollection : function ( ) { this . model . truncateCollection ( ) , window . modalView . hide ( ) } , deleteCollection : function ( ) { this . model . destroy ( { error : function ( ) { arangoHelper . arangoError ( " Could not delete collection . " ) } , success : function ( ) { window . App . navigate ( " # collections " , { trigger : ! 0 } ) } } ) } , saveModifiedCollection : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c ; c = b ? this . model . get ( " name " ) : $ ( " # change - collection - name " ) . val ( ) ; var d = this . model . get ( " status " ) ; if ( " loaded " = = = d ) { var e ; try { e = JSON . parse ( 1024 * $ ( " # change - collection - size " ) . val ( ) * 1024 ) } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number " ) , 0 } var g ; try { if ( g = JSON . parse ( $ ( " # change - index - buckets " ) . val ( ) ) , 1 > g | | parseInt ( g ) ! = = Math . pow ( 2 , Math . log2 ( g ) ) ) throw " invalid indexBuckets value " } catch ( f ) { return arangoHelper . arangoError ( " Please enter a valid number of index buckets " ) , 0 } var h = function ( a ) { a ? arangoHelper . arangoError ( " Collection error : " + a . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) , i = function ( a ) { if ( a ) arangoHelper . arangoError ( " Collection error : " + a . responseText ) ; else { var b = $ ( " # change - collection - sync " ) . val ( ) ; this . model . changeCollection ( b , e , g , h ) } } . bind ( this ) ; this . model . renameCollection ( c , i ) } else if ( " unloaded " = = = d ) if ( this . model . get ( " name " ) ! = = c ) { var j = function ( a , b ) { a ? arangoHelper . arangoError ( " Collection error : " + b . responseText ) : ( this . collectionsView . render ( ) , window . modalView . hide ( ) ) } . bind ( this ) ; this . model . renameCollection ( c , j ) } else window . modalView . hide ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } , renderSettings : function ( ) { var a = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Error " , " Could not get coordinator info " ) ; else { var c = ! 1 ; " loaded " = = = this . model . get ( " status " ) & & ( c = ! 0 ) ; var d = [ ] , e = [ ] ; b | | e . push ( window . modalView . createTextEntry ( " change - collection - name " , " Name " , this . model . get ( " name " ) , ! 1 , " " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z ] / ) , msg : " Collection name must always start with a letter . " } , { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only Symbols " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No collection name given . " } ] ) ) ; var f = function ( ) { e . push ( window . modalView . createReadOnlyEntry ( " change - collection - id " , " ID " , this . model . get ( " id " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - type " , " Type " , this . model . get ( " type " ) , " " ) ) , e . push ( window . modalView . createReadOnlyEntry ( " change - collection - status " , " Status " , this . model . get ( " status " ) , " " ) ) , d . push ( window . modalView . createDeleteButton ( " Delete " , this . deleteCollection . bind ( this ) ) ) , d . push ( window . modalView . createDeleteButton ( " Truncate " , this . truncateCollection . bind ( this ) ) ) , c ? d . push ( window . modalView . createNotificationButton ( " Unload " , this . unloadCollection . bind ( this ) ) ) : d . push ( window . modalView . createNotificationButton ( " Load " , this . loadCollection . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . saveModifiedCollection . bind ( this ) ) ) ; var a = [ " General " , " Indices " ] , b = [ " modalTable . ejs " , " indicesView . ejs " ] ; window . modalView . show ( b , " Modify Collection " , d , e , null , null , this . events , null , a , " content " ) , $ ( $ ( " # infoTab " ) . children ( ) [ 1 ] ) . remove ( ) } . bind ( this ) ; if ( c ) { var g = function ( a , b ) { if ( a ) arangoHelper . arangoError ( " Collection " , " Could not fetch properties " ) ; else { var c = b . journalSize / 1048576 , d = b . indexBuckets , g = b . waitForSync ; e . push ( window . modalView . createTextEntry ( " change - collection - size " , " Journal size " , c , " The maximal size of a journal or datafile ( in MB ) . Must be at least 1 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 0 - 9 ] * $ / ) , msg : " Must be a number . " } ] ) ) , e . push ( window . modalView . createTextEntry ( " change - index - buckets " , " Index buckets " , d , " The number of index buckets for this collection . Must be at least 1 and a power of 2 . " , " " , ! 0 , [ { rule : Joi . string ( ) . allow ( " " ) . optional ( ) . regex ( / ^ [ 1 - 9 ] [ 0 - 9 ] * $ / ) , msg : " Must be a number greater than 1 and a power of 2 . " } ] ) ) , e . push ( window . modalView . createSelectEntry ( " change - collection - sync " , " Wait for sync " , g , " Synchronize to disk before returning from a create or update of a document . " , [ { value : ! 1 , label : " No " } , { value : ! 0 , label : " Yes " } ] ) ) } f ( ) } . bind ( this ) ; this . model . getProperties ( g ) } else f ( ) } } . bind ( this ) ; window . isCoordinator ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . ShowClusterView = Backbone . View . extend ( { detailEl : " # modalPlaceholder " , el : " # content " , defaultFrame : 12e5 , template : templateEngine . createTemplate ( " showCluster . ejs " ) , modal : templateEngine . createTemplate ( " waitModal . ejs " ) , detailTemplate : templateEngine . createTemplate ( " detailView . ejs " ) , events : { " change # selectDB " : " updateCollections " , " change # selectCol " : " updateShards " , " click . dbserver . success " : " dashboard " , " click . coordinator . success " : " dashboard " } , replaceSVGs : function ( ) { $ ( " . svgToReplace " ) . each ( function ( ) { var a = $ ( this ) , b = a . attr ( " id " ) , c = a . attr ( " src " ) ; $ . get ( c , function ( c ) { var d = $ ( c ) . find ( " svg " ) ; d . attr ( " id " , b ) . attr ( " class " , " icon " ) . removeAttr ( " xmlns : a " ) , a . replaceWith ( d ) } , " xml " ) } ) } , updateServerTime : function ( ) { this . serverTime = ( new Date ) . getTime ( ) } , setShowAll : function ( ) { this . graphShowAll = ! 0 } , resetShowAll : function ( ) { this . graphShowAll = ! 1 , this . renderLineChart ( ) } , initialize : function ( a ) { this . options = a , this . interval = 1e4 , this . isUpdating = ! 1 , this . timer = null , this . knownServers = [ ] , this . graph = void 0 , this . graphShowAll = ! 1 , this . updateServerTime ( ) , this . dygraphConfig = this . options . dygraphConfig , this . dbservers = new window . ClusterServers ( [ ] , { interval : this . interval } ) , this . coordinators = new window . ClusterCoordinators ( [ ] , { interval : this . interval } ) , this . documentStore = new window . arangoDocuments , this . statisticsDescription = new window . StatisticsDescription , this . statisticsDescription . fetch ( { async : ! 1 } ) , this . dbs = new window . ClusterDatabases ( [ ] , { interval : this . interval } ) , this . cols = new window . ClusterCollections , this . shards = new window . ClusterShards , this . startUpdating ( ) } , listByAddress : function ( a ) { var b = { } , c = this ; this . dbservers . byAddress ( b , function ( b ) { c . coordinators . byAddress ( b , a ) } ) } , updateCollections : function ( ) { var a = this , b = $ ( " # selectCol " ) , c = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) ; if ( c ) { var d = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . cols . getList ( c , function ( c ) { _ . each ( _ . pluck ( c , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + d , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateShards ( ) } ) } } , updateShards : function ( ) { var a = $ ( " # selectDB " ) . find ( " : selected " ) . attr ( " id " ) , b = $ ( " # selectCol " ) . find ( " : selected " ) . attr ( " id " ) ; this . shards . getList ( a , b , function ( a ) { $ ( " . shardCounter " ) . html ( " 0 " ) , _ . each ( a , function ( a ) { $ ( " # " + a . server + " Shards " ) . html ( a . shards . length ) } ) } ) } , updateServerStatus : function ( a ) { var b = this , c = function ( a , b , c ) { var d , e , f = c ; f = f . replace ( / \ . / g , " - " ) , f = f . replace ( / \ : / g , " _ " ) , e = $ ( " # id " + f ) , e . length < 1 | | ( d = e . attr ( " class " ) . split ( / \ s + / ) [ 1 ] , e . attr ( " class " , a + " " + d + " " + b ) , " coordinator " = = = a & & ( " success " = = = b ? $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 1 ) : $ ( " . button - gui " , e . closest ( " . tile " ) ) . toggleClass ( " button - gui - disabled " , ! 0 ) ) ) } ; this . coordinators . getStatuses ( c . bind ( this , " coordinator " ) , function ( ) { b . dbservers . getStatuses ( c . bind ( b , " dbserver " ) ) , a ( ) } ) } , updateDBDetailList : function ( ) { var a = this , b = $ ( " # selectDB " ) , c = b . find ( " : selected " ) . attr ( " id " ) ; b . html ( " " ) , this . dbs . getList ( function ( d ) { _ . each ( _ . pluck ( d , " name " ) , function ( a ) { b . append ( ' < option id = " ' + a + ' " > ' + a + " < / option > " ) } ) ; var e = $ ( " # " + c , b ) ; 1 = = = e . length & & e . prop ( " selected " , ! 0 ) , a . updateCollections ( ) } ) } , rerender : function ( ) { var a = this ; this . updateServerStatus ( function ( ) { a . getServerStatistics ( function ( ) { a . updateServerTime ( ) , a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) } ) } ) } , render : function ( ) { this . knownServers = [ ] , delete this . hist ; var a = this ; this . listByAddress ( function ( b ) { 1 = = = Object . keys ( b ) . length ? a . type = " testPlan " : a . type = " other " , a . updateDBDetailList ( ) , a . dbs . getList ( function ( c ) { $ ( a . el ) . html ( a . template . render ( { dbs : _ . pluck ( c , " name " ) , byAddress : b , type : a . type } ) ) , $ ( a . el ) . append ( a . modal . render ( { } ) ) , a . replaceSVGs ( ) , a . getServerStatistics ( function ( ) { a . data = a . generatePieData ( ) , a . renderPieChart ( a . data ) , a . renderLineChart ( ) , a . updateDBDetailList ( ) , a . startUpdating ( ) } ) } ) } ) } , generatePieData : function ( ) { var a = [ ] , b = this ; return this . data . forEach ( function ( c ) { a . push ( { key : c . get ( " name " ) , value : c . get ( " system " ) . virtualSize , time : b . serverTime } ) } ) , a } , addStatisticsItem : function ( a , b , c , d ) { var e = this ; e . hasOwnProperty ( " hist " ) | | ( e . hist = { } ) , e . hist . hasOwnProperty ( a ) | | ( e . hist [ a ] = [ ] ) ; var f = e . hist [ a ] , g = f . length ; if ( 0 = = = g ) f . push ( { time : b , snap : d , requests : c , requestsPerSecond : 0 } ) ; else { var h = f [ g - 1 ] . time , i = f [ g - 1 ] . requests ; if ( c > i ) { var j = b - h , k = 0 ; j > 0 & & ( k = ( c - i ) / j ) , f . push ( { time : b , snap : d , requests : c , requestsPerSecond : k } ) } } } , getServerStatistics : function ( a ) { var b = this , c = Math . round ( b . serverTime / 1e3 ) ; this . data = void 0 ; var d = new window . ClusterStatisticsCollection , e = this . coordinators . first ( ) ; this . dbservers . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { - 1 = = = b . knownServers . indexOf ( a . id ) & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = e . get ( " protocol " ) + " : / / " + e . get ( " address " ) + " / _admin / clusterStatistics ? DBserver = " + a . get ( " name " ) , d . add ( c ) } } ) , this . coordinators . forEach ( function ( a ) { if ( " ok " = = = a . get ( " status " ) ) { - 1 = = = b . knownServers . indexOf ( a . id ) & & b . knownServers . push ( a . id ) ; var c = new window . Statistics ( { name : a . id } ) ; c . url = a . get ( " protocol " ) + " : / / " + a . get ( " address " ) + " / _admin / statistics " , d . add ( c ) } } ) ; var f = d . size ( ) ; this . data = [ ] ; var g = function ( d ) { f - - ; var e = d . get ( " time " ) , g = d . get ( " name " ) , h = d . get ( " http " ) . requestsTotal ; b . addStatisticsItem ( g , e , h , c ) , b . data . push ( d ) , 0 = = = f & & a ( ) } , h = function ( ) { f - - , 0 = = = f & & a ( ) } ; d . fetch ( g , h ) } , renderPieChart : function ( a ) { var b = $ ( " # clusterGraphs svg " ) . width ( ) , c = $ ( " # clusterGraphs svg " ) . height ( ) , d = Math . min ( b , c ) / 2 , e = this . dygraphConfig . colors , f = d3 . svg . arc ( ) . outerRadius ( d - 20 ) . innerRadius ( 0 ) , g = d3 . layout . pie ( ) . sort ( function ( a ) { return a . value } ) . value ( function ( a ) { return a . value } ) ; d3 . select ( " # clusterGraphs " ) . select ( " svg " ) . remove ( ) ; var h = d3 . select ( " # clusterGraphs " ) . append ( " svg " ) . attr ( " class " , " clusterChart " ) . append ( " g " ) . attr ( " transform " , " translate ( " + b / 2 + " , " + ( c / 2 - 10 ) + " ) " ) , i = d3 . svg . arc ( ) . outerRadius ( d - 2 ) . innerRadius ( d - 2 ) , j = h . selectAll ( " . arc " ) . data ( g ( a ) ) . enter ( ) . append ( " g " ) . attr ( " class " , " slice " ) ; j . append ( " path " ) . attr ( " d " , f ) . style ( " fill " , function ( a , b ) { return e [ b % e . length ] } ) . style ( " stroke " , function ( a , b ) { return e [ b % e . length ] } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + f . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { var b = a . data . value / 1024 / 1024 / 1024 ; return b . toFixed ( 2 ) } ) , j . append ( " text " ) . attr ( " transform " , function ( a ) { return " translate ( " + i . centroid ( a ) + " ) " } ) . style ( " text - anchor " , " middle " ) . text ( function ( a ) { return a . data . key } ) } , renderLineChart : function ( ) { var a , b , c , d , e , f , g = this , h = 1200 , i = [ ] , j = [ ] , k = Math . round ( ( new Date ) . getTime ( ) / 1e3 ) - h , l = g . knownServers , m = function ( ) { return null } ; for ( c = 0 ; c < l . length ; + + c ) if ( b = g . hist [ l [ c ] ] ) for ( d = 0 ; d < b . length ; + + d ) f = b [ d ] . snap , k > f | | ( j . hasOwnProperty ( f ) ? a = j [ f ] : ( e = new Date ( 1e3 * f ) , a = j [ f ] = [ e ] . concat ( l . map ( m ) ) ) , a [ c + 1 ] = b [ d ] . requestsPerSecond ) ; i = [ ] , Object . keys ( j ) . sort ( ) . forEach ( function ( a ) { i . push ( j [ a ] ) } ) ; var n = this . dygraphConfig . getDefaultConfig ( " clusterRequestsPerSecond " ) ; n . labelsDiv = $ ( " # lineGraphLegend " ) [ 0 ] , n . labels = [ " datetime " ] . concat ( l ) , g . graph = new Dygraph ( document . getElementById ( " lineGraph " ) , i , n ) } , stopUpdating : function ( ) { window . clearTimeout ( this . timer ) , delete this . graph , this . isUpdating = ! 1 } , startUpdating : function ( ) { if ( ! this . isUpdating ) { this . isUpdating = ! 0 ; var a = this ; this . timer = window . setInterval ( function ( ) { a . rerender ( ) } , this . interval ) } } , dashboard : function ( a ) { this . stopUpdating ( ) ; var b , c , d = $ ( a . currentTarget ) , e = { } , f = d . attr ( " id " ) ; f = f . replace ( / \ - / g , " . " ) , f = f . replace ( / \ _ / g , " : " ) , f = f . substr ( 2 ) , e . raw = f , e . isDBServer = d . hasClass ( " dbserver " ) , e . isDBServer ? ( b = this . dbservers . findWhere ( { address : e . raw } ) , c = this . coordinators . findWhere ( { status : " ok " } ) , e . endpoint = c . get ( " protocol " ) + " : / / " + c . get ( " address " ) ) : ( b = this . coordinators . findWhere ( { address : e . raw } ) , e . endpoint = b . get ( " protocol " ) + " : / / " + b . get ( " address " ) ) , e . target = encodeURIComponent ( b . get ( " name " ) ) , window . App . serverToShow = e , window . App . dashboard ( ) } , getCurrentSize : function ( a ) { " # " ! = = a . substr ( 0 , 1 ) & & ( a = " # " + a ) ; var b , c ; return $ ( a ) . attr ( " style " , " " ) , b = $ ( a ) . height ( ) , c = $ ( a ) . width ( ) , { height : b , width : c } } , resize : function ( ) { var a ; this . graph & & ( a = this . getCurrentSize ( this . graph . maindiv_ . id ) , this . graph . resize ( a . width , a . height ) ) } } ) } ( ) , function ( ) { " use strict " ; window . SpotlightView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " spotlightView . ejs " ) , el : " # spotlightPlaceholder " , displayLimit : 8 , typeahead : null , callbackSuccess : null , callbackCancel : null , collections : { system : [ ] , doc : [ ] , edge : [ ] } , events : { " focusout # spotlight . tt - input " : " hide " , " keyup # spotlight . typeahead " : " listenKey " } , aqlKeywordsArray : [ ] , aqlBuiltinFunctionsArray : [ ] , aqlKeywords : " for | return | filter | sort | limit | let | collect | asc | desc | in | into | insert | update | remove | replace | upsert | options | with | and | or | not | distinct | graph | outbound | inbound | any | all | none | aggregate | like | count " , aqlBuiltinFunctions : " to_bool | to_number | to_string | to_list | is_null | is_bool | is_number | is_string | is_list | is_document | typename | concat | concat_separator | char_length | lower | upper | substring | left | right | trim | reverse | contains | like | floor | ceil | round | abs | rand | sqrt | pow | length | min | max | average | sum | median | variance_population | variance_sample | first | last | unique | matches | merge | merge_recursive | has | attributes | values | unset | unset_recursive | keep | near | within | within_rectangle | is_in_polygon | fulltext | paths | traversal | traversal_tree | edges | stddev_sample | stddev_population | slice | nth | position | translate | zip | call | apply | push | append | pop | shift | unshift | remove_valueremove_nth | graph_paths | shortest_path | graph_shortest_path | graph_distance_to | graph_traversal | graph_traversal_tree | graph_edges | graph_vertices | neighbors | graph_neighbors | graph_common_neighbors | graph_common_properties | graph_eccentricity | graph_betweenness | graph_closeness | graph_absolute_eccentricity | remove_values | graph_absolute_betweenness | graph_absolute_closeness | graph_diameter | graph_radius | date_now | date_timestamp | date_iso8601 | date_dayofweek | date_year | date_month | date_day | date_hour | date_minute | date_second | date_millisecond | date_dayofyear | date_isoweek | date_leapyear | date_quarter | date_days_in_month | date_add | date_subtract | date_diff | date_compare | date_format | fail | passthru | sleep | not_null | first_list | first_document | parse_identifier | current_user | current_database | collections | document | union | union_distinct | intersection | flatten | ltrim | rtrim | find_first | find_last | split | substitute | md5 | sha1 | hash | random_token | AQL_LAST_ENTRY " , listenKey : function ( a ) { 27 = = = a . keyCode ? ( this . callbackSuccess & & this . callbackCancel ( ) , this . hide ( ) ) : 13 = = = a . keyCode & & this . callbackSuccess & & ( this . callbackSuccess ( $ ( this . typeahead ) . val ( ) ) , this . hide ( ) ) } , substringMatcher : function ( a ) { return function ( b , c ) { var d , e ; d = [ ] , e = new RegExp ( b , " i " ) , _ . each ( a , function ( a ) { e . test ( a ) & & d . push ( a ) } ) , c ( d ) } } , updateDatasets : function ( ) { var a = this ; this . collections = { system : [ ] , doc : [ ] , edge : [ ] } , window . App . arangoCollectionsStore . each ( function ( b ) { b . get ( " isSystem " ) ? a . collections . system . push ( b . get ( " name " ) ) : " document " = = = b . get ( " type " ) ? a . collections . doc . push ( b . get ( " name " ) ) : a . collections . edge . push ( b . get ( " name " ) ) } ) } , stringToArray : function ( ) { var a = this ; _ . each ( this . aqlKeywords . split ( " | " ) , function ( b ) { a . aqlKeywordsArray . push ( b . toUpperCase ( ) ) } ) , _ . each ( this . aqlBuiltinFunctions . split ( " | " ) , function ( b ) { a . aqlBuiltinFunctionsArray . push ( b . toUpperCase ( ) ) } ) , a . aqlKeywordsArray . push ( ! 0 ) , a . aqlKeywordsArray . push ( ! 1 ) , a . aqlKeywordsArray . push ( null ) } , show : function ( a , b , c ) { this . callbackSuccess = a , this . callbackCancel = b , this . stringToArray ( ) , this . updateDatasets ( ) ; var d = function ( a , b , c ) { var d = ' < div class = " header - type " > < h4 > ' + a + " < / h4 > " ; return b & & ( d + = ' < span > < i class = " fa ' + b + ' " > < / i > < / span > ' ) , c & & ( d + = ' < span class = " type " > ' + c . toUpperCase ( ) + " < / span > " ) , d + = " < / div > " } ; $ ( this . el ) . html ( this . template . render ( { } ) ) , $ ( this . el ) . show ( ) , " aql " = = = c ? this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Functions " , source : this . substringMatcher ( this . aqlBuiltinFunctionsArray ) , limit : this . displayLimit , templates : { header : d ( " Functions " , " fa - code " , " aql " ) } } , { name : " Keywords " , source : this . substringMatcher ( this . aqlKeywordsArray ) , limit : this . displayLimit , templates : { header : d ( " Keywords " , " fa - code " , " aql " ) } } , { name : " Documents " , source : this . substringMatcher ( this . collections . doc ) , limit : this . displayLimit , templates : { header : d ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : this . substringMatcher ( this . collections . edge ) , limit : this . displayLimit , templates : { header : d ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : this . displayLimit , source : this . substringMatcher ( this . collections . system ) , templates : { header : d ( " System " , " fa - cogs " , " Collection " ) } } ) : this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( { hint : ! 0 , highlight : ! 0 , minLength : 1 } , { name : " Documents " , source : this . substringMatcher ( this . collections . doc ) , limit : this . displayLimit , templates : { header : d ( " Documents " , " fa - file - text - o " , " Collection " ) } } , { name : " Edges " , source : this . substringMatcher ( this . collections . edge ) , limit : this . displayLimit , templates : { header : d ( " Edges " , " fa - share - alt " , " Collection " ) } } , { name : " System " , limit : this . displayLimit , source : this . substringMatcher ( this . collections . system ) , templates : { header : d ( " System " , " fa - cogs " , " Collection " ) } } ) , $ ( " # spotlight . typeahead " ) . focus ( ) } , hide : function ( ) { $ ( this . el ) . hide ( ) , <nl> + this . typeahead = $ ( " # spotlight . typeahead " ) . typeahead ( " destroy " ) } } ) } ( ) , function ( ) { " use strict " ; window . StatisticBarView = Backbone . View . extend ( { el : " # statisticBar " , events : { " change # arangoCollectionSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " } , template : templateEngine . createTemplate ( " statisticBarView . ejs " ) , initialize : function ( a ) { this . currentDB = a . currentDB } , replaceSVG : function ( a ) { var b = a . attr ( " id " ) , c = a . attr ( " class " ) , d = a . attr ( " src " ) ; $ . get ( d , function ( d ) { var e = $ ( d ) . find ( " svg " ) ; void 0 = = = b & & ( e = e . attr ( " id " , b ) ) , void 0 = = = c & & ( e = e . attr ( " class " , c + " replaced - svg " ) ) , e = e . removeAttr ( " xmlns : a " ) , a . replaceWith ( e ) } , " xml " ) } , render : function ( ) { var a = this ; return $ ( this . el ) . html ( this . template . render ( { isSystem : this . currentDB . get ( " isSystem " ) } ) ) , $ ( " img . svg " ) . each ( function ( ) { a . replaceSVG ( $ ( this ) ) } ) , this } , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement , c = b . id ; return " links " = = = c ? ( $ ( " # link_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : " tools " = = = c ? ( $ ( " # tools_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , handleSelectNavigation : function ( ) { $ ( " # arangoCollectionSelect " ) . change ( function ( ) { var a = $ ( this ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } ) } , selectMenuItem : function ( a ) { $ ( " . navlist li " ) . removeClass ( " active " ) , a & & $ ( " . " + a ) . addClass ( " active " ) } } ) } ( ) , function ( ) { " use strict " ; window . TableView = Backbone . View . extend ( { template : templateEngine . createTemplate ( " tableView . ejs " ) , loading : templateEngine . createTemplate ( " loadingTableView . ejs " ) , initialize : function ( a ) { this . rowClickCallback = a . rowClick } , events : { " click . pure - table - body . pure - table - row " : " rowClick " , " click . deleteButton " : " removeClick " } , rowClick : function ( a ) { this . hasOwnProperty ( " rowClickCallback " ) & & this . rowClickCallback ( a ) } , removeClick : function ( a ) { this . hasOwnProperty ( " removeClickCallback " ) & & ( this . removeClickCallback ( a ) , a . stopPropagation ( ) ) } , setRowClick : function ( a ) { this . rowClickCallback = a } , setRemoveClick : function ( a ) { this . removeClickCallback = a } , render : function ( ) { $ ( this . el ) . html ( this . template . render ( { docs : this . collection } ) ) } , drawLoading : function ( ) { $ ( this . el ) . html ( this . loading . render ( { } ) ) } } ) } ( ) , function ( ) { " use strict " ; window . testView = Backbone . View . extend ( { el : " # content " , graph : { edges : [ ] , nodes : [ ] } , events : { } , initialize : function ( ) { console . log ( void 0 ) } , template : templateEngine . createTemplate ( " testView . ejs " ) , render : function ( ) { return $ ( this . el ) . html ( this . template . render ( { } ) ) , this . renderGraph ( ) , this } , renderGraph : function ( ) { this . convertData ( ) , console . log ( this . graph ) , this . s = new sigma ( { graph : this . graph , container : " graph - container " , verbose : ! 0 , renderers : [ { container : document . getElementById ( " graph - container " ) , type : " webgl " } ] } ) } , convertData : function ( ) { var a = this ; return _ . each ( this . dump , function ( b ) { _ . each ( b . p , function ( c ) { a . graph . nodes . push ( { id : c . verticesvalue . v . _id , label : b . v . _key , x : Math . random ( ) , y : Math . random ( ) , size : Math . random ( ) } ) , a . graph . edges . push ( { id : b . e . _id , source : b . e . _from , target : b . e . _to } ) } ) } ) , null } , dump : [ { v : { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } ] } } , { v : { label : " 8 " , _id : " circles / H " , _rev : " 1841664067459 " , _key : " H " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_blob " , _id : " edges / 1841666295683 " , _rev : " 1841666295683 " , _key : " 1841666295683 " , _from : " circles / G " , _to : " circles / H " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 8 " , _id : " circles / H " , _rev : " 1841664067459 " , _key : " H " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_blob " , _id : " edges / 1841666295683 " , _rev : " 1841666295683 " , _key : " 1841666295683 " , _from : " circles / G " , _to : " circles / H " } ] } } , { v : { label : " 9 " , _id : " circles / I " , _rev : " 1841664264067 " , _key : " I " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_blub " , _id : " edges / 1841666492291 " , _rev : " 1841666492291 " , _key : " 1841666492291 " , _from : " circles / H " , _to : " circles / I " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 8 " , _id : " circles / H " , _rev : " 1841664067459 " , _key : " H " } , { label : " 9 " , _id : " circles / I " , _rev : " 1841664264067 " , _key : " I " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_blob " , _id : " edges / 1841666295683 " , _rev : " 1841666295683 " , _key : " 1841666295683 " , _from : " circles / G " , _to : " circles / H " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_blub " , _id : " edges / 1841666492291 " , _rev : " 1841666492291 " , _key : " 1841666492291 " , _from : " circles / H " , _to : " circles / I " } ] } } , { v : { label : " 10 " , _id : " circles / J " , _rev : " 1841664460675 " , _key : " J " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_zip " , _id : " edges / 1841666688899 " , _rev : " 1841666688899 " , _key : " 1841666688899 " , _from : " circles / G " , _to : " circles / J " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 10 " , _id : " circles / J " , _rev : " 1841664460675 " , _key : " J " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_zip " , _id : " edges / 1841666688899 " , _rev : " 1841666688899 " , _key : " 1841666688899 " , _from : " circles / G " , _to : " circles / J " } ] } } , { v : { label : " 11 " , _id : " circles / K " , _rev : " 1841664657283 " , _key : " K " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " right_zup " , _id : " edges / 1841666885507 " , _rev : " 1841666885507 " , _key : " 1841666885507 " , _from : " circles / J " , _to : " circles / K " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 7 " , _id : " circles / G " , _rev : " 1841663870851 " , _key : " G " } , { label : " 10 " , _id : " circles / J " , _rev : " 1841664460675 " , _key : " J " } , { label : " 11 " , _id : " circles / K " , _rev : " 1841664657283 " , _key : " K " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " right_foo " , _id : " edges / 1841666099075 " , _rev : " 1841666099075 " , _key : " 1841666099075 " , _from : " circles / A " , _to : " circles / G " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_zip " , _id : " edges / 1841666688899 " , _rev : " 1841666688899 " , _key : " 1841666688899 " , _from : " circles / G " , _to : " circles / J " } , { theFalse : ! 1 , theTruth : ! 0 , label : " right_zup " , _id : " edges / 1841666885507 " , _rev : " 1841666885507 " , _key : " 1841666885507 " , _from : " circles / J " , _to : " circles / K " } ] } } , { v : { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } ] } } , { v : { label : " 5 " , _id : " circles / E " , _rev : " 1841663477635 " , _key : " E " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_blub " , _id : " edges / 1841665705859 " , _rev : " 1841665705859 " , _key : " 1841665705859 " , _from : " circles / B " , _to : " circles / E " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 5 " , _id : " circles / E " , _rev : " 1841663477635 " , _key : " E " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blub " , _id : " edges / 1841665705859 " , _rev : " 1841665705859 " , _key : " 1841665705859 " , _from : " circles / B " , _to : " circles / E " } ] } } , { v : { label : " 6 " , _id : " circles / F " , _rev : " 1841663674243 " , _key : " F " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_schubi " , _id : " edges / 1841665902467 " , _rev : " 1841665902467 " , _key : " 1841665902467 " , _from : " circles / E " , _to : " circles / F " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 5 " , _id : " circles / E " , _rev : " 1841663477635 " , _key : " E " } , { label : " 6 " , _id : " circles / F " , _rev : " 1841663674243 " , _key : " F " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blub " , _id : " edges / 1841665705859 " , _rev : " 1841665705859 " , _key : " 1841665705859 " , _from : " circles / B " , _to : " circles / E " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_schubi " , _id : " edges / 1841665902467 " , _rev : " 1841665902467 " , _key : " 1841665902467 " , _from : " circles / E " , _to : " circles / F " } ] } } , { v : { label : " 3 " , _id : " circles / C " , _rev : " 1841663084419 " , _key : " C " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_blarg " , _id : " edges / 1841665312643 " , _rev : " 1841665312643 " , _key : " 1841665312643 " , _from : " circles / B " , _to : " circles / C " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 3 " , _id : " circles / C " , _rev : " 1841663084419 " , _key : " C " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blarg " , _id : " edges / 1841665312643 " , _rev : " 1841665312643 " , _key : " 1841665312643 " , _from : " circles / B " , _to : " circles / C " } ] } } , { v : { label : " 4 " , _id : " circles / D " , _rev : " 1841663281027 " , _key : " D " } , e : { theFalse : ! 1 , theTruth : ! 0 , label : " left_blorg " , _id : " edges / 1841665509251 " , _rev : " 1841665509251 " , _key : " 1841665509251 " , _from : " circles / C " , _to : " circles / D " } , p : { vertices : [ { label : " 1 " , _id : " circles / A " , _rev : " 1841662691203 " , _key : " A " } , { label : " 2 " , _id : " circles / B " , _rev : " 1841662887811 " , _key : " B " } , { label : " 3 " , _id : " circles / C " , _rev : " 1841663084419 " , _key : " C " } , { label : " 4 " , _id : " circles / D " , _rev : " 1841663281027 " , _key : " D " } ] , edges : [ { theFalse : ! 1 , theTruth : ! 0 , label : " left_bar " , _id : " edges / 1841665116035 " , _rev : " 1841665116035 " , _key : " 1841665116035 " , _from : " circles / A " , _to : " circles / B " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blarg " , _id : " edges / 1841665312643 " , _rev : " 1841665312643 " , _key : " 1841665312643 " , _from : " circles / B " , _to : " circles / C " } , { theFalse : ! 1 , theTruth : ! 0 , label : " left_blorg " , _id : " edges / 1841665509251 " , _rev : " 1841665509251 " , _key : " 1841665509251 " , _from : " circles / C " , _to : " circles / D " } ] } } ] } ) } ( ) , function ( ) { " use strict " ; window . UserBarView = Backbone . View . extend ( { events : { " change # userBarSelect " : " navigateBySelect " , " click . tab " : " navigateByTab " , " mouseenter . dropdown " : " showDropdown " , " mouseleave . dropdown " : " hideDropdown " , " click # userLogoutIcon " : " userLogout " , " click # userLogout " : " userLogout " } , initialize : function ( a ) { this . userCollection = a . userCollection , this . userCollection . fetch ( { async : ! 0 } ) , this . userCollection . bind ( " change : extra " , this . render . bind ( this ) ) } , template : templateEngine . createTemplate ( " userBarView . ejs " ) , navigateBySelect : function ( ) { var a = $ ( " # arangoCollectionSelect " ) . find ( " option : selected " ) . val ( ) ; window . App . navigate ( a , { trigger : ! 0 } ) } , navigateByTab : function ( a ) { var b = a . target | | a . srcElement ; b = $ ( b ) . closest ( " a " ) ; var c = b . attr ( " id " ) ; return " user " = = = c ? ( $ ( " # user_dropdown " ) . slideToggle ( 200 ) , void a . preventDefault ( ) ) : ( window . App . navigate ( c , { trigger : ! 0 } ) , void a . preventDefault ( ) ) } , toggleUserMenu : function ( ) { $ ( " # userBar . subBarDropdown " ) . toggle ( ) } , showDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeIn ( 1 ) } , hideDropdown : function ( ) { $ ( " # user_dropdown " ) . fadeOut ( 1 ) } , render : function ( ) { if ( frontendConfig . authenticationEnabled ! = = ! 1 ) { var a = this , b = function ( a , b ) { if ( a ) arangoHelper . arangoErro ( " User " , " Could not fetch user . " ) ; else { var c = null , d = null , e = ! 1 , f = null ; if ( b ! = = ! 1 ) return f = this . userCollection . findWhere ( { user : b } ) , f . set ( { loggedIn : ! 0 } ) , d = f . get ( " extra " ) . name , c = f . get ( " extra " ) . img , e = f . get ( " active " ) , c = c ? " https : / / s . gravatar . com / avatar / " + c + " ? s = 80 " : " img / default_user . png " , d | | ( d = " " ) , this . $ el = $ ( " # userBar " ) , this . $ el . html ( this . template . render ( { img : c , name : d , username : b , active : e } ) ) , this . delegateEvents ( ) , this . $ el } } . bind ( this ) ; $ ( " # userBar " ) . on ( " click " , function ( ) { a . toggleUserMenu ( ) } ) , this . userCollection . whoAmI ( b ) } } , userLogout : function ( ) { var a = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Logout error " ) : this . userCollection . logout ( ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } } ) } ( ) , function ( ) { " use strict " ; window . userManagementView = Backbone . View . extend ( { el : " # content " , el2 : " # userManagementThumbnailsIn " , template : templateEngine . createTemplate ( " userManagementView . ejs " ) , events : { " click # createUser " : " createUser " , " click # submitCreateUser " : " submitCreateUser " , " click # userManagementThumbnailsIn . tile " : " editUser " , " click # submitEditUser " : " submitEditUser " , " click # userManagementToggle " : " toggleView " , " keyup # userManagementSearchInput " : " search " , " click # userManagementSearchSubmit " : " search " , " click # callEditUserPassword " : " editUserPassword " , " click # submitEditUserPassword " : " submitEditUserPassword " , " click # submitEditCurrentUserProfile " : " submitEditCurrentUserProfile " , " click . css - label " : " checkBoxes " , " change # userSortDesc " : " sorting " } , dropdownVisible : ! 1 , initialize : function ( ) { var a = this , b = function ( a , b ) { frontendConfig . authenticationEnabled = = = ! 0 & & ( a | | null = = = b ? arangoHelper . arangoError ( " User " , " Could not fetch user data " ) : this . currentUser = this . collection . findWhere ( { user : b } ) ) } . bind ( this ) ; this . collection . fetch ( { success : function ( ) { a . collection . whoAmI ( b ) } } ) } , checkBoxes : function ( a ) { var b = a . currentTarget . id ; $ ( " # " + b ) . click ( ) } , sorting : function ( ) { $ ( " # userSortDesc " ) . is ( " : checked " ) ? this . collection . setSortingDesc ( ! 0 ) : this . collection . setSortingDesc ( ! 1 ) , $ ( " # userManagementDropdown " ) . is ( " : visible " ) ? this . dropdownVisible = ! 0 : this . dropdownVisible = ! 1 , this . render ( ) } , render : function ( a ) { var b = ! 1 ; return $ ( " # userManagementDropdown " ) . is ( " : visible " ) & & ( b = ! 0 ) , this . collection . sort ( ) , $ ( this . el ) . html ( this . template . render ( { collection : this . collection , searchString : " " } ) ) , b = = = ! 0 & & ( $ ( " # userManagementDropdown2 " ) . show ( ) , $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown " ) . show ( ) ) , a & & this . editCurrentUser ( ) , arangoHelper . setCheckboxStatus ( " # userManagementDropdown " ) , this } , search : function ( ) { var a , b , c , d ; a = $ ( " # userManagementSearchInput " ) , b = $ ( " # userManagementSearchInput " ) . val ( ) , d = this . collection . filter ( function ( a ) { return - 1 ! = = a . get ( " user " ) . indexOf ( b ) } ) , $ ( this . el ) . html ( this . template . render ( { collection : d , searchString : b } ) ) , a = $ ( " # userManagementSearchInput " ) , c = a . val ( ) . length , a . focus ( ) , a [ 0 ] . setSelectionRange ( c , c ) } , createUser : function ( a ) { a . preventDefault ( ) , this . createCreateUserModal ( ) } , submitCreateUser : function ( ) { var a = this , b = $ ( " # newUsername " ) . val ( ) , c = $ ( " # newName " ) . val ( ) , d = $ ( " # newPassword " ) . val ( ) , e = $ ( " # newStatus " ) . is ( " : checked " ) ; if ( this . validateUserInfo ( c , b , d , e ) ) { var f = { user : b , passwd : d , active : e , extra : { name : c } } ; this . collection . create ( f , { wait : ! 0 , error : function ( a , b ) { arangoHelper . parseError ( " User " , b , a ) } , success : function ( ) { a . updateUserManagement ( ) , window . modalView . hide ( ) } } ) } } , validateUserInfo : function ( a , b , c , d ) { return " " = = = b ? ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) : ! 0 } , updateUserManagement : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , submitDeleteUser : function ( a ) { var b = this . collection . findWhere ( { user : a } ) ; b . destroy ( { wait : ! 0 } ) , window . modalView . hide ( ) , this . updateUserManagement ( ) } , editUser : function ( a ) { if ( " createUser " ! = = $ ( a . currentTarget ) . find ( " a " ) . attr ( " id " ) ) { $ ( a . currentTarget ) . hasClass ( " tile " ) & & ( a . currentTarget = $ ( a . currentTarget ) . find ( " img " ) ) , this . collection . fetch ( ) ; var b = this . evaluateUserName ( $ ( a . currentTarget ) . attr ( " id " ) , " _edit - user " ) ; " " = = = b & & ( b = $ ( a . currentTarget ) . attr ( " id " ) ) ; var c = this . collection . findWhere ( { user : b } ) ; c . get ( " loggedIn " ) ? this . editCurrentUser ( ) : this . createEditUserModal ( c . get ( " user " ) , c . get ( " extra " ) . name , c . get ( " active " ) ) } } , editCurrentUser : function ( ) { this . createEditCurrentUserModal ( this . currentUser . get ( " user " ) , this . currentUser . get ( " extra " ) . name , this . currentUser . get ( " extra " ) . img ) } , submitEditUser : function ( a ) { var b = $ ( " # editName " ) . val ( ) , c = $ ( " # editStatus " ) . is ( " : checked " ) ; if ( ! this . validateStatus ( c ) ) return void $ ( " # editStatus " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; if ( ! this . validateName ( b ) ) return void $ ( " # editName " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) ; var d = this . collection . findWhere ( { user : a } ) ; d . save ( { extra : { name : b } , active : c } , { type : " PATCH " } ) , window . modalView . hide ( ) , this . updateUserManagement ( ) } , validateUsername : function ( a ) { return " " = = = a ? ( arangoHelper . arangoError ( " You have to define an username " ) , $ ( " # newUsername " ) . closest ( " th " ) . css ( " backgroundColor " , " red " ) , ! 1 ) : a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ \ - ] * $ / ) ? ! 0 : ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) } , validatePassword : function ( a ) { return ! 0 } , validateName : function ( a ) { return " " = = = a ? ! 0 : a . match ( / ^ [ a - zA - Z ] [ a - zA - Z0 - 9_ \ - \ ] * $ / ) ? ! 0 : ( arangoHelper . arangoError ( " Wrong Username " , " Username may only contain numbers , letters , _ and - " ) , ! 1 ) } , validateStatus : function ( a ) { return " " ! = = a } , toggleView : function ( ) { $ ( " # userSortDesc " ) . attr ( " checked " , this . collection . sortOptions . desc ) , $ ( " # userManagementToggle " ) . toggleClass ( " activated " ) , $ ( " # userManagementDropdown2 " ) . slideToggle ( 200 ) } , setFilterValues : function ( ) { } , evaluateUserName : function ( a , b ) { if ( a ) { var c = a . lastIndexOf ( b ) ; return a . substring ( 0 , c ) } } , editUserPassword : function ( ) { window . modalView . hide ( ) , this . createEditUserPasswordModal ( ) } , submitEditUserPassword : function ( ) { var a = $ ( " # oldCurrentPassword " ) . val ( ) , b = $ ( " # newCurrentPassword " ) . val ( ) , c = $ ( " # confirmCurrentPassword " ) . val ( ) ; $ ( " # oldCurrentPassword " ) . val ( " " ) , $ ( " # newCurrentPassword " ) . val ( " " ) , $ ( " # confirmCurrentPassword " ) . val ( " " ) , $ ( " # oldCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) , $ ( " # newCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) , $ ( " # confirmCurrentPassword " ) . closest ( " th " ) . css ( " backgroundColor " , " white " ) ; var d = ! 1 , e = function ( a , e ) { a ? arangoHelper . arangoError ( " User " , " Could not verify old password " ) : e & & ( b ! = = c & & ( arangoHelper . arangoError ( " User " , " New passwords do not match " ) , d = ! 0 ) , d | | ( this . currentUser . setPassword ( b ) , arangoHelper . arangoNotification ( " User " , " Password changed " ) , window . modalView . hide ( ) ) ) } . bind ( this ) ; this . currentUser . checkPassword ( a , e ) } , submitEditCurrentUserProfile : function ( ) { var a = $ ( " # editCurrentName " ) . val ( ) , b = $ ( " # editCurrentUserProfileImg " ) . val ( ) ; b = this . parseImgString ( b ) ; var c = function ( a ) { a ? arangoHelper . arangoError ( " User " , " Could not edit user settings " ) : ( arangoHelper . arangoNotification ( " User " , " Changes confirmed . " ) , this . updateUserProfile ( ) ) } . bind ( this ) ; this . currentUser . setExtras ( a , b , c ) , window . modalView . hide ( ) } , updateUserProfile : function ( ) { var a = this ; this . collection . fetch ( { success : function ( ) { a . render ( ) } } ) } , parseImgString : function ( a ) { return - 1 = = = a . indexOf ( " @ " ) ? a : CryptoJS . MD5 ( a ) . toString ( ) } , createEditUserModal : function ( a , b , c ) { var d , e ; e = [ { type : window . modalView . tables . READONLY , label : " Username " , value : _ . escape ( a ) } , { type : window . modalView . tables . TEXT , label : " Name " , value : b , id : " editName " , placeholder : " Name " } , { type : window . modalView . tables . CHECKBOX , label : " Active " , value : " active " , checked : c , id : " editStatus " } ] , d = [ { title : " Delete " , type : window . modalView . buttons . DELETE , callback : this . submitDeleteUser . bind ( this , a ) } , { title : " Save " , type : window . modalView . buttons . SUCCESS , callback : this . submitEditUser . bind ( this , a ) } ] , window . modalView . show ( " modalTable . ejs " , " Edit User " , d , e ) } , createCreateUserModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createTextEntry ( " newUsername " , " Username " , " " , ! 1 , " Username " , ! 0 , [ { rule : Joi . string ( ) . regex ( / ^ [ a - zA - Z0 - 9 \ - _ ] * $ / ) , msg : ' Only symbols , " _ " and " - " are allowed . ' } , { rule : Joi . string ( ) . required ( ) , msg : " No username given . " } ] ) ) , b . push ( window . modalView . createTextEntry ( " newName " , " Name " , " " , ! 1 , " Name " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " newPassword " , " Password " , " " , ! 1 , " " , ! 1 ) ) , b . push ( window . modalView . createCheckboxEntry ( " newStatus " , " Active " , " active " , ! 1 , ! 0 ) ) , a . push ( window . modalView . createSuccessButton ( " Create " , this . submitCreateUser . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Create New User " , a , b ) } , createEditCurrentUserModal : function ( a , b , c ) { var d = [ ] , e = [ ] ; e . push ( window . modalView . createReadOnlyEntry ( " id_username " , " Username " , a ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentName " , " Name " , b , ! 1 , " Name " , ! 1 ) ) , e . push ( window . modalView . createTextEntry ( " editCurrentUserProfileImg " , " Gravatar account ( Mail ) " , c , " Mailaddress or its md5 representation of your gravatar account . The address will be converted into a md5 string . Only the md5 string will be stored , not the mailaddress . " , " myAccount ( at ) gravatar . com " ) ) , d . push ( window . modalView . createNotificationButton ( " Change Password " , this . editUserPassword . bind ( this ) ) ) , d . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditCurrentUserProfile . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Profile " , d , e ) } , createEditUserPasswordModal : function ( ) { var a = [ ] , b = [ ] ; b . push ( window . modalView . createPasswordEntry ( " oldCurrentPassword " , " Old Password " , " " , ! 1 , " old password " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " newCurrentPassword " , " New Password " , " " , ! 1 , " new password " , ! 1 ) ) , b . push ( window . modalView . createPasswordEntry ( " confirmCurrentPassword " , " Confirm New Password " , " " , ! 1 , " confirm new password " , ! 1 ) ) , a . push ( window . modalView . createSuccessButton ( " Save " , this . submitEditUserPassword . bind ( this ) ) ) , window . modalView . show ( " modalTable . ejs " , " Edit User Password " , a , b ) } } ) } ( ) , function ( ) { " use strict " ; window . workMonitorView = Backbone . View . extend ( { el : " # content " , id : " # workMonitorContent " , template : templateEngine . createTemplate ( " workMonitorView . ejs " ) , table : templateEngine . createTemplate ( " arangoTable . ejs " ) , initialize : function ( ) { } , events : { } , tableDescription : { id : " workMonitorTable " , titles : [ " Type " , " Database " , " Task ID " , " Started " , " Url " , " User " , " Description " , " Method " ] , rows : [ ] , unescaped : [ ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 , ! 1 ] } , render : function ( ) { var a = this ; this . $ el . html ( this . template . render ( { } ) ) , this . collection . fetch ( { success : function ( ) { a . parseTableData ( ) , $ ( a . id ) . append ( a . table . render ( { content : a . tableDescription } ) ) } } ) } , parseTableData : function ( ) { var a = this ; this . collection . each ( function ( b ) { if ( " AQL query " = = = b . get ( " type " ) ) { var c = b . get ( " parent " ) ; if ( c ) try { a . tableDescription . rows . push ( [ b . get ( " type " ) , " ( p ) " + c . database , " ( p ) " + c . taskId , " ( p ) " + c . startTime , " ( p ) " + c . url , " ( p ) " + c . user , b . get ( " description " ) , " ( p ) " + c . method ] ) } catch ( d ) { console . log ( " some parse error " ) } } else " thread " ! = = b . get ( " type " ) & & a . tableDescription . rows . push ( [ b . get ( " type " ) , b . get ( " database " ) , b . get ( " taskId " ) , b . get ( " startTime " ) , b . get ( " url " ) , b . get ( " user " ) , b . get ( " description " ) , b . get ( " method " ) ] ) } ) } } ) } ( ) , function ( ) { " use strict " ; window . Router = Backbone . Router . extend ( { toUpdate : [ ] , dbServers : [ ] , isCluster : void 0 , routes : { " " : " cluster " , dashboard : " dashboard " , collections : " collections " , " new " : " newCollection " , login : " login " , " collection / : colid / documents / : pageid " : " documents " , " cIndices / : colname " : " cIndices " , " cSettings / : colname " : " cSettings " , " cInfo / : colname " : " cInfo " , " collection / : colid / : docid " : " document " , shell : " shell " , queries : " query " , workMonitor : " workMonitor " , databases : " databases " , settings : " databases " , services : " applications " , " service / : mount " : " applicationDetail " , graphs : " graphManagement " , " graphs / : name " : " showGraph " , users : " userManagement " , userProfile : " userProfile " , cluster : " cluster " , nodes : " cNodes " , cNodes : " cNodes " , dNodes : " dNodes " , sNodes : " sNodes " , " node / : name " : " node " , logs : " logs " , helpus : " helpUs " } , execute : function ( a , b ) { $ ( " # subNavigationBar . breadcrumb " ) . html ( " " ) , $ ( " # subNavigationBar . bottom " ) . html ( " " ) , $ ( " # loadingScreen " ) . hide ( ) , $ ( " # content " ) . show ( ) , a & & a . apply ( this , b ) } , checkUser : function ( ) { if ( " # login " ! = = window . location . hash ) { var a = function ( ) { this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) } . bind ( this ) , b = function ( b , c ) { frontendConfig . authenticationEnabled & & ( b | | null = = = c ) ? " # login " ! = = window . location . hash & & this . navigate ( " login " , { trigger : ! 0 } ) : a ( ) } . bind ( this ) ; frontendConfig . authenticationEnabled ? this . userCollection . whoAmI ( b ) : ( this . initOnce ( ) , $ ( " . bodyWrapper " ) . show ( ) , $ ( " . navbar " ) . show ( ) ) } } , waitForInit : function ( a , b , c ) { this . initFinished ? ( b | | a ( ! 0 ) , b & & ! c & & a ( b , ! 0 ) , b & & c & & a ( b , c , ! 0 ) ) : setTimeout ( function ( ) { b | | a ( ! 1 ) , b & & ! c & & a ( b , ! 1 ) , b & & c & & a ( b , c , ! 1 ) } , 350 ) } , initFinished : ! 1 , initialize : function ( ) { frontendConfig . isCluster = = = ! 0 & & ( this . isCluster = ! 0 ) , window . modalView = new window . ModalView , this . foxxList = new window . FoxxCollection , window . foxxInstallView = new window . FoxxInstallView ( { collection : this . foxxList } ) , window . progressView = new window . ProgressView ; var a = this ; this . userCollection = new window . ArangoUsers , this . initOnce = function ( ) { this . initOnce = function ( ) { } ; var b = function ( b , c ) { a = this , c = = = ! 0 & & a . coordinatorCollection . fetch ( { success : function ( ) { a . fetchDBS ( ) } } ) } . bind ( this ) ; window . isCoordinator ( b ) , frontendConfig . isCluster = = = ! 1 & & ( this . initFinished = ! 0 ) , this . arangoDatabase = new window . ArangoDatabase , this . currentDB = new window . CurrentDatabase , this . arangoCollectionsStore = new window . arangoCollections , this . arangoDocumentStore = new window . arangoDocument , this . coordinatorCollection = new window . ClusterCoordinators , arangoHelper . setDocumentStore ( this . arangoDocumentStore ) , this . arangoCollectionsStore . fetch ( ) , window . spotlightView = new window . SpotlightView ( { collection : this . arangoCollectionsStore } ) , this . footerView = new window . FooterView ( { collection : a . coordinatorCollection } ) , this . notificationList = new window . NotificationCollection , this . currentDB . fetch ( { success : function ( ) { a . naviView = new window . NavigationView ( { database : a . arangoDatabase , currentDB : a . currentDB , notificationCollection : a . notificationList , userCollection : a . userCollection , isCluster : a . isCluster } ) , a . naviView . render ( ) } } ) , this . queryCollection = new window . ArangoQueries , this . footerView . render ( ) , window . checkVersion ( ) } . bind ( this ) , $ ( window ) . resize ( function ( ) { a . handleResize ( ) } ) , $ ( window ) . scroll ( function ( ) { } ) } , handleScroll : function ( ) { $ ( window ) . scrollTop ( ) > 50 ? ( $ ( " . navbar > . secondary " ) . css ( " top " , $ ( window ) . scrollTop ( ) ) , $ ( " . navbar > . secondary " ) . css ( " position " , " absolute " ) , $ ( " . navbar > . secondary " ) . css ( " z - index " , " 10 " ) , $ ( " . navbar > . secondary " ) . css ( " width " , $ ( window ) . width ( ) ) ) : ( $ ( " . navbar > . secondary " ) . css ( " top " , " 0 " ) , $ ( " . navbar > . secondary " ) . css ( " position " , " relative " ) , $ ( " . navbar > . secondary " ) . css ( " width " , " " ) ) } , cluster : function ( a ) { return this . checkUser ( ) , a ? this . isCluster = = = ! 1 | | void 0 = = = this . isCluster ? void ( " _system " = = = this . currentDB . get ( " name " ) ? ( this . routes [ " " ] = " dashboard " , this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . routes [ " " ] = " collections " , this . navigate ( " # collections " , { trigger : ! 0 } ) ) ) : ( this . clusterView | | ( this . clusterView = new window . ClusterView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . clusterView . render ( ) ) : void this . waitForInit ( this . cluster . bind ( this ) ) } , node : function ( a , b ) { return this . checkUser ( ) , b & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodeView | | ( this . nodeView = new window . NodeView ( { coordname : a , coordinators : this . coordinatorCollection , dbServers : this . dbServers } ) ) , void this . nodeView . render ( ) ) : void this . waitForInit ( this . node . bind ( this ) , a ) } , cNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " coordinator " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . cNodes . bind ( this ) ) } , dNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : 0 = = = this . dbServers . length ? void this . navigate ( " # cNodes " , { trigger : ! 0 } ) : ( this . nodesView = new window . NodesView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] , toRender : " dbserver " } ) , void this . nodesView . render ( ) ) : void this . waitForInit ( this . dNodes . bind ( this ) ) } , sNodes : function ( a ) { return this . checkUser ( ) , a & & void 0 ! = = this . isCluster ? this . isCluster = = = ! 1 ? ( this . routes [ " " ] = " dashboard " , void this . navigate ( " # dashboard " , { trigger : ! 0 } ) ) : ( this . scaleView = new window . ScaleView ( { coordinators : this . coordinatorCollection , dbServers : this . dbServers [ 0 ] } ) , void this . scaleView . render ( ) ) : void this . waitForInit ( this . sNodes . bind ( this ) ) } , addAuth : function ( a ) { var b = this . clusterPlan . get ( " user " ) ; if ( ! b ) return a . abort ( ) , void ( this . isCheckingUser | | this . requestAuth ( ) ) ; var c = b . name , d = b . passwd , e = c . concat ( " : " , d ) ; a . setRequestHeader ( " Authorization " , " Basic " + btoa ( e ) ) } , logs : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . logs . bind ( this ) , a ) ; if ( ! this . logsView ) { var c = new window . ArangoLogs ( { upto : ! 0 , loglevel : 4 } ) , d = new window . ArangoLogs ( { loglevel : 4 } ) , e = new window . ArangoLogs ( { loglevel : 3 } ) , f = new window . ArangoLogs ( { loglevel : 2 } ) , g = new window . ArangoLogs ( { loglevel : 1 } ) ; this . logsView = new window . LogsView ( { logall : c , logdebug : d , loginfo : e , logwarning : f , logerror : g } ) } this . logsView . render ( ) } , applicationDetail : function ( a , b ) { if ( this . checkUser ( ) , ! b ) return void this . waitForInit ( this . applicationDetail . bind ( this ) , a ) ; var c = function ( ) { this . hasOwnProperty ( " applicationDetailView " ) | | ( this . applicationDetailView = new window . ApplicationDetailView ( { model : this . foxxList . get ( decodeURIComponent ( a ) ) } ) ) , this . applicationDetailView . model = this . foxxList . get ( decodeURIComponent ( a ) ) , this . applicationDetailView . render ( " swagger " ) } . bind ( this ) ; 0 = = = this . foxxList . length ? this . foxxList . fetch ( { success : function ( ) { c ( ) } } ) : c ( ) } , login : function ( ) { var a = function ( a , b ) { this . loginView | | ( this . loginView = new window . loginView ( { collection : this . userCollection } ) ) , a | | null = = = b ? this . loginView . render ( ) : this . loginView . render ( ! 0 ) } . bind ( this ) ; this . userCollection . whoAmI ( a ) } , collections : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . collections . bind ( this ) ) ; var b = this ; this . collectionsView | | ( this . collectionsView = new window . CollectionsView ( { collection : this . arangoCollectionsStore } ) ) , this . arangoCollectionsStore . fetch ( { success : function ( ) { b . collectionsView . render ( ) } } ) } , cIndices : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { success : function ( ) { c . indicesView = new window . IndicesView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . indicesView . render ( ) } } ) : void this . waitForInit ( this . cIndices . bind ( this ) , a ) } , cSettings : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { success : function ( ) { c . settingsView = new window . SettingsView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . settingsView . render ( ) } } ) : void this . waitForInit ( this . cSettings . bind ( this ) , a ) } , cInfo : function ( a , b ) { var c = this ; return this . checkUser ( ) , b ? void this . arangoCollectionsStore . fetch ( { success : function ( ) { c . infoView = new window . InfoView ( { collectionName : a , collection : c . arangoCollectionsStore . findWhere ( { name : a } ) } ) , c . infoView . render ( ) } } ) : void this . waitForInit ( this . cInfo . bind ( this ) , a ) } , documents : function ( a , b , c ) { return this . checkUser ( ) , c ? ( this . documentsView | | ( this . documentsView = new window . DocumentsView ( { collection : new window . arangoDocuments , documentStore : this . arangoDocumentStore , collectionsStore : this . arangoCollectionsStore } ) ) , this . documentsView . setCollectionId ( a , b ) , void this . documentsView . render ( ) ) : void this . waitForInit ( this . documents . bind ( this ) , a , b ) } , document : function ( a , b , c ) { if ( this . checkUser ( ) , ! c ) return void this . waitForInit ( this . document . bind ( this ) , a , b ) ; this . documentView | | ( this . documentView = new window . DocumentView ( { collection : this . arangoDocumentStore } ) ) , this . documentView . colid = a ; var d = window . location . hash . split ( " / " ) [ 2 ] , e = ( d . split ( " % " ) . length - 1 ) % 3 ; decodeURI ( d ) ! = = d & & 0 ! = = e & & ( d = decodeURIComponent ( d ) ) , this . documentView . docid = d , this . documentView . render ( ) ; var f = function ( a , b ) { a ? console . log ( " Error " , " Could not fetch collection type " ) : this . documentView . setType ( b ) } . bind ( this ) ; arangoHelper . collectionApiType ( a , null , f ) } , shell : function ( a ) { return this . checkUser ( ) , a ? ( this . shellView | | ( this . shellView = new window . shellView ) , void this . shellView . render ( ) ) : void this . waitForInit ( this . shell . bind ( this ) ) } , query : function ( a ) { return this . checkUser ( ) , a ? ( this . queryView2 | | ( this . queryView2 = new window . queryView2 ( { collection : this . queryCollection } ) ) , void this . queryView2 . render ( ) ) : void this . waitForInit ( this . query . bind ( this ) ) ; <nl> } , helpUs : function ( a ) { return this . checkUser ( ) , a ? ( this . testView | | ( this . helpUsView = new window . HelpUsView ( { } ) ) , void this . helpUsView . render ( ) ) : void this . waitForInit ( this . helpUs . bind ( this ) ) } , workMonitor : function ( a ) { return this . checkUser ( ) , a ? ( this . workMonitorCollection | | ( this . workMonitorCollection = new window . WorkMonitorCollection ) , this . workMonitorView | | ( this . workMonitorView = new window . workMonitorView ( { collection : this . workMonitorCollection } ) ) , void this . workMonitorView . render ( ) ) : void this . waitForInit ( this . workMonitor . bind ( this ) ) } , queryManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . queryManagementView | | ( this . queryManagementView = new window . queryManagementView ( { collection : void 0 } ) ) , void this . queryManagementView . render ( ) ) : void this . waitForInit ( this . queryManagement . bind ( this ) ) } , databases : function ( a ) { if ( this . checkUser ( ) , ! a ) return void this . waitForInit ( this . databases . bind ( this ) ) ; var b = function ( a ) { a ? ( arangoHelper . arangoError ( " DB " , " Could not get list of allowed databases " ) , this . navigate ( " # " , { trigger : ! 0 } ) , $ ( " # databaseNavi " ) . css ( " display " , " none " ) , $ ( " # databaseNaviSelect " ) . css ( " display " , " none " ) ) : ( this . databaseView | | ( this . databaseView = new window . databaseView ( { users : this . userCollection , collection : this . arangoDatabase } ) ) , this . databaseView . render ( ) ) } . bind ( this ) ; arangoHelper . databaseAllowed ( b ) } , dashboard : function ( a ) { return this . checkUser ( ) , a ? ( void 0 = = = this . dashboardView & & ( this . dashboardView = new window . DashboardView ( { dygraphConfig : window . dygraphConfig , database : this . arangoDatabase } ) ) , void this . dashboardView . render ( ) ) : void this . waitForInit ( this . dashboard . bind ( this ) ) } , graphManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . graphManagementView | | ( this . graphManagementView = new window . GraphManagementView ( { collection : new window . GraphCollection , collectionCollection : this . arangoCollectionsStore } ) ) , void this . graphManagementView . render ( ) ) : void this . waitForInit ( this . graphManagement . bind ( this ) ) } , showGraph : function ( a , b ) { return this . checkUser ( ) , b ? void ( this . graphManagementView ? this . graphManagementView . loadGraphViewer ( a ) : ( this . graphManagementView = new window . GraphManagementView ( { collection : new window . GraphCollection , collectionCollection : this . arangoCollectionsStore } ) , this . graphManagementView . render ( a , ! 0 ) ) ) : void this . waitForInit ( this . showGraph . bind ( this ) , a ) } , applications : function ( a ) { return this . checkUser ( ) , a ? ( void 0 = = = this . applicationsView & & ( this . applicationsView = new window . ApplicationsView ( { collection : this . foxxList } ) ) , void this . applicationsView . reload ( ) ) : void this . waitForInit ( this . applications . bind ( this ) ) } , handleSelectDatabase : function ( a ) { return this . checkUser ( ) , a ? void this . naviView . handleSelectDatabase ( ) : void this . waitForInit ( this . handleSelectDatabase . bind ( this ) ) } , handleResize : function ( ) { this . dashboardView & & this . dashboardView . resize ( ) , this . graphManagementView & & this . graphManagementView . handleResize ( $ ( " # content " ) . width ( ) ) , this . queryView & & this . queryView . resize ( ) , this . queryView2 & & this . queryView2 . resize ( ) , this . documentsView & & this . documentsView . resize ( ) , this . documentView & & this . documentView . resize ( ) } , userManagement : function ( a ) { return this . checkUser ( ) , a ? ( this . userManagementView | | ( this . userManagementView = new window . userManagementView ( { collection : this . userCollection } ) ) , void this . userManagementView . render ( ) ) : void this . waitForInit ( this . userManagement . bind ( this ) ) } , userProfile : function ( a ) { return this . checkUser ( ) , a ? ( this . userManagementView | | ( this . userManagementView = new window . userManagementView ( { collection : this . userCollection } ) ) , void this . userManagementView . render ( ! 0 ) ) : void this . waitForInit ( this . userProfile . bind ( this ) ) } , fetchDBS : function ( a ) { var b = this , c = ! 1 ; this . coordinatorCollection . each ( function ( a ) { b . dbServers . push ( new window . ClusterServers ( [ ] , { host : a . get ( " address " ) } ) ) } ) , this . initFinished = ! 0 , _ . each ( this . dbServers , function ( b ) { b . fetch ( { success : function ( ) { c = = = ! 1 & & a & & ( a ( ) , c = ! 0 ) } } ) } ) } , getNewRoute : function ( a ) { return " http : / / " + a } , registerForUpdate : function ( a ) { this . toUpdate . push ( a ) , a . updateUrl ( ) } } ) } ( ) , function ( ) { " use strict " ; var a = function ( a , b ) { var c = [ ] ; c . push ( window . modalView . createSuccessButton ( " Download Page " , function ( ) { window . open ( " https : / / www . arangodb . com / download " , " _blank " ) , window . modalView . hide ( ) } ) ) ; var d = [ ] , e = window . modalView . createReadOnlyEntry . bind ( window . modalView ) ; d . push ( e ( " current " , " Current " , a . toString ( ) ) ) , b . major & & d . push ( e ( " major " , " Major " , b . major . version ) ) , b . minor & & d . push ( e ( " minor " , " Minor " , b . minor . version ) ) , b . bugfix & & d . push ( e ( " bugfix " , " Bugfix " , b . bugfix . version ) ) , window . modalView . show ( " modalTable . ejs " , " New Version Available " , c , d ) } ; window . checkVersion = function ( ) { $ . ajax ( { type : " GET " , cache : ! 1 , url : arangoHelper . databaseUrl ( " / _api / version " ) , contentType : " application / json " , processData : ! 1 , async : ! 0 , success : function ( b ) { var c = window . versionHelper . fromString ( b . version ) ; $ ( " . navbar # currentVersion " ) . text ( " " + b . version . substr ( 0 , 3 ) ) , window . parseVersions = function ( b ) { return _ . isEmpty ( b ) ? void $ ( " # currentVersion " ) . addClass ( " up - to - date " ) : ( $ ( " # currentVersion " ) . addClass ( " out - of - date " ) , void $ ( " # currentVersion " ) . click ( function ( ) { a ( c , b ) } ) ) } , $ . ajax ( { type : " GET " , async : ! 0 , crossDomain : ! 0 , timeout : 3e3 , dataType : " jsonp " , url : " https : / / www . arangodb . com / repositories / versions . php ? jsonp = parseVersions & version = " + encodeURIComponent ( c . toString ( ) ) } ) } } ) } } ( ) , function ( ) { " use strict " ; window . hasOwnProperty ( " TEST_BUILD " ) | | ( $ ( document ) . ready ( function ( ) { window . App = new window . Router , Backbone . history . start ( ) , window . App . handleResize ( ) } ) , $ ( document ) . click ( function ( a ) { a . stopPropagation ( ) , $ ( a . target ) . hasClass ( " subBarDropdown " ) | | $ ( a . target ) . hasClass ( " dropdown - header " ) | | $ ( a . target ) . hasClass ( " dropdown - footer " ) | | $ ( a . target ) . hasClass ( " toggle " ) | | $ ( " # userInfo " ) . is ( " : visible " ) & & $ ( " . subBarDropdown " ) . hide ( ) } ) ) } ( ) ; <nl> \ No newline at end of file <nl> Binary files a / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js . gz and b / js / apps / system / _admin / aardvark / APP / frontend / build / app . min . js . gz differ <nl> mmm a / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html <nl> ppp b / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html <nl> < h4 > Info < / h4 > <nl> < / aside > - - > <nl> < / div > < / script > < script id = " applicationListView . ejs " type = " text / template " > < tr class = " foxx - store - row " > <nl> < td class = " foxx - store - main " > <nl> - < div class = " foxx - name " > < % = name % > < / div > <nl> + < div class = " foxx - name " > < % = name % > < % = legacy ? ' ( legacy ) ' : ' ' % > < / div > <nl> < div class = " foxx - author " > < % = author % > < / div > <nl> < div class = " foxx - description " > < % = description % > < / div > <nl> < / td > <nl> < h5 class = " collectionName " > < % = _ . escape ( username ) % > < % if ( name ! = = ' ' ) { % > ( < % <nl> < / div > <nl> <nl> < div id = " workMonitorContent " class = " innerContent " > <nl> - < / div > < / script > < / head > < body > < nav class = " navbar " style = " display : none " > < div class = " primary " > < div class = " navlogo " > < a class = " logo big " href = " # " > < img class = " arangodbLogo " src = " img / arangodb_logo_big . png " > < / a > < a class = " logo small " href = " # " > < img class = " arangodbLogo " src = " img / arangodb_logo_small . png " > < / a > < a class = " version " > < span > VERSION : < / span > < span id = " currentVersion " > < / span > < / a > < / div > < div class = " statmenu " id = " statisticBar " > < / div > < div class = " navmenu " id = " navigationBar " > < / div > < / div > < / nav > < div id = " modalPlaceholder " > < / div > < div class = " bodyWrapper " style = " display : none " > < div class = " centralRow " > < div id = " navbar2 " class = " navbarWrapper secondary " > < div class = " subnavmenu " id = " subNavigationBar " > < / div > < / div > < div class = " resizecontainer contentWrapper " > < div id = " loadingScreen " class = " loadingScreen " style = " display : none " > < i class = " fa fa - circle - o - notch fa - spin fa - 3x fa - fw margin - bottom " > < / i > < span class = " sr - only " > Loading . . . < / span > < / div > < div id = " content " class = " centralContent " > < / div > < footer class = " footer " > < div id = " footerBar " > < / div > < / footer > < / div > < / div > < / div > < div id = " progressPlaceholder " style = " display : none " > < / div > < div id = " spotlightPlaceholder " style = " display : none " > < / div > < div id = " offlinePlaceholder " style = " display : none " > < div class = " offline - div " > < div class = " pure - u " > < div class = " pure - u - 1 - 4 " > < / div > < div class = " pure - u - 1 - 2 offline - window " > < div class = " offline - header " > < h3 > You have been disconnected from the server < / h3 > < / div > < div class = " offline - body " > < p > The connection to the server has been lost . The server may be under heavy load . < / p > < p > Trying to reconnect in < span id = " offlineSeconds " > 10 < / span > seconds . < / p > < p class = " animation_state " > < span > < button class = " button - success " > Reconnect now < / button > < / span > < / p > < / div > < / div > < div class = " pure - u - 1 - 4 " > < / div > < / div > < / div > < / div > < div class = " arangoFrame " style = " " > < div class = " outerDiv " > < div class = " innerDiv " > < / div > < / div > < / div > < script src = " libs . js ? version = 1464264193103 " > < / script > < script src = " app . js ? version = 1464264193103 " > < / script > < / body > < / html > <nl> \ No newline at end of file <nl> + < / div > < / script > < / head > < body > < nav class = " navbar " style = " display : none " > < div class = " primary " > < div class = " navlogo " > < a class = " logo big " href = " # " > < img class = " arangodbLogo " src = " img / arangodb_logo_big . png " > < / a > < a class = " logo small " href = " # " > < img class = " arangodbLogo " src = " img / arangodb_logo_small . png " > < / a > < a class = " version " > < span > VERSION : < / span > < span id = " currentVersion " > < / span > < / a > < / div > < div class = " statmenu " id = " statisticBar " > < / div > < div class = " navmenu " id = " navigationBar " > < / div > < / div > < / nav > < div id = " modalPlaceholder " > < / div > < div class = " bodyWrapper " style = " display : none " > < div class = " centralRow " > < div id = " navbar2 " class = " navbarWrapper secondary " > < div class = " subnavmenu " id = " subNavigationBar " > < / div > < / div > < div class = " resizecontainer contentWrapper " > < div id = " loadingScreen " class = " loadingScreen " style = " display : none " > < i class = " fa fa - circle - o - notch fa - spin fa - 3x fa - fw margin - bottom " > < / i > < span class = " sr - only " > Loading . . . < / span > < / div > < div id = " content " class = " centralContent " > < / div > < footer class = " footer " > < div id = " footerBar " > < / div > < / footer > < / div > < / div > < / div > < div id = " progressPlaceholder " style = " display : none " > < / div > < div id = " spotlightPlaceholder " style = " display : none " > < / div > < div id = " offlinePlaceholder " style = " display : none " > < div class = " offline - div " > < div class = " pure - u " > < div class = " pure - u - 1 - 4 " > < / div > < div class = " pure - u - 1 - 2 offline - window " > < div class = " offline - header " > < h3 > You have been disconnected from the server < / h3 > < / div > < div class = " offline - body " > < p > The connection to the server has been lost . The server may be under heavy load . < / p > < p > Trying to reconnect in < span id = " offlineSeconds " > 10 < / span > seconds . < / p > < p class = " animation_state " > < span > < button class = " button - success " > Reconnect now < / button > < / span > < / p > < / div > < / div > < div class = " pure - u - 1 - 4 " > < / div > < / div > < / div > < / div > < div class = " arangoFrame " style = " " > < div class = " outerDiv " > < div class = " innerDiv " > < / div > < / div > < / div > < script src = " libs . js ? version = 1464698657958 " > < / script > < script src = " app . js ? version = 1464698657958 " > < / script > < / body > < / html > <nl> \ No newline at end of file <nl> Binary files a / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html . gz and b / js / apps / system / _admin / aardvark / APP / frontend / build / index - min . html . gz differ <nl>
|
Rebuild aardvark
|
arangodb/arangodb
|
577c59581a0474625c81f64ec72a55e0fc86b927
|
2016-05-31T12:46:00Z
|
mmm a / src / she / alleg4 / alleg_surface . cpp <nl> ppp b / src / she / alleg4 / alleg_surface . cpp <nl> void Alleg4Surface : : drawRgbaSurface ( const Surface * src , int srcx , int srcy , int <nl> void Alleg4Surface : : drawRgbaSurface ( const Surface * src , const gfx : : Rect & srcRect , const gfx : : Rect & dstRect ) <nl> { <nl> ASSERT ( src ) ; <nl> - ASSERT ( static_cast < Alleg4Surface * > ( src ) - > m_bmp ) ; <nl> + ASSERT ( static_cast < const Alleg4Surface * > ( src ) - > m_bmp ) ; <nl> ASSERT ( static_cast < Alleg4Surface * > ( this ) - > m_bmp ) ; <nl> <nl> stretch_blit ( <nl>
|
gcc : Fix compilation error in alleg4 / alleg_surface . cpp
|
aseprite/aseprite
|
665d481a530380d52f777c1e0e6b5aaefd470538
|
2018-07-16T19:00:35Z
|
mmm a / tensorflow / compiler / tf2tensorrt / BUILD <nl> ppp b / tensorflow / compiler / tf2tensorrt / BUILD <nl> load ( <nl> " tf_proto_library " , <nl> ) <nl> load ( " @ local_config_tensorrt / / : build_defs . bzl " , " if_tensorrt " ) <nl> - <nl> - # Google - internal targets go here ( must be at the end ) . <nl> + # Placeholder for Google - internal load statements . <nl> <nl> tf_cuda_cc_test ( <nl> name = " tensorrt_test_cc " , <nl> mmm a / tensorflow / contrib / session_bundle / BUILD <nl> ppp b / tensorflow / contrib / session_bundle / BUILD <nl> tf_proto_library ( <nl> visibility = [ " / / visibility : public " ] , <nl> ) <nl> <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - # Google - internal targets go here ( must be at the end ) . <nl> + # Placeholder for Google - internal load statements . <nl> mmm a / tensorflow / core / BUILD <nl> ppp b / tensorflow / core / BUILD <nl> transitive_hdrs ( <nl> ] , <nl> ) <nl> <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - # Google - internal targets go here ( must be at the end ) . <nl> - <nl> + # Placeholder for Google - internal load statements . <nl> load ( " / / tensorflow : tensorflow . bzl " , " tf_portable_proto_library " ) <nl> <nl> genrule ( <nl> mmm a / tensorflow / core / kernels / BUILD <nl> ppp b / tensorflow / core / kernels / BUILD <nl> tf_kernel_library ( <nl> ] , <nl> ) <nl> <nl> - # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> - # Google - internal targets . These must be at the end for syncrepo . <nl> - <nl> # Library to link with when compiling the cwise_op kernels directly , <nl> # e . g . for selective registration . <nl> # should not be linked by projects that also link the cwise_op library . <nl> mmm a / tensorflow / python / kernel_tests / proto / BUILD <nl> ppp b / tensorflow / python / kernel_tests / proto / BUILD <nl> load ( " / / tensorflow : tensorflow . bzl " , " tf_cc_shared_object " ) <nl> load ( " / / tensorflow / core : platform / default / build_config_root . bzl " , " if_static " ) <nl> load ( " / / tensorflow / core : platform / default / build_config . bzl " , " tf_additional_all_protos " ) <nl> load ( " / / tensorflow / core : platform / default / build_config . bzl " , " tf_proto_library " ) <nl> - <nl> - # Google - internal targets go here ( must be at the end ) . <nl> + # Placeholder for Google - internal load statements . <nl> <nl> tf_py_test ( <nl> name = " decode_proto_op_test " , <nl>
|
Internal change .
|
tensorflow/tensorflow
|
f33aa592f92e233aeb00198d0caab80eaa89afe9
|
2019-05-15T14:00:23Z
|
mmm a / src / mongo / executor / network_interface . h <nl> ppp b / src / mongo / executor / network_interface . h <nl> class NetworkInterface { <nl> * Any callbacks invoked from setAlarm must observe onNetworkThread to <nl> * return true . See that method for why . <nl> * / <nl> - virtual Status setAlarm ( Date_t when , unique_function < void ( ) > action ) = 0 ; <nl> + virtual Status setAlarm ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> + Date_t when , <nl> + unique_function < void ( Status ) > action ) = 0 ; <nl> + <nl> + / * * <nl> + * Requests cancellation of the alarm associated with " cbHandle " if it has not yet completed . <nl> + * / <nl> + virtual void cancelAlarm ( const TaskExecutor : : CallbackHandle & cbHandle ) = 0 ; <nl> + <nl> + / * * <nl> + * Schedules the specified action to run as soon as possible on the network interface ' s <nl> + * execution resource <nl> + * / <nl> + virtual Status schedule ( unique_function < void ( Status ) > action ) = 0 ; <nl> <nl> / * * <nl> * Returns true if called from a thread dedicated to networking . I . e . not a <nl> mmm a / src / mongo / executor / network_interface_integration_test . cpp <nl> ppp b / src / mongo / executor / network_interface_integration_test . cpp <nl> TEST_F ( NetworkInterfaceTest , SetAlarm ) { <nl> Date_t expiration = net ( ) . now ( ) + Milliseconds ( 100 ) ; <nl> auto makeTimerFuture = [ & ] { <nl> auto pf = makePromiseFuture < Date_t > ( ) ; <nl> - return std : : make_pair ( [ this , promise = std : : move ( pf . promise ) ] ( ) mutable { <nl> - promise . emplaceValue ( net ( ) . now ( ) ) ; <nl> + return std : : make_pair ( [ this , promise = std : : move ( pf . promise ) ] ( Status status ) mutable { <nl> + if ( status . isOK ( ) ) { <nl> + promise . emplaceValue ( net ( ) . now ( ) ) ; <nl> + } else { <nl> + promise . setError ( status ) ; <nl> + } <nl> } , <nl> std : : move ( pf . future ) ) ; <nl> } ; <nl> <nl> auto futurePair = makeTimerFuture ( ) ; <nl> - ASSERT_OK ( net ( ) . setAlarm ( expiration , std : : move ( futurePair . first ) ) ) ; <nl> + ASSERT_OK ( net ( ) . setAlarm ( makeCallbackHandle ( ) , expiration , std : : move ( futurePair . first ) ) ) ; <nl> <nl> / / assert that it executed after " expiration " <nl> auto & result = futurePair . second . get ( ) ; <nl> TEST_F ( NetworkInterfaceTest , SetAlarm ) { <nl> <nl> expiration = net ( ) . now ( ) + Milliseconds ( 99999999 ) ; <nl> auto futurePair2 = makeTimerFuture ( ) ; <nl> - ASSERT_OK ( net ( ) . setAlarm ( expiration , std : : move ( futurePair2 . first ) ) ) ; <nl> + ASSERT_OK ( net ( ) . setAlarm ( makeCallbackHandle ( ) , expiration , std : : move ( futurePair2 . first ) ) ) ; <nl> <nl> net ( ) . shutdown ( ) ; <nl> - ASSERT_TRUE ( ! futurePair2 . second . isReady ( ) ) ; <nl> + auto swResult = futurePair2 . second . getNoThrow ( ) ; <nl> + ASSERT_FALSE ( swResult . isOK ( ) ) ; <nl> } <nl> <nl> TEST_F ( NetworkInterfaceTest , IsMasterRequestContainsOutgoingWireVersionInternalClientInfo ) { <nl> mmm a / src / mongo / executor / network_interface_mock . cpp <nl> ppp b / src / mongo / executor / network_interface_mock . cpp <nl> void NetworkInterfaceMock : : _interruptWithResponse_inlock ( <nl> } <nl> } <nl> <nl> - Status NetworkInterfaceMock : : setAlarm ( const Date_t when , unique_function < void ( ) > action ) { <nl> + Status NetworkInterfaceMock : : setAlarm ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> + const Date_t when , <nl> + unique_function < void ( Status ) > action ) { <nl> if ( inShutdown ( ) ) { <nl> return { ErrorCodes : : ShutdownInProgress , " NetworkInterfaceMock shutdown in progress " } ; <nl> } <nl> Status NetworkInterfaceMock : : setAlarm ( const Date_t when , unique_function < void ( ) > <nl> <nl> if ( when < = _now_inlock ( ) ) { <nl> lk . unlock ( ) ; <nl> - action ( ) ; <nl> + action ( Status : : OK ( ) ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> - _alarms . emplace ( when , std : : move ( action ) ) ; <nl> + _alarms . emplace ( cbHandle , when , std : : move ( action ) ) ; <nl> <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> + void NetworkInterfaceMock : : cancelAlarm ( const TaskExecutor : : CallbackHandle & cbHandle ) { <nl> + / / Alarms live in a priority queue , so removing them isn ' t worth it <nl> + / / Thus we add the handle to a map and check at fire time <nl> + _canceledAlarms . insert ( cbHandle ) ; <nl> + } <nl> + <nl> + Status NetworkInterfaceMock : : schedule ( unique_function < void ( Status ) > action ) { <nl> + / / Call the task immediately , we have no out - of - line executor <nl> + action ( Status : : OK ( ) ) ; <nl> + <nl> + / / Say we scheduled the task fine , because we ran it inline <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> bool NetworkInterfaceMock : : onNetworkThread ( ) { <nl> return _currentlyRunning = = kNetworkThread ; <nl> } <nl> void NetworkInterfaceMock : : _enqueueOperation_inlock ( <nl> ResponseStatus rs ( <nl> ErrorCodes : : NetworkInterfaceExceededTimeLimit , " Network timeout " , Milliseconds ( 0 ) ) ; <nl> std : : vector < NetworkOperationList * > queuesToCheck { & _unscheduled , & _blackHoled , & _scheduled } ; <nl> - _alarms . emplace ( _now_inlock ( ) + timeout , [ <nl> + _alarms . emplace ( cbh , _now_inlock ( ) + timeout , [ <nl> this , <nl> cbh = std : : move ( cbh ) , <nl> queuesToCheck = std : : move ( queuesToCheck ) , <nl> rs = std : : move ( rs ) <nl> - ] { _interruptWithResponse_inlock ( cbh , queuesToCheck , rs ) ; } ) ; <nl> + ] ( Status ) { _interruptWithResponse_inlock ( cbh , queuesToCheck , rs ) ; } ) ; <nl> } <nl> } <nl> <nl> void NetworkInterfaceMock : : signalWorkAvailable ( ) { <nl> <nl> void NetworkInterfaceMock : : _runReadyNetworkOperations_inlock ( stdx : : unique_lock < stdx : : mutex > * lk ) { <nl> while ( ! _alarms . empty ( ) & & _now_inlock ( ) > = _alarms . top ( ) . when ) { <nl> - auto fn = std : : move ( _alarms . top ( ) . action ) ; <nl> + auto & alarm = _alarms . top ( ) ; <nl> + <nl> + / / If the handle isn ' t cancelled , then run it <nl> + auto iter = _canceledAlarms . find ( alarm . handle ) ; <nl> + if ( iter = = _canceledAlarms . end ( ) ) { <nl> + lk - > unlock ( ) ; <nl> + alarm . action ( Status : : OK ( ) ) ; <nl> + lk - > lock ( ) ; <nl> + } else { <nl> + _canceledAlarms . erase ( iter ) ; <nl> + } <nl> + <nl> _alarms . pop ( ) ; <nl> - lk - > unlock ( ) ; <nl> - fn ( ) ; <nl> - lk - > lock ( ) ; <nl> } <nl> while ( ! _scheduled . empty ( ) & & _scheduled . front ( ) . getResponseDate ( ) < = _now_inlock ( ) ) { <nl> invariant ( _currentlyRunning = = kNetworkThread ) ; <nl> mmm a / src / mongo / executor / network_interface_mock . h <nl> ppp b / src / mongo / executor / network_interface_mock . h <nl> class NetworkInterfaceMock : public NetworkInterface { <nl> void cancelCommand ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> const BatonHandle & baton = nullptr ) override ; <nl> <nl> - / * * <nl> - * Not implemented . <nl> - * / <nl> - Status setAlarm ( Date_t when , unique_function < void ( ) > action ) override ; <nl> + Status setAlarm ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> + Date_t when , <nl> + unique_function < void ( Status ) > action ) override ; <nl> + <nl> + void cancelAlarm ( const TaskExecutor : : CallbackHandle & cbHandle ) override ; <nl> + <nl> + Status schedule ( unique_function < void ( Status ) > action ) override ; <nl> <nl> bool onNetworkThread ( ) override ; <nl> <nl> class NetworkInterfaceMock : public NetworkInterface { <nl> * Information describing a scheduled alarm . <nl> * / <nl> struct AlarmInfo { <nl> - using AlarmAction = unique_function < void ( ) > ; <nl> - AlarmInfo ( Date_t inWhen , AlarmAction inAction ) <nl> - : when ( inWhen ) , action ( std : : move ( inAction ) ) { } <nl> + using AlarmAction = unique_function < void ( Status ) > ; <nl> + AlarmInfo ( TaskExecutor : : CallbackHandle inHandle , Date_t inWhen , AlarmAction inAction ) <nl> + : handle ( inHandle ) , when ( inWhen ) , action ( std : : move ( inAction ) ) { } <nl> bool operator > ( const AlarmInfo & rhs ) const { <nl> return when > rhs . when ; <nl> } <nl> <nl> + TaskExecutor : : CallbackHandle handle ; <nl> Date_t when ; <nl> mutable AlarmAction action ; <nl> } ; <nl> class NetworkInterfaceMock : public NetworkInterface { <nl> / / Heap of alarms , with the next alarm always on top . <nl> std : : priority_queue < AlarmInfo , std : : vector < AlarmInfo > , std : : greater < AlarmInfo > > _alarms ; / / ( M ) <nl> <nl> + / / A set of CallbackHandles for canceled alarms <nl> + stdx : : unordered_set < TaskExecutor : : CallbackHandle > _canceledAlarms ; / / ( M ^ : ) <nl> + <nl> / / The connection hook . <nl> std : : unique_ptr < NetworkConnectionHook > _hook ; / / ( R ) <nl> <nl> class NetworkInterfaceMockClockSource : public ClockSource { <nl> return _net - > now ( ) ; <nl> } <nl> Status setAlarm ( Date_t when , unique_function < void ( ) > action ) override { <nl> - return _net - > setAlarm ( when , std : : move ( action ) ) ; <nl> + return _net - > setAlarm ( TaskExecutor : : CallbackHandle ( ) , <nl> + when , <nl> + [ action = std : : move ( action ) ] ( Status ) { action ( ) ; } ) ; <nl> } <nl> <nl> private : <nl> mmm a / src / mongo / executor / network_interface_mock_test . cpp <nl> ppp b / src / mongo / executor / network_interface_mock_test . cpp <nl> TEST_F ( NetworkInterfaceMockTest , ConnectionHookHandleReplyFails ) { <nl> ASSERT ( errorPropagated ) ; <nl> } <nl> <nl> + TEST_F ( NetworkInterfaceMockTest , SetAlarmFires ) { <nl> + startNetwork ( ) ; <nl> + <nl> + TaskExecutor : : CallbackHandle cb { } ; <nl> + bool alarmHasFired = false ; <nl> + <nl> + const auto deadline = net ( ) . now ( ) + Milliseconds ( 100 ) ; <nl> + ASSERT_OK ( net ( ) . setAlarm ( cb , deadline , [ & ] ( Status ) { alarmHasFired = true ; } ) ) ; <nl> + ASSERT_FALSE ( alarmHasFired ) ; <nl> + <nl> + { <nl> + executor : : NetworkInterfaceMock : : InNetworkGuard guard ( & net ( ) ) ; <nl> + <nl> + net ( ) . advanceTime ( deadline ) ; <nl> + ASSERT_TRUE ( alarmHasFired ) ; <nl> + } <nl> + } <nl> + <nl> + TEST_F ( NetworkInterfaceMockTest , SetAlarmCanceled ) { <nl> + startNetwork ( ) ; <nl> + <nl> + TaskExecutor : : CallbackHandle cb { } ; <nl> + bool alarmHasFired = false ; <nl> + <nl> + const auto deadline = net ( ) . now ( ) + Milliseconds ( 100 ) ; <nl> + ASSERT_OK ( net ( ) . setAlarm ( cb , deadline , [ & ] ( Status ) { alarmHasFired = true ; } ) ) ; <nl> + ASSERT_FALSE ( alarmHasFired ) ; <nl> + <nl> + net ( ) . cancelAlarm ( cb ) ; <nl> + <nl> + { <nl> + executor : : NetworkInterfaceMock : : InNetworkGuard guard ( & net ( ) ) ; <nl> + <nl> + net ( ) . advanceTime ( deadline ) ; <nl> + ASSERT_FALSE ( alarmHasFired ) ; <nl> + } <nl> + } <nl> + <nl> TEST_F ( NetworkInterfaceMockTest , InShutdown ) { <nl> startNetwork ( ) ; <nl> ASSERT_FALSE ( net ( ) . inShutdown ( ) ) ; <nl> TEST_F ( NetworkInterfaceMockTest , StartCommandReturnsNotOKIfShutdownHasStarted ) { <nl> TEST_F ( NetworkInterfaceMockTest , SetAlarmReturnsNotOKIfShutdownHasStarted ) { <nl> startNetwork ( ) ; <nl> tearDown ( ) ; <nl> - ASSERT_NOT_OK ( net ( ) . setAlarm ( net ( ) . now ( ) + Milliseconds ( 100 ) , [ ] { } ) ) ; <nl> + ASSERT_NOT_OK ( net ( ) . setAlarm ( <nl> + TaskExecutor : : CallbackHandle ( ) , net ( ) . now ( ) + Milliseconds ( 100 ) , [ ] ( Status ) { } ) ) ; <nl> } <nl> <nl> TEST_F ( NetworkInterfaceMockTest , CommandTimeout ) { <nl> mmm a / src / mongo / executor / network_interface_thread_pool . cpp <nl> ppp b / src / mongo / executor / network_interface_thread_pool . cpp <nl> namespace executor { <nl> NetworkInterfaceThreadPool : : NetworkInterfaceThreadPool ( NetworkInterface * net ) : _net ( net ) { } <nl> <nl> NetworkInterfaceThreadPool : : ~ NetworkInterfaceThreadPool ( ) { <nl> - DESTRUCTOR_GUARD ( dtorImpl ( ) ) ; <nl> + DESTRUCTOR_GUARD ( _dtorImpl ( ) ) ; <nl> } <nl> <nl> - void NetworkInterfaceThreadPool : : dtorImpl ( ) { <nl> + void NetworkInterfaceThreadPool : : _dtorImpl ( ) { <nl> { <nl> stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> <nl> void NetworkInterfaceThreadPool : : startup ( ) { <nl> } <nl> _started = true ; <nl> <nl> - consumeTasks ( std : : move ( lk ) ) ; <nl> + _consumeTasks ( std : : move ( lk ) ) ; <nl> } <nl> <nl> void NetworkInterfaceThreadPool : : shutdown ( ) { <nl> void NetworkInterfaceThreadPool : : join ( ) { <nl> _joining = true ; <nl> _started = true ; <nl> <nl> - consumeTasks ( std : : move ( lk ) ) ; <nl> + if ( _consumeState = = ConsumeState : : kNeutral ) <nl> + _consumeTasksInline ( std : : move ( lk ) ) ; <nl> } <nl> <nl> _net - > signalWorkAvailable ( ) ; <nl> <nl> stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> - _joiningCondition . wait ( lk , [ & ] { return _tasks . empty ( ) & & ( ! _consumingTasks ) ; } ) ; <nl> + _joiningCondition . wait ( <nl> + lk , [ & ] { return _tasks . empty ( ) & & ( _consumeState = = ConsumeState : : kNeutral ) ; } ) ; <nl> } <nl> <nl> Status NetworkInterfaceThreadPool : : schedule ( Task task ) { <nl> Status NetworkInterfaceThreadPool : : schedule ( Task task ) { <nl> _tasks . emplace_back ( std : : move ( task ) ) ; <nl> <nl> if ( _started ) <nl> - consumeTasks ( std : : move ( lk ) ) ; <nl> + _consumeTasks ( std : : move ( lk ) ) ; <nl> <nl> return Status : : OK ( ) ; <nl> } <nl> Status NetworkInterfaceThreadPool : : schedule ( Task task ) { <nl> / * * <nl> * Consumes available tasks . <nl> * <nl> - * We distinguish between calls to consume on the networking thread and off of <nl> - * it . For off thread calls , we try to initiate a consume via setAlarm , while on <nl> - * it we invoke directly . This allows us to use the network interface ' s threads <nl> - * as our own pool , which should reduce context switches if our tasks are <nl> - * getting scheduled by network interface tasks . <nl> + * We distinguish between calls to consume on the networking thread and off of it . For off thread <nl> + * calls , we try to initiate a consume via schedule and invoke directly inside the executor . This <nl> + * allows us to use the network interface ' s threads as our own pool , which should reduce context <nl> + * switches if our tasks are getting scheduled by network interface tasks . <nl> * / <nl> - void NetworkInterfaceThreadPool : : consumeTasks ( stdx : : unique_lock < stdx : : mutex > lk ) { <nl> - if ( _consumingTasks | | _tasks . empty ( ) ) <nl> + void NetworkInterfaceThreadPool : : _consumeTasks ( stdx : : unique_lock < stdx : : mutex > lk ) { <nl> + if ( ( _consumeState ! = ConsumeState : : kNeutral ) | | _tasks . empty ( ) ) <nl> return ; <nl> <nl> - if ( ! ( _inShutdown | | _net - > onNetworkThread ( ) ) ) { <nl> - if ( ! _registeredAlarm ) { <nl> - _registeredAlarm = true ; <nl> - lk . unlock ( ) ; <nl> - _net - > setAlarm ( _net - > now ( ) , <nl> - [ this ] { <nl> - stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> - _registeredAlarm = false ; <nl> - consumeTasks ( std : : move ( lk ) ) ; <nl> - } ) <nl> - . transitional_ignore ( ) ; <nl> - } <nl> - <nl> + auto shouldNotSchedule = _inShutdown | | _net - > onNetworkThread ( ) ; <nl> + if ( shouldNotSchedule ) { <nl> + _consumeTasksInline ( std : : move ( lk ) ) ; <nl> return ; <nl> } <nl> <nl> - _consumingTasks = true ; <nl> - const auto consumingTasksGuard = makeGuard ( [ & ] { _consumingTasks = false ; } ) ; <nl> + _consumeState = ConsumeState : : kScheduled ; <nl> + lk . unlock ( ) ; <nl> + auto ret = _net - > schedule ( [ this ] ( Status status ) { <nl> + stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> + <nl> + if ( _consumeState ! = ConsumeState : : kScheduled ) <nl> + return ; <nl> + _consumeTasksInline ( std : : move ( lk ) ) ; <nl> + } ) ; <nl> + invariant ( ret . isOK ( ) | | ErrorCodes : : isShutdownError ( ret . code ( ) ) ) ; <nl> + } <nl> + <nl> + void NetworkInterfaceThreadPool : : _consumeTasksInline ( stdx : : unique_lock < stdx : : mutex > lk ) { <nl> + _consumeState = ConsumeState : : kConsuming ; <nl> + const auto consumingTasksGuard = makeGuard ( [ & ] { _consumeState = ConsumeState : : kNeutral ; } ) ; <nl> <nl> decltype ( _tasks ) tasks ; <nl> <nl> mmm a / src / mongo / executor / network_interface_thread_pool . h <nl> ppp b / src / mongo / executor / network_interface_thread_pool . h <nl> class NetworkInterfaceThreadPool final : public ThreadPoolInterface { <nl> Status schedule ( Task task ) override ; <nl> <nl> private : <nl> - void consumeTasks ( stdx : : unique_lock < stdx : : mutex > lk ) ; <nl> - void dtorImpl ( ) ; <nl> + void _consumeTasks ( stdx : : unique_lock < stdx : : mutex > lk ) ; <nl> + void _consumeTasksInline ( stdx : : unique_lock < stdx : : mutex > lk ) ; <nl> + void _dtorImpl ( ) ; <nl> <nl> NetworkInterface * const _net ; <nl> <nl> class NetworkInterfaceThreadPool final : public ThreadPoolInterface { <nl> bool _started = false ; <nl> bool _inShutdown = false ; <nl> bool _joining = false ; <nl> - bool _registeredAlarm = false ; <nl> - bool _consumingTasks = false ; <nl> + <nl> + enum class ConsumeState { <nl> + kNeutral = 0 , <nl> + kScheduled , <nl> + kConsuming , <nl> + } ; <nl> + ConsumeState _consumeState = ConsumeState : : kNeutral ; <nl> } ; <nl> <nl> } / / namespace executor <nl> mmm a / src / mongo / executor / network_interface_tl . cpp <nl> ppp b / src / mongo / executor / network_interface_tl . cpp <nl> void NetworkInterfaceTL : : shutdown ( ) { <nl> / / Stop the reactor / thread first so that nothing runs on a partially dtor ' d pool . <nl> _reactor - > stop ( ) ; <nl> <nl> + _cancelAllAlarms ( ) ; <nl> + <nl> _ioThread . join ( ) ; <nl> } <nl> <nl> void NetworkInterfaceTL : : cancelCommand ( const TaskExecutor : : CallbackHandle & cbHan <nl> } <nl> } <nl> <nl> - Status NetworkInterfaceTL : : setAlarm ( Date_t when , unique_function < void ( ) > action ) { <nl> + Status NetworkInterfaceTL : : schedule ( unique_function < void ( Status ) > action ) { <nl> + if ( inShutdown ( ) ) { <nl> + return { ErrorCodes : : ShutdownInProgress , " NetworkInterface shutdown in progress " } ; <nl> + } <nl> + <nl> + _reactor - > schedule ( [ action = std : : move ( action ) ] ( ) { action ( Status : : OK ( ) ) ; } ) ; <nl> + return Status : : OK ( ) ; <nl> + } <nl> + <nl> + Status NetworkInterfaceTL : : setAlarm ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> + Date_t when , <nl> + unique_function < void ( Status ) > action ) { <nl> if ( inShutdown ( ) ) { <nl> return { ErrorCodes : : ShutdownInProgress , " NetworkInterface shutdown in progress " } ; <nl> } <nl> <nl> if ( when < = now ( ) ) { <nl> - _reactor - > schedule ( std : : move ( action ) ) ; <nl> + _reactor - > schedule ( [ action = std : : move ( action ) ] ( ) - > void { action ( Status : : OK ( ) ) ; } ) ; <nl> return Status : : OK ( ) ; <nl> } <nl> <nl> - std : : shared_ptr < transport : : ReactorTimer > alarmTimer = _reactor - > makeTimer ( ) ; <nl> - std : : weak_ptr < transport : : ReactorTimer > weakTimer = alarmTimer ; <nl> + auto pf = makePromiseFuture < void > ( ) ; <nl> + std : : move ( pf . future ) . getAsync ( std : : move ( action ) ) ; <nl> + <nl> + auto alarmState = <nl> + std : : make_shared < AlarmState > ( when , cbHandle , _reactor - > makeTimer ( ) , std : : move ( pf . promise ) ) ; <nl> + <nl> { <nl> - / / We do this so that the lifetime of the alarmTimers is the lifetime of the NITL . <nl> stdx : : lock_guard < stdx : : mutex > lk ( _inProgressMutex ) ; <nl> - _inProgressAlarms . insert ( alarmTimer ) ; <nl> + <nl> + / / If a user has already scheduled an alarm with a handle , make sure they intentionally <nl> + / / override it by canceling and setting a new one . <nl> + auto alarmPair = std : : make_pair ( cbHandle , std : : shared_ptr < AlarmState > ( alarmState ) ) ; <nl> + auto & & [ _ , wasInserted ] = _inProgressAlarms . insert ( std : : move ( alarmPair ) ) ; <nl> + invariant ( wasInserted ) ; <nl> } <nl> <nl> - alarmTimer - > waitUntil ( when , nullptr ) <nl> - . getAsync ( [ this , weakTimer , action = std : : move ( action ) , when ] ( Status status ) mutable { <nl> - auto alarmTimer = weakTimer . lock ( ) ; <nl> - if ( ! alarmTimer ) { <nl> - return ; <nl> - } else { <nl> - stdx : : lock_guard < stdx : : mutex > lk ( _inProgressMutex ) ; <nl> - _inProgressAlarms . erase ( alarmTimer ) ; <nl> - } <nl> + alarmState - > timer - > waitUntil ( alarmState - > when , nullptr ) . getAsync ( [ <nl> + this , <nl> + state = std : : move ( alarmState ) <nl> + ] ( Status status ) mutable { _answerAlarm ( status , state ) ; } ) ; <nl> <nl> - auto nowVal = now ( ) ; <nl> - if ( nowVal < when ) { <nl> - warning ( ) < < " Alarm returned early . Expected at : " < < when <nl> - < < " , fired at : " < < nowVal ; <nl> - if ( const auto alarmStatus = setAlarm ( when , std : : move ( action ) ) ; <nl> - ( ! alarmStatus . isOK ( ) ) & & ( alarmStatus ! = ErrorCodes : : ShutdownInProgress ) ) { <nl> - fassertFailedWithStatus ( 50785 , alarmStatus ) ; <nl> - } <nl> + return Status : : OK ( ) ; <nl> + } <nl> <nl> - return ; <nl> - } <nl> + void NetworkInterfaceTL : : cancelAlarm ( const TaskExecutor : : CallbackHandle & cbHandle ) { <nl> + stdx : : unique_lock < stdx : : mutex > lk ( _inProgressMutex ) ; <nl> <nl> - if ( status . isOK ( ) ) { <nl> - _reactor - > schedule ( std : : move ( action ) ) ; <nl> - } else if ( status ! = ErrorCodes : : CallbackCanceled ) { <nl> - warning ( ) < < " setAlarm ( ) received an error : " < < status ; <nl> - } <nl> - } ) ; <nl> - return Status : : OK ( ) ; <nl> + auto iter = _inProgressAlarms . find ( cbHandle ) ; <nl> + <nl> + if ( iter = = _inProgressAlarms . end ( ) ) { <nl> + return ; <nl> + } <nl> + <nl> + auto alarmState = std : : move ( iter - > second ) ; <nl> + <nl> + _inProgressAlarms . erase ( iter ) ; <nl> + <nl> + lk . unlock ( ) ; <nl> + <nl> + alarmState - > timer - > cancel ( ) ; <nl> + alarmState - > promise . setError ( Status ( ErrorCodes : : CallbackCanceled , " Alarm cancelled " ) ) ; <nl> + } <nl> + <nl> + void NetworkInterfaceTL : : _cancelAllAlarms ( ) { <nl> + auto alarms = [ & ] { <nl> + stdx : : unique_lock < stdx : : mutex > lk ( _inProgressMutex ) ; <nl> + return std : : exchange ( _inProgressAlarms , { } ) ; <nl> + } ( ) ; <nl> + <nl> + for ( auto & & [ cbHandle , state ] : alarms ) { <nl> + state - > timer - > cancel ( ) ; <nl> + state - > promise . setError ( Status ( ErrorCodes : : CallbackCanceled , " Alarm cancelled " ) ) ; <nl> + } <nl> + } <nl> + <nl> + void NetworkInterfaceTL : : _answerAlarm ( Status status , std : : shared_ptr < AlarmState > state ) { <nl> + / / Since the lock is released before canceling the timer , this thread can win the race with <nl> + / / cancelAlarm ( ) . Thus if status is CallbackCanceled , then this alarm is already removed from <nl> + / / _inProgressAlarms . <nl> + if ( status = = ErrorCodes : : CallbackCanceled ) { <nl> + return ; <nl> + } <nl> + <nl> + / / transport : : Reactor timers do not involve spurious wake ups , however , this check is nearly <nl> + / / free and allows us to be resilient to a world where timers impls do have spurious wake ups . <nl> + auto currentTime = now ( ) ; <nl> + if ( status . isOK ( ) & & currentTime < state - > when ) { <nl> + LOG ( 2 ) < < " Alarm returned early . Expected at : " < < state - > when <nl> + < < " , fired at : " < < currentTime ; <nl> + state - > timer - > waitUntil ( state - > when , nullptr ) . getAsync ( [ <nl> + this , <nl> + state = std : : move ( state ) <nl> + ] ( Status status ) mutable { _answerAlarm ( status , state ) ; } ) ; <nl> + return ; <nl> + } <nl> + <nl> + / / Erase the AlarmState from the map . <nl> + { <nl> + stdx : : lock_guard < stdx : : mutex > lk ( _inProgressMutex ) ; <nl> + <nl> + auto iter = _inProgressAlarms . find ( state - > cbHandle ) ; <nl> + if ( iter = = _inProgressAlarms . end ( ) ) { <nl> + return ; <nl> + } <nl> + <nl> + _inProgressAlarms . erase ( iter ) ; <nl> + } <nl> + <nl> + / / A not OK status here means the timer experienced a system error . <nl> + / / It is not reasonable to complete the promise on a reactor thread because there is likely no <nl> + / / properly functioning reactor . <nl> + if ( ! status . isOK ( ) ) { <nl> + state - > promise . setError ( status ) ; <nl> + return ; <nl> + } <nl> + <nl> + / / Fulfill the promise on a reactor thread <nl> + _reactor - > schedule ( [ state = std : : move ( state ) ] ( ) { state - > promise . emplaceValue ( ) ; } ) ; <nl> } <nl> <nl> bool NetworkInterfaceTL : : onNetworkThread ( ) { <nl> mmm a / src / mongo / executor / network_interface_tl . h <nl> ppp b / src / mongo / executor / network_interface_tl . h <nl> class NetworkInterfaceTL : public NetworkInterface { <nl> <nl> void cancelCommand ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> const BatonHandle & baton ) override ; <nl> - Status setAlarm ( Date_t when , unique_function < void ( ) > action ) override ; <nl> + Status setAlarm ( const TaskExecutor : : CallbackHandle & cbHandle , <nl> + Date_t when , <nl> + unique_function < void ( Status ) > action ) override ; <nl> + <nl> + Status schedule ( unique_function < void ( Status ) > action ) override ; <nl> + <nl> + void cancelAlarm ( const TaskExecutor : : CallbackHandle & cbHandle ) override ; <nl> <nl> bool onNetworkThread ( ) override ; <nl> <nl> class NetworkInterfaceTL : public NetworkInterface { <nl> Promise < RemoteCommandResponse > promise ; <nl> } ; <nl> <nl> + struct AlarmState { <nl> + AlarmState ( Date_t when_ , <nl> + TaskExecutor : : CallbackHandle cbHandle_ , <nl> + std : : unique_ptr < transport : : ReactorTimer > timer_ , <nl> + Promise < void > promise_ ) <nl> + : cbHandle ( std : : move ( cbHandle_ ) ) , <nl> + when ( when_ ) , <nl> + timer ( std : : move ( timer_ ) ) , <nl> + promise ( std : : move ( promise_ ) ) { } <nl> + <nl> + TaskExecutor : : CallbackHandle cbHandle ; <nl> + Date_t when ; <nl> + std : : unique_ptr < transport : : ReactorTimer > timer ; <nl> + <nl> + Promise < void > promise ; <nl> + } ; <nl> + <nl> + void _cancelAllAlarms ( ) ; <nl> + void _answerAlarm ( Status status , std : : shared_ptr < AlarmState > state ) ; <nl> + <nl> void _run ( ) ; <nl> void _eraseInUseConn ( const TaskExecutor : : CallbackHandle & handle ) ; <nl> Future < RemoteCommandResponse > _onAcquireConn ( std : : shared_ptr < CommandState > state , <nl> class NetworkInterfaceTL : public NetworkInterface { <nl> <nl> stdx : : mutex _inProgressMutex ; <nl> stdx : : unordered_map < TaskExecutor : : CallbackHandle , std : : shared_ptr < CommandState > > _inProgress ; <nl> - stdx : : unordered_set < std : : shared_ptr < transport : : ReactorTimer > > _inProgressAlarms ; <nl> + stdx : : unordered_map < TaskExecutor : : CallbackHandle , std : : shared_ptr < AlarmState > > <nl> + _inProgressAlarms ; <nl> <nl> stdx : : condition_variable _workReadyCond ; <nl> bool _isExecutorRunnable = false ; <nl> mmm a / src / mongo / executor / thread_pool_task_executor . cpp <nl> ppp b / src / mongo / executor / thread_pool_task_executor . cpp <nl> class ThreadPoolTaskExecutor : : CallbackState : public TaskExecutor : : CallbackState <nl> WorkQueue : : iterator iter ; <nl> Date_t readyDate ; <nl> bool isNetworkOperation = false ; <nl> + bool isTimerOperation = false ; <nl> AtomicWord < bool > isFinished { false } ; <nl> boost : : optional < stdx : : condition_variable > finishedCondition ; <nl> BatonHandle baton ; <nl> StatusWith < TaskExecutor : : CallbackHandle > ThreadPoolTaskExecutor : : scheduleWorkAt ( <nl> return scheduleWork ( std : : move ( work ) ) ; <nl> } <nl> auto wq = makeSingletonWorkQueue ( std : : move ( work ) , nullptr , when ) ; <nl> + wq . front ( ) - > isTimerOperation = true ; <nl> stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> auto cbHandle = enqueueCallbackState_inlock ( & _sleepersQueue , & wq ) ; <nl> if ( ! cbHandle . isOK ( ) ) { <nl> StatusWith < TaskExecutor : : CallbackHandle > ThreadPoolTaskExecutor : : scheduleWorkAt ( <nl> } <nl> lk . unlock ( ) ; <nl> <nl> - auto status = _net - > setAlarm ( when , [ this , cbHandle ] { <nl> - auto cbState = checked_cast < CallbackState * > ( getCallbackFromHandle ( cbHandle . getValue ( ) ) ) ; <nl> - if ( cbState - > canceled . load ( ) ) { <nl> - return ; <nl> - } <nl> - stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> - if ( cbState - > canceled . load ( ) ) { <nl> - return ; <nl> - } <nl> - scheduleIntoPool_inlock ( & _sleepersQueue , cbState - > iter , std : : move ( lk ) ) ; <nl> - } ) ; <nl> + auto status = _net - > setAlarm ( <nl> + cbHandle . getValue ( ) , when , [ this , cbHandle = cbHandle . getValue ( ) ] ( Status status ) { <nl> + if ( status = = ErrorCodes : : CallbackCanceled ) { <nl> + return ; <nl> + } <nl> + <nl> + auto cbState = checked_cast < CallbackState * > ( getCallbackFromHandle ( cbHandle ) ) ; <nl> + stdx : : unique_lock < stdx : : mutex > lk ( _mutex ) ; <nl> + if ( cbState - > canceled . load ( ) ) { <nl> + return ; <nl> + } <nl> + <nl> + scheduleIntoPool_inlock ( & _sleepersQueue , cbState - > iter , std : : move ( lk ) ) ; <nl> + } ) ; <nl> <nl> if ( ! status . isOK ( ) ) { <nl> cancel ( cbHandle . getValue ( ) ) ; <nl> void ThreadPoolTaskExecutor : : cancel ( const CallbackHandle & cbHandle ) { <nl> _net - > cancelCommand ( cbHandle , cbState - > baton ) ; <nl> return ; <nl> } <nl> + if ( cbState - > isTimerOperation ) { <nl> + lk . unlock ( ) ; <nl> + _net - > cancelAlarm ( cbHandle ) ; <nl> + lk . lock ( ) ; <nl> + } <nl> if ( cbState - > readyDate ! = Date_t { } ) { <nl> / / This callback might still be in the sleeper queue ; if it is , schedule it now <nl> / / rather than when the alarm fires . <nl>
|
SERVER - 39513 NetworkInterface : : setAlarm should be cancellable
|
mongodb/mongo
|
6403ca518b832a49d66352620a23606348595fac
|
2019-02-27T22:44:42Z
|
mmm a / framework / cybertron / class_loader / class_factory . h <nl> ppp b / framework / cybertron / class_loader / class_factory . h <nl> class ClassFactory : public AbstractClassFactory < Base > { <nl> Base * CreateObj ( ) const { return new ClassObject ; } <nl> } ; <nl> <nl> - } / / End namespace utility <nl> - } / / End namespace class_loader <nl> + } / / namespace utility <nl> + } / / namespace class_loader <nl> } / / namespace cybertron <nl> } / / namespace apollo <nl> <nl> mmm a / framework / cybertron / cybertron . h <nl> ppp b / framework / cybertron / cybertron . h <nl> std : : unique_ptr < Task < T > > CreateTask ( const std : : string & name , Function & & f , <nl> return std : : move ( task ) ; <nl> } <nl> <nl> + template < typename T , typename ReturnType , typename Function > <nl> + std : : unique_ptr < Task < T , ReturnType > > CreateTask ( <nl> + const std : : string & name , Function & & f , const uint8_t & num_threads = 1 ) { <nl> + if ( ! OK ( ) ) { <nl> + return nullptr ; <nl> + } <nl> + std : : unique_ptr < Task < T , ReturnType > > task ( <nl> + new Task < T , ReturnType > ( name , std : : forward < Function > ( f ) , num_threads ) ) ; <nl> + return std : : move ( task ) ; <nl> + } <nl> + <nl> inline static void Yield ( ) { <nl> if ( croutine : : CRoutine : : GetCurrentRoutine ( ) ) { <nl> croutine : : CRoutine : : Yield ( ) ; <nl> mmm a / framework / cybertron / test / other / init_cybertron_test . cpp <nl> ppp b / framework / cybertron / test / other / init_cybertron_test . cpp <nl> <nl> # include " cybertron / common / log . h " <nl> # include " cybertron / cybertron . h " <nl> # include " cybertron / init . h " <nl> + # include " cybertron / proto / driver . pb . h " <nl> + using apollo : : cybertron : : proto : : CarStatus ; <nl> <nl> namespace apollo { <nl> namespace cybertron { <nl> <nl> + void VoidTask ( ) { AINFO < < " VoidTask running " ; } <nl> + <nl> + int UserTask ( const std : : shared_ptr < CarStatus > & msg ) { <nl> + AINFO < < " receive msg " ; <nl> + return 0 ; <nl> + } <nl> + <nl> TEST ( InitCybertronTest , create_node ) { <nl> auto node = CreateNode ( " create_node " ) ; <nl> EXPECT_EQ ( node , nullptr ) ; <nl> TEST ( InitCybertronTest , all_in_one ) { <nl> Shutdown ( ) ; <nl> } <nl> <nl> + TEST ( InitCybertronTest , create_task ) { <nl> + auto task_ = apollo : : cybertron : : CreateTask < CarStatus , int > ( " task " , & UserTask ) ; <nl> + auto void_task_ = apollo : : cybertron : : CreateTask < > ( " void_task " , & VoidTask ) ; <nl> + } <nl> + <nl> } / / namespace cybertron <nl> } / / namespace apollo <nl> <nl>
|
framework : update CreateTask api
|
ApolloAuto/apollo
|
8175c7fbb7c66d36d22b9d8c398fd4b7c34c5837
|
2018-09-19T22:50:10Z
|
mmm a / BUILD . gn <nl> ppp b / BUILD . gn <nl> v8_source_set ( " v8_base " ) { <nl> " src / handles . h " , <nl> " src / hashmap . h " , <nl> " src / heap - symbols . h " , <nl> - " src / heap / array - buffer - tracker - inl . h " , <nl> " src / heap / array - buffer - tracker . cc " , <nl> " src / heap / array - buffer - tracker . h " , <nl> " src / heap / gc - idle - time - handler . cc " , <nl> mmm a / include / v8 . h <nl> ppp b / include / v8 . h <nl> class Internals { <nl> kAmountOfExternalAllocatedMemoryOffset + kApiInt64Size ; <nl> static const int kIsolateRootsOffset = <nl> kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset + kApiInt64Size + <nl> - kApiPointerSize + kApiPointerSize ; <nl> + kApiPointerSize ; <nl> static const int kUndefinedValueRootIndex = 4 ; <nl> static const int kTheHoleValueRootIndex = 5 ; <nl> static const int kNullValueRootIndex = 6 ; <nl> deleted file mode 100644 <nl> index 5a5be4938e8 . . 00000000000 <nl> mmm a / src / heap / array - buffer - tracker - inl . h <nl> ppp / dev / null <nl> <nl> - / / Copyright 2016 the V8 project authors . All rights reserved . <nl> - / / Use of this source code is governed by a BSD - style license that can be <nl> - / / found in the LICENSE file . <nl> - <nl> - # include " src / heap / array - buffer - tracker . h " <nl> - # include " src / heap / heap . h " <nl> - # include " src / heap / mark - compact . h " <nl> - # include " src / isolate . h " <nl> - <nl> - namespace v8 { <nl> - namespace internal { <nl> - <nl> - template < typename Callback > <nl> - void LocalArrayBufferTracker : : Process ( Callback callback ) { <nl> - JSArrayBuffer * new_buffer = nullptr ; <nl> - size_t freed_memory = 0 ; <nl> - for ( TrackingMap : : iterator it = live_ . begin ( ) ; it ! = live_ . end ( ) ; ) { <nl> - switch ( callback ( it - > first , & new_buffer ) ) { <nl> - case kKeepEntry : <nl> - it + + ; <nl> - break ; <nl> - case kKeepAndUpdateEntry : <nl> - DCHECK_NOT_NULL ( new_buffer ) ; <nl> - Page : : FromAddress ( new_buffer - > address ( ) ) <nl> - - > local_tracker < Page : : kCreateIfNotPresent > ( ) <nl> - - > AddLive ( new_buffer , it - > second ) ; <nl> - live_ . erase ( it + + ) ; <nl> - break ; <nl> - case kRemoveEntry : <nl> - heap_ - > isolate ( ) - > array_buffer_allocator ( ) - > Free ( it - > second . first , <nl> - it - > second . second ) ; <nl> - freed_memory + = it - > second . second ; <nl> - live_ . erase ( it + + ) ; <nl> - break ; <nl> - default : <nl> - UNREACHABLE ( ) ; <nl> - } <nl> - } <nl> - if ( freed_memory > 0 ) { <nl> - heap_ - > update_amount_of_external_allocated_freed_memory ( <nl> - static_cast < intptr_t > ( freed_memory ) ) ; <nl> - } <nl> - not_yet_discovered_ . clear ( ) ; <nl> - started_ = false ; <nl> - } <nl> - <nl> - template < LocalArrayBufferTracker : : LivenessIndicator liveness_indicator > <nl> - void LocalArrayBufferTracker : : ScanAndFreeDead ( ) { <nl> - switch ( liveness_indicator ) { <nl> - case kForwardingPointer : <nl> - Process ( [ ] ( JSArrayBuffer * old_buffer , JSArrayBuffer * * new_buffer ) { <nl> - MapWord map_word = old_buffer - > map_word ( ) ; <nl> - if ( map_word . IsForwardingAddress ( ) ) { <nl> - * new_buffer = JSArrayBuffer : : cast ( map_word . ToForwardingAddress ( ) ) ; <nl> - return LocalArrayBufferTracker : : kKeepAndUpdateEntry ; <nl> - } <nl> - return LocalArrayBufferTracker : : kRemoveEntry ; <nl> - } ) ; <nl> - break ; <nl> - case kMarkBit : <nl> - Process ( [ ] ( JSArrayBuffer * old_buffer , JSArrayBuffer * * ) { <nl> - if ( Marking : : IsBlackOrGrey ( Marking : : MarkBitFrom ( old_buffer ) ) ) { <nl> - return LocalArrayBufferTracker : : kKeepEntry ; <nl> - } <nl> - return LocalArrayBufferTracker : : kRemoveEntry ; <nl> - } ) ; <nl> - break ; <nl> - default : <nl> - UNREACHABLE ( ) ; <nl> - } <nl> - } <nl> - <nl> - } / / namespace internal <nl> - } / / namespace v8 <nl> mmm a / src / heap / array - buffer - tracker . cc <nl> ppp b / src / heap / array - buffer - tracker . cc <nl> <nl> / / found in the LICENSE file . <nl> <nl> # include " src / heap / array - buffer - tracker . h " <nl> - # include " src / heap / array - buffer - tracker - inl . h " <nl> # include " src / heap / heap . h " <nl> # include " src / isolate . h " <nl> - # include " src / objects - inl . h " <nl> # include " src / objects . h " <nl> + # include " src / objects - inl . h " <nl> # include " src / v8 . h " <nl> <nl> namespace v8 { <nl> namespace internal { <nl> <nl> - LocalArrayBufferTracker : : ~ LocalArrayBufferTracker ( ) { <nl> + ArrayBufferTracker : : ~ ArrayBufferTracker ( ) { <nl> + Isolate * isolate = heap ( ) - > isolate ( ) ; <nl> size_t freed_memory = 0 ; <nl> - for ( auto & buffer : live_ ) { <nl> - heap_ - > isolate ( ) - > array_buffer_allocator ( ) - > Free ( buffer . second . first , <nl> - buffer . second . second ) ; <nl> - freed_memory + = buffer . second . second ; <nl> + for ( auto & buffer : live_array_buffers_ ) { <nl> + isolate - > array_buffer_allocator ( ) - > Free ( buffer . first , buffer . second ) ; <nl> + freed_memory + = buffer . second ; <nl> } <nl> - if ( freed_memory > 0 ) { <nl> - heap_ - > update_amount_of_external_allocated_freed_memory ( <nl> - static_cast < intptr_t > ( freed_memory ) ) ; <nl> + for ( auto & buffer : live_array_buffers_for_scavenge_ ) { <nl> + isolate - > array_buffer_allocator ( ) - > Free ( buffer . first , buffer . second ) ; <nl> + freed_memory + = buffer . second ; <nl> } <nl> - live_ . clear ( ) ; <nl> - not_yet_discovered_ . clear ( ) ; <nl> - } <nl> - <nl> - void LocalArrayBufferTracker : : Add ( Key key , const Value & value ) { <nl> - live_ [ key ] = value ; <nl> - not_yet_discovered_ [ key ] = value ; <nl> - } <nl> - <nl> - void LocalArrayBufferTracker : : AddLive ( Key key , const Value & value ) { <nl> - DCHECK_EQ ( not_yet_discovered_ . count ( key ) , 0 ) ; <nl> - live_ [ key ] = value ; <nl> - } <nl> - <nl> - void LocalArrayBufferTracker : : MarkLive ( Key key ) { <nl> - DCHECK_EQ ( live_ . count ( key ) , 1 ) ; <nl> - not_yet_discovered_ . erase ( key ) ; <nl> - } <nl> - <nl> - LocalArrayBufferTracker : : Value LocalArrayBufferTracker : : Remove ( Key key ) { <nl> - DCHECK_EQ ( live_ . count ( key ) , 1 ) ; <nl> - Value value = live_ [ key ] ; <nl> - live_ . erase ( key ) ; <nl> - not_yet_discovered_ . erase ( key ) ; <nl> - return value ; <nl> - } <nl> + live_array_buffers_ . clear ( ) ; <nl> + live_array_buffers_for_scavenge_ . clear ( ) ; <nl> + not_yet_discovered_array_buffers_ . clear ( ) ; <nl> + not_yet_discovered_array_buffers_for_scavenge_ . clear ( ) ; <nl> <nl> - void LocalArrayBufferTracker : : FreeDead ( ) { <nl> - size_t freed_memory = 0 ; <nl> - for ( TrackingMap : : iterator it = not_yet_discovered_ . begin ( ) ; <nl> - it ! = not_yet_discovered_ . end ( ) ; ) { <nl> - heap_ - > isolate ( ) - > array_buffer_allocator ( ) - > Free ( it - > second . first , <nl> - it - > second . second ) ; <nl> - freed_memory + = it - > second . second ; <nl> - live_ . erase ( it - > first ) ; <nl> - not_yet_discovered_ . erase ( it + + ) ; <nl> - } <nl> if ( freed_memory > 0 ) { <nl> - heap_ - > update_amount_of_external_allocated_freed_memory ( <nl> - static_cast < intptr_t > ( freed_memory ) ) ; <nl> - } <nl> - started_ = false ; <nl> - } <nl> - <nl> - void LocalArrayBufferTracker : : Reset ( ) { <nl> - if ( ! started_ ) { <nl> - not_yet_discovered_ = live_ ; <nl> - started_ = true ; <nl> + heap ( ) - > update_amount_of_external_allocated_memory ( <nl> + - static_cast < int64_t > ( freed_memory ) ) ; <nl> } <nl> } <nl> <nl> - bool LocalArrayBufferTracker : : IsEmpty ( ) { <nl> - return live_ . empty ( ) & & not_yet_discovered_ . empty ( ) ; <nl> - } <nl> - <nl> - ArrayBufferTracker : : ~ ArrayBufferTracker ( ) { } <nl> <nl> void ArrayBufferTracker : : RegisterNew ( JSArrayBuffer * buffer ) { <nl> void * data = buffer - > backing_store ( ) ; <nl> if ( ! data ) return ; <nl> <nl> - size_t length = NumberToSize ( heap_ - > isolate ( ) , buffer - > byte_length ( ) ) ; <nl> - Page * page = Page : : FromAddress ( buffer - > address ( ) ) ; <nl> - LocalArrayBufferTracker * tracker = <nl> - page - > local_tracker < Page : : kCreateIfNotPresent > ( ) ; <nl> - DCHECK_NOT_NULL ( tracker ) ; <nl> - { <nl> - base : : LockGuard < base : : Mutex > guard ( page - > mutex ( ) ) ; <nl> - if ( Marking : : IsBlack ( Marking : : MarkBitFrom ( buffer ) ) ) { <nl> - tracker - > AddLive ( buffer , std : : make_pair ( data , length ) ) ; <nl> - } else { <nl> - tracker - > Add ( buffer , std : : make_pair ( data , length ) ) ; <nl> - } <nl> + bool in_new_space = heap ( ) - > InNewSpace ( buffer ) ; <nl> + size_t length = NumberToSize ( heap ( ) - > isolate ( ) , buffer - > byte_length ( ) ) ; <nl> + if ( in_new_space ) { <nl> + live_array_buffers_for_scavenge_ [ data ] = length ; <nl> + } else { <nl> + live_array_buffers_ [ data ] = length ; <nl> } <nl> + <nl> / / We may go over the limit of externally allocated memory here . We call the <nl> / / api function to trigger a GC in this case . <nl> - reinterpret_cast < v8 : : Isolate * > ( heap_ - > isolate ( ) ) <nl> + reinterpret_cast < v8 : : Isolate * > ( heap ( ) - > isolate ( ) ) <nl> - > AdjustAmountOfExternalAllocatedMemory ( length ) ; <nl> } <nl> <nl> void ArrayBufferTracker : : Unregister ( JSArrayBuffer * buffer ) { <nl> void * data = buffer - > backing_store ( ) ; <nl> if ( ! data ) return ; <nl> <nl> - Page * page = Page : : FromAddress ( buffer - > address ( ) ) ; <nl> - LocalArrayBufferTracker * tracker = page - > local_tracker < Page : : kDontCreate > ( ) ; <nl> - DCHECK_NOT_NULL ( tracker ) ; <nl> - size_t length = 0 ; <nl> - { <nl> - base : : LockGuard < base : : Mutex > guard ( page - > mutex ( ) ) ; <nl> - length = tracker - > Remove ( buffer ) . second ; <nl> - } <nl> - heap_ - > update_amount_of_external_allocated_memory ( <nl> - - static_cast < intptr_t > ( length ) ) ; <nl> - } <nl> + bool in_new_space = heap ( ) - > InNewSpace ( buffer ) ; <nl> + std : : map < void * , size_t > * live_buffers = <nl> + in_new_space ? & live_array_buffers_for_scavenge_ : & live_array_buffers_ ; <nl> + std : : map < void * , size_t > * not_yet_discovered_buffers = <nl> + in_new_space ? & not_yet_discovered_array_buffers_for_scavenge_ <nl> + : & not_yet_discovered_array_buffers_ ; <nl> <nl> - void ArrayBufferTracker : : FreeDeadInNewSpace ( ) { <nl> - NewSpacePageIterator from_it ( heap_ - > new_space ( ) - > FromSpaceStart ( ) , <nl> - heap_ - > new_space ( ) - > FromSpaceEnd ( ) ) ; <nl> - while ( from_it . has_next ( ) ) { <nl> - ScanAndFreeDeadArrayBuffers < LocalArrayBufferTracker : : kForwardingPointer > ( <nl> - from_it . next ( ) ) ; <nl> - } <nl> - heap_ - > account_amount_of_external_allocated_freed_memory ( ) ; <nl> - } <nl> + DCHECK ( live_buffers - > count ( data ) > 0 ) ; <nl> <nl> - void ArrayBufferTracker : : ResetTrackersInOldSpace ( ) { <nl> - heap_ - > old_space ( ) - > ForAllPages ( [ ] ( Page * p ) { <nl> - LocalArrayBufferTracker * tracker = p - > local_tracker < Page : : kDontCreate > ( ) ; <nl> - if ( tracker ! = nullptr ) { <nl> - tracker - > Reset ( ) ; <nl> - if ( tracker - > IsEmpty ( ) ) { <nl> - p - > ReleaseLocalTracker ( ) ; <nl> - } <nl> - } <nl> - } ) ; <nl> + size_t length = ( * live_buffers ) [ data ] ; <nl> + live_buffers - > erase ( data ) ; <nl> + not_yet_discovered_buffers - > erase ( data ) ; <nl> + <nl> + heap ( ) - > update_amount_of_external_allocated_memory ( <nl> + - static_cast < int64_t > ( length ) ) ; <nl> } <nl> <nl> + <nl> void ArrayBufferTracker : : MarkLive ( JSArrayBuffer * buffer ) { <nl> - if ( buffer - > is_external ( ) ) return ; <nl> + base : : LockGuard < base : : Mutex > guard ( & mutex_ ) ; <nl> void * data = buffer - > backing_store ( ) ; <nl> - if ( data = = nullptr ) return ; <nl> - if ( data = = heap_ - > undefined_value ( ) ) return ; <nl> - <nl> - Page * page = Page : : FromAddress ( buffer - > address ( ) ) ; <nl> - LocalArrayBufferTracker * tracker = <nl> - page - > local_tracker < Page : : kCreateIfNotPresent > ( ) ; <nl> - DCHECK_NOT_NULL ( tracker ) ; <nl> - if ( tracker - > IsTracked ( buffer ) ) { <nl> - base : : LockGuard < base : : Mutex > guard ( page - > mutex ( ) ) ; <nl> - tracker - > MarkLive ( ( buffer ) ) ; <nl> + <nl> + / / ArrayBuffer might be in the middle of being constructed . <nl> + if ( data = = heap ( ) - > undefined_value ( ) ) return ; <nl> + if ( heap ( ) - > InNewSpace ( buffer ) ) { <nl> + not_yet_discovered_array_buffers_for_scavenge_ . erase ( data ) ; <nl> } else { <nl> - RegisterNew ( buffer ) ; <nl> + not_yet_discovered_array_buffers_ . erase ( data ) ; <nl> } <nl> } <nl> <nl> - void ArrayBufferTracker : : FreeDead ( Page * page ) { <nl> - / / Only called from the sweeper , which already holds the page lock . <nl> - LocalArrayBufferTracker * tracker = page - > local_tracker < Page : : kDontCreate > ( ) ; <nl> - if ( tracker ! = nullptr ) { <nl> - tracker - > FreeDead ( ) ; <nl> + <nl> + void ArrayBufferTracker : : FreeDead ( bool from_scavenge ) { <nl> + size_t freed_memory = 0 ; <nl> + Isolate * isolate = heap ( ) - > isolate ( ) ; <nl> + for ( auto & buffer : not_yet_discovered_array_buffers_for_scavenge_ ) { <nl> + isolate - > array_buffer_allocator ( ) - > Free ( buffer . first , buffer . second ) ; <nl> + freed_memory + = buffer . second ; <nl> + live_array_buffers_for_scavenge_ . erase ( buffer . first ) ; <nl> } <nl> - } <nl> <nl> - template < LocalArrayBufferTracker : : LivenessIndicator liveness_indicator > <nl> - void ArrayBufferTracker : : ScanAndFreeDeadArrayBuffers ( Page * page ) { <nl> - LocalArrayBufferTracker * tracker = page - > local_tracker < Page : : kDontCreate > ( ) ; <nl> - if ( tracker ! = nullptr ) { <nl> - base : : LockGuard < base : : Mutex > guard ( page - > mutex ( ) ) ; <nl> - tracker - > ScanAndFreeDead < liveness_indicator > ( ) ; <nl> + if ( ! from_scavenge ) { <nl> + for ( auto & buffer : not_yet_discovered_array_buffers_ ) { <nl> + isolate - > array_buffer_allocator ( ) - > Free ( buffer . first , buffer . second ) ; <nl> + freed_memory + = buffer . second ; <nl> + live_array_buffers_ . erase ( buffer . first ) ; <nl> + } <nl> } <nl> + <nl> + not_yet_discovered_array_buffers_for_scavenge_ = <nl> + live_array_buffers_for_scavenge_ ; <nl> + if ( ! from_scavenge ) not_yet_discovered_array_buffers_ = live_array_buffers_ ; <nl> + <nl> + / / Do not call through the api as this code is triggered while doing a GC . <nl> + heap ( ) - > update_amount_of_external_allocated_memory ( <nl> + - static_cast < int64_t > ( freed_memory ) ) ; <nl> + } <nl> + <nl> + <nl> + void ArrayBufferTracker : : PrepareDiscoveryInNewSpace ( ) { <nl> + not_yet_discovered_array_buffers_for_scavenge_ = <nl> + live_array_buffers_for_scavenge_ ; <nl> } <nl> <nl> - template void ArrayBufferTracker : : ScanAndFreeDeadArrayBuffers < <nl> - LocalArrayBufferTracker : : LivenessIndicator : : kForwardingPointer > ( Page * page ) ; <nl> - template void ArrayBufferTracker : : ScanAndFreeDeadArrayBuffers < <nl> - LocalArrayBufferTracker : : LivenessIndicator : : kMarkBit > ( Page * page ) ; <nl> + <nl> + void ArrayBufferTracker : : Promote ( JSArrayBuffer * buffer ) { <nl> + base : : LockGuard < base : : Mutex > guard ( & mutex_ ) ; <nl> + <nl> + if ( buffer - > is_external ( ) ) return ; <nl> + void * data = buffer - > backing_store ( ) ; <nl> + if ( ! data ) return ; <nl> + / / ArrayBuffer might be in the middle of being constructed . <nl> + if ( data = = heap ( ) - > undefined_value ( ) ) return ; <nl> + DCHECK ( live_array_buffers_for_scavenge_ . count ( data ) > 0 ) ; <nl> + live_array_buffers_ [ data ] = live_array_buffers_for_scavenge_ [ data ] ; <nl> + live_array_buffers_for_scavenge_ . erase ( data ) ; <nl> + not_yet_discovered_array_buffers_for_scavenge_ . erase ( data ) ; <nl> + } <nl> <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / src / heap / array - buffer - tracker . h <nl> ppp b / src / heap / array - buffer - tracker . h <nl> namespace internal { <nl> <nl> / / Forward declarations . <nl> class Heap ; <nl> - class Page ; <nl> class JSArrayBuffer ; <nl> <nl> - / / LocalArrayBufferTracker is tracker for live and dead JSArrayBuffer objects . <nl> - / / <nl> - / / It consists of two sets , a live , and a not yet discovered set of buffers . <nl> - / / Upon registration ( in the ArrayBufferTracker ) the buffers are added to both <nl> - / / sets . When a buffer is encountered as live ( or added is live ) it is removed <nl> - / / from the not yet discovered set . Finally , after each round ( sometime during <nl> - / / GC ) the left over not yet discovered buffers are cleaned up . Upon starting <nl> - / / a new round the not yet discovered buffers are initialized from the live set . <nl> - / / <nl> - / / Caveats : <nl> - / / - Between cleaning up the buffers using | Free | we always need a | Reset | and <nl> - / / thus another marking phase . <nl> - / / - LocalArrayBufferTracker is completely unlocked . Calls need to ensure <nl> - / / exclusive access . <nl> - class LocalArrayBufferTracker { <nl> - public : <nl> - typedef std : : pair < void * , size_t > Value ; <nl> - typedef JSArrayBuffer * Key ; <nl> - <nl> - enum LivenessIndicator { kForwardingPointer , kMarkBit } ; <nl> - enum CallbackResult { kKeepEntry , kKeepAndUpdateEntry , kRemoveEntry } ; <nl> - <nl> - explicit LocalArrayBufferTracker ( Heap * heap ) : heap_ ( heap ) , started_ ( false ) { } <nl> - ~ LocalArrayBufferTracker ( ) ; <nl> - <nl> - void Add ( Key key , const Value & value ) ; <nl> - void AddLive ( Key key , const Value & value ) ; <nl> - Value Remove ( Key key ) ; <nl> - void MarkLive ( Key key ) ; <nl> - bool IsEmpty ( ) ; <nl> - <nl> - / / Resets the tracking set , i . e . , not yet discovered buffers are initialized <nl> - / / from the remaining live set of buffers . <nl> - void Reset ( ) ; <nl> - <nl> - / / Frees up any dead backing stores of not yet discovered array buffers . <nl> - / / Requires that the buffers have been properly marked using MarkLive . <nl> - void FreeDead ( ) ; <nl> - <nl> - / / Scans the whole tracker and decides based on liveness_indicator whether <nl> - / / a JSArrayBuffer is still considered live . <nl> - template < LivenessIndicator liveness_indicator > <nl> - inline void ScanAndFreeDead ( ) ; <nl> - <nl> - bool IsTracked ( Key key ) { return live_ . find ( key ) ! = live_ . end ( ) ; } <nl> - <nl> - private : <nl> - / / TODO ( mlippautz ) : Switch to unordered_map once it is supported on all <nl> - / / platforms . <nl> - typedef std : : map < Key , Value > TrackingMap ; <nl> - <nl> - / / Processes buffers one by one . The CallbackResult decides whether the buffer <nl> - / / will be dropped or not . <nl> - / / <nl> - / / Callback should be of type : <nl> - / / CallbackResult fn ( JSArrayBuffer * , JSArrayBuffer * * ) ; <nl> - template < typename Callback > <nl> - inline void Process ( Callback callback ) ; <nl> - <nl> - Heap * heap_ ; <nl> - <nl> - / / | live_ | maps tracked JSArrayBuffers to the internally allocated backing <nl> - / / store and length . For each GC round | not_yet_discovered_ | is initialized <nl> - / / as a copy of | live_ | . Upon finding a JSArrayBuffer during GC , the buffer <nl> - / / is removed from | not_yet_discovered_ | . At the end of a GC , we free up the <nl> - / / remaining JSArrayBuffers in | not_yet_discovered_ | . <nl> - TrackingMap live_ ; <nl> - TrackingMap not_yet_discovered_ ; <nl> - <nl> - bool started_ ; <nl> - } ; <nl> - <nl> class ArrayBufferTracker { <nl> public : <nl> explicit ArrayBufferTracker ( Heap * heap ) : heap_ ( heap ) { } <nl> ~ ArrayBufferTracker ( ) ; <nl> <nl> + inline Heap * heap ( ) { return heap_ ; } <nl> + <nl> / / The following methods are used to track raw C + + pointers to externally <nl> / / allocated memory used as backing store in live array buffers . <nl> <nl> - / / Register / unregister a new JSArrayBuffer | buffer | for tracking . <nl> + / / A new ArrayBuffer was created with | data | as backing store . <nl> void RegisterNew ( JSArrayBuffer * buffer ) ; <nl> - void Unregister ( JSArrayBuffer * buffer ) ; <nl> <nl> - / / Frees all backing store pointers for dead JSArrayBuffers in new space . <nl> - void FreeDeadInNewSpace ( ) ; <nl> + / / The backing store | data | is no longer owned by V8 . <nl> + void Unregister ( JSArrayBuffer * buffer ) ; <nl> <nl> - void FreeDead ( Page * page ) ; <nl> + / / A live ArrayBuffer was discovered during marking / scavenge . <nl> + void MarkLive ( JSArrayBuffer * buffer ) ; <nl> <nl> - template < LocalArrayBufferTracker : : LivenessIndicator liveness_indicator > <nl> - void ScanAndFreeDeadArrayBuffers ( Page * page ) ; <nl> + / / Frees all backing store pointers that weren ' t discovered in the previous <nl> + / / marking or scavenge phase . <nl> + void FreeDead ( bool from_scavenge ) ; <nl> <nl> - / / A live JSArrayBuffer was discovered during marking . <nl> - void MarkLive ( JSArrayBuffer * buffer ) ; <nl> + / / Prepare for a new scavenge phase . A new marking phase is implicitly <nl> + / / prepared by finishing the previous one . <nl> + void PrepareDiscoveryInNewSpace ( ) ; <nl> <nl> - / / Resets all trackers in old space . Is required to be called from the main <nl> - / / thread . <nl> - void ResetTrackersInOldSpace ( ) ; <nl> + / / An ArrayBuffer moved from new space to old space . <nl> + void Promote ( JSArrayBuffer * buffer ) ; <nl> <nl> private : <nl> + base : : Mutex mutex_ ; <nl> Heap * heap_ ; <nl> - } ; <nl> <nl> + / / | live_array_buffers_ | maps externally allocated memory used as backing <nl> + / / store for ArrayBuffers to the length of the respective memory blocks . <nl> + / / <nl> + / / At the beginning of mark / compact , | not_yet_discovered_array_buffers_ | is <nl> + / / a copy of | live_array_buffers_ | and we remove pointers as we discover live <nl> + / / ArrayBuffer objects during marking . At the end of mark / compact , the <nl> + / / remaining memory blocks can be freed . <nl> + std : : map < void * , size_t > live_array_buffers_ ; <nl> + std : : map < void * , size_t > not_yet_discovered_array_buffers_ ; <nl> + <nl> + / / To be able to free memory held by ArrayBuffers during scavenge as well , we <nl> + / / have a separate list of allocated memory held by ArrayBuffers in new space . <nl> + / / <nl> + / / Since mark / compact also evacuates the new space , all pointers in the <nl> + / / | live_array_buffers_for_scavenge_ | list are also in the <nl> + / / | live_array_buffers_ | list . <nl> + std : : map < void * , size_t > live_array_buffers_for_scavenge_ ; <nl> + std : : map < void * , size_t > not_yet_discovered_array_buffers_for_scavenge_ ; <nl> + } ; <nl> } / / namespace internal <nl> } / / namespace v8 <nl> # endif / / V8_HEAP_ARRAY_BUFFER_TRACKER_H_ <nl> mmm a / src / heap / heap . cc <nl> ppp b / src / heap / heap . cc <nl> void Heap : : Scavenge ( ) { <nl> <nl> scavenge_collector_ - > SelectScavengingVisitorsTable ( ) ; <nl> <nl> + array_buffer_tracker ( ) - > PrepareDiscoveryInNewSpace ( ) ; <nl> + <nl> / / Flip the semispaces . After flipping , to space is empty , from space has <nl> / / live objects . <nl> new_space_ . Flip ( ) ; <nl> void Heap : : Scavenge ( ) { <nl> / / Set age mark . <nl> new_space_ . set_age_mark ( new_space_ . top ( ) ) ; <nl> <nl> - array_buffer_tracker ( ) - > FreeDeadInNewSpace ( ) ; <nl> + array_buffer_tracker ( ) - > FreeDead ( true ) ; <nl> <nl> / / Update how much has survived scavenge . <nl> IncrementYoungSurvivorsCounter ( static_cast < int > ( <nl> mmm a / src / heap / heap . h <nl> ppp b / src / heap / heap . h <nl> class Heap { <nl> amount_of_external_allocated_memory_ + = delta ; <nl> } <nl> <nl> - void update_amount_of_external_allocated_freed_memory ( intptr_t freed ) { <nl> - amount_of_external_allocated_memory_freed_ . Increment ( freed ) ; <nl> - } <nl> - <nl> - void account_amount_of_external_allocated_freed_memory ( ) { <nl> - amount_of_external_allocated_memory_ - = <nl> - amount_of_external_allocated_memory_freed_ . Value ( ) ; <nl> - amount_of_external_allocated_memory_freed_ . SetValue ( 0 ) ; <nl> - } <nl> - <nl> void DeoptMarkedAllocationSites ( ) ; <nl> <nl> bool DeoptMaybeTenuredAllocationSites ( ) { <nl> class Heap { <nl> / / Caches the amount of external memory registered at the last global gc . <nl> int64_t amount_of_external_allocated_memory_at_last_global_gc_ ; <nl> <nl> - base : : AtomicNumber < intptr_t > amount_of_external_allocated_memory_freed_ ; <nl> - <nl> / / This can be calculated directly from a pointer to the heap ; however , it is <nl> / / more expedient to get at the isolate directly from within Heap methods . <nl> Isolate * isolate_ ; <nl> mmm a / src / heap / incremental - marking . cc <nl> ppp b / src / heap / incremental - marking . cc <nl> void IncrementalMarking : : StartMarking ( ) { <nl> MarkCompactCollector : : kMaxMarkingDequeSize ) ; <nl> <nl> ActivateIncrementalWriteBarrier ( ) ; <nl> - heap_ - > array_buffer_tracker ( ) - > ResetTrackersInOldSpace ( ) ; <nl> <nl> / / Marking bits are cleared by the sweeper . <nl> # ifdef VERIFY_HEAP <nl> mmm a / src / heap / mark - compact . cc <nl> ppp b / src / heap / mark - compact . cc <nl> <nl> # include " src / frames - inl . h " <nl> # include " src / gdb - jit . h " <nl> # include " src / global - handles . h " <nl> - # include " src / heap / array - buffer - tracker - inl . h " <nl> + # include " src / heap / array - buffer - tracker . h " <nl> # include " src / heap / gc - tracer . h " <nl> # include " src / heap / incremental - marking . h " <nl> # include " src / heap / mark - compact - inl . h " <nl> void MarkCompactCollector : : Prepare ( ) { <nl> space = spaces . next ( ) ) { <nl> space - > PrepareForMarkCompact ( ) ; <nl> } <nl> - if ( ! was_marked_incrementally_ ) { <nl> - heap_ - > array_buffer_tracker ( ) - > ResetTrackersInOldSpace ( ) ; <nl> - } <nl> - heap ( ) - > account_amount_of_external_allocated_freed_memory ( ) ; <nl> <nl> # ifdef VERIFY_HEAP <nl> if ( ! was_marked_incrementally_ & & FLAG_verify_heap ) { <nl> class MarkCompactCollector : : EvacuateNewSpaceVisitor final <nl> if ( heap_ - > ShouldBePromoted ( object - > address ( ) , size ) & & <nl> TryEvacuateObject ( compaction_spaces_ - > Get ( OLD_SPACE ) , object , <nl> & target_object ) ) { <nl> + / / If we end up needing more special cases , we should factor this out . <nl> + if ( V8_UNLIKELY ( target_object - > IsJSArrayBuffer ( ) ) ) { <nl> + heap_ - > array_buffer_tracker ( ) - > Promote ( <nl> + JSArrayBuffer : : cast ( target_object ) ) ; <nl> + } <nl> promoted_size_ + = size ; <nl> return true ; <nl> } <nl> HeapObject * target = nullptr ; <nl> AllocationSpace space = AllocateTargetObject ( object , & target ) ; <nl> MigrateObject ( HeapObject : : cast ( target ) , object , size , space ) ; <nl> + if ( V8_UNLIKELY ( target - > IsJSArrayBuffer ( ) ) ) { <nl> + heap_ - > array_buffer_tracker ( ) - > MarkLive ( JSArrayBuffer : : cast ( target ) ) ; <nl> + } <nl> semispace_copied_size_ + = size ; <nl> return true ; <nl> } <nl> class MarkCompactCollector : : EvacuateNewSpacePageVisitor final <nl> } <nl> <nl> inline bool Visit ( HeapObject * object ) { <nl> + if ( V8_UNLIKELY ( object - > IsJSArrayBuffer ( ) ) ) { <nl> + object - > GetHeap ( ) - > array_buffer_tracker ( ) - > Promote ( <nl> + JSArrayBuffer : : cast ( object ) ) ; <nl> + } <nl> RecordMigratedSlotVisitor visitor ( heap_ - > mark_compact_collector ( ) ) ; <nl> object - > IterateBodyFast ( & visitor ) ; <nl> promoted_size_ + = object - > Size ( ) ; <nl> class MarkCompactCollector : : EvacuateRecordOnlyVisitor final <nl> inline bool Visit ( HeapObject * object ) { <nl> RecordMigratedSlotVisitor visitor ( heap_ - > mark_compact_collector ( ) ) ; <nl> object - > IterateBody ( & visitor ) ; <nl> - if ( V8_UNLIKELY ( object - > IsJSArrayBuffer ( ) ) ) { <nl> - heap_ - > array_buffer_tracker ( ) - > MarkLive ( JSArrayBuffer : : cast ( object ) ) ; <nl> - } <nl> return true ; <nl> } <nl> <nl> bool MarkCompactCollector : : Evacuator : : EvacuateSinglePage ( Page * p , <nl> bool MarkCompactCollector : : Evacuator : : EvacuatePage ( Page * page ) { <nl> bool result = false ; <nl> DCHECK ( page - > SweepingDone ( ) ) ; <nl> - Heap * heap = page - > heap ( ) ; <nl> switch ( ComputeEvacuationMode ( page ) ) { <nl> case kObjectsNewToOld : <nl> result = EvacuateSinglePage < kClearMarkbits > ( page , & new_space_visitor_ ) ; <nl> - heap - > array_buffer_tracker ( ) <nl> - - > ScanAndFreeDeadArrayBuffers < <nl> - LocalArrayBufferTracker : : kForwardingPointer > ( page ) ; <nl> DCHECK ( result ) ; <nl> USE ( result ) ; <nl> break ; <nl> case kPageNewToOld : <nl> result = EvacuateSinglePage < kKeepMarking > ( page , & new_space_page_visitor ) ; <nl> - / / ArrayBufferTracker will be updated during sweeping . <nl> DCHECK ( result ) ; <nl> USE ( result ) ; <nl> break ; <nl> case kObjectsOldToOld : <nl> result = EvacuateSinglePage < kClearMarkbits > ( page , & old_space_visitor_ ) ; <nl> - heap - > array_buffer_tracker ( ) <nl> - - > ScanAndFreeDeadArrayBuffers < <nl> - LocalArrayBufferTracker : : kForwardingPointer > ( page ) ; <nl> if ( ! result ) { <nl> / / Aborted compaction page . We can record slots here to have them <nl> / / processed in parallel later on . <nl> EvacuateRecordOnlyVisitor record_visitor ( collector_ - > heap ( ) ) ; <nl> result = EvacuateSinglePage < kKeepMarking > ( page , & record_visitor ) ; <nl> - heap - > array_buffer_tracker ( ) <nl> - - > ScanAndFreeDeadArrayBuffers < LocalArrayBufferTracker : : kMarkBit > ( <nl> - page ) ; <nl> DCHECK ( result ) ; <nl> USE ( result ) ; <nl> / / We need to return failure here to indicate that we want this page <nl> int MarkCompactCollector : : Sweeper : : RawSweep ( PagedSpace * space , Page * p , <nl> freed_bytes = space - > UnaccountedFree ( free_start , size ) ; <nl> max_freed_bytes = Max ( freed_bytes , max_freed_bytes ) ; <nl> } <nl> - p - > heap ( ) - > array_buffer_tracker ( ) - > FreeDead ( p ) ; <nl> p - > concurrent_sweeping_state ( ) . SetValue ( Page : : kSweepingDone ) ; <nl> return FreeList : : GuaranteedAllocatable ( static_cast < int > ( max_freed_bytes ) ) ; <nl> } <nl> void MarkCompactCollector : : EvacuateNewSpaceAndCandidates ( ) { <nl> } <nl> } <nl> <nl> + / / EvacuateNewSpaceAndCandidates iterates over new space objects and for <nl> + / / ArrayBuffers either re - registers them as live or promotes them . This is <nl> + / / needed to properly free them . <nl> + heap ( ) - > array_buffer_tracker ( ) - > FreeDead ( false ) ; <nl> + <nl> / / Deallocate evacuated candidate pages . <nl> ReleaseEvacuationCandidates ( ) ; <nl> } <nl> mmm a / src / heap / objects - visiting - inl . h <nl> ppp b / src / heap / objects - visiting - inl . h <nl> int StaticNewSpaceVisitor < StaticVisitor > : : VisitJSArrayBuffer ( <nl> Map * map , HeapObject * object ) { <nl> typedef FlexibleBodyVisitor < StaticVisitor , JSArrayBuffer : : BodyDescriptor , int > <nl> JSArrayBufferBodyVisitor ; <nl> + <nl> + if ( ! JSArrayBuffer : : cast ( object ) - > is_external ( ) ) { <nl> + Heap * heap = map - > GetHeap ( ) ; <nl> + heap - > array_buffer_tracker ( ) - > MarkLive ( JSArrayBuffer : : cast ( object ) ) ; <nl> + } <nl> return JSArrayBufferBodyVisitor : : Visit ( map , object ) ; <nl> } <nl> <nl> mmm a / src / heap / scavenger . cc <nl> ppp b / src / heap / scavenger . cc <nl> class ScavengingVisitor : public StaticVisitorBase { <nl> PromotionMode promotion_mode ) { <nl> ObjectEvacuationStrategy < POINTER_OBJECT > : : Visit ( map , slot , object , <nl> promotion_mode ) ; <nl> + <nl> + Heap * heap = map - > GetHeap ( ) ; <nl> + MapWord map_word = object - > map_word ( ) ; <nl> + DCHECK ( map_word . IsForwardingAddress ( ) ) ; <nl> + HeapObject * target = map_word . ToForwardingAddress ( ) ; <nl> + if ( ! heap - > InNewSpace ( target ) ) { <nl> + heap - > array_buffer_tracker ( ) - > Promote ( JSArrayBuffer : : cast ( target ) ) ; <nl> + } <nl> } <nl> <nl> static inline void EvacuateByteArray ( Map * map , HeapObject * * slot , <nl> mmm a / src / heap / spaces - inl . h <nl> ppp b / src / heap / spaces - inl . h <nl> template < Page : : InitializationMode mode > <nl> Page * Page : : Initialize ( Heap * heap , MemoryChunk * chunk , Executability executable , <nl> PagedSpace * owner ) { <nl> Page * page = reinterpret_cast < Page * > ( chunk ) ; <nl> + page - > mutex_ = new base : : Mutex ( ) ; <nl> DCHECK ( page - > area_size ( ) < = kAllocatableMemory ) ; <nl> DCHECK ( chunk - > owner ( ) = = owner ) ; <nl> <nl> mmm a / src / heap / spaces . cc <nl> ppp b / src / heap / spaces . cc <nl> MemoryChunk * MemoryChunk : : Initialize ( Heap * heap , Address base , size_t size , <nl> chunk - > progress_bar_ = 0 ; <nl> chunk - > high_water_mark_ . SetValue ( static_cast < intptr_t > ( area_start - base ) ) ; <nl> chunk - > concurrent_sweeping_state ( ) . SetValue ( kSweepingDone ) ; <nl> - chunk - > mutex_ = new base : : Mutex ( ) ; <nl> + chunk - > mutex_ = nullptr ; <nl> chunk - > available_in_free_list_ = 0 ; <nl> chunk - > wasted_memory_ = 0 ; <nl> chunk - > ResetLiveBytes ( ) ; <nl> Bitmap : : Clear ( chunk ) ; <nl> chunk - > set_next_chunk ( nullptr ) ; <nl> chunk - > set_prev_chunk ( nullptr ) ; <nl> - chunk - > local_tracker_ . SetValue ( nullptr ) ; <nl> <nl> DCHECK ( OFFSET_OF ( MemoryChunk , flags_ ) = = kFlagsOffset ) ; <nl> DCHECK ( OFFSET_OF ( MemoryChunk , live_byte_count_ ) = = kLiveBytesOffset ) ; <nl> void MemoryChunk : : ReleaseAllocatedMemory ( ) { <nl> if ( old_to_old_slots_ ! = nullptr ) ReleaseOldToOldSlots ( ) ; <nl> if ( typed_old_to_new_slots_ ! = nullptr ) ReleaseTypedOldToNewSlots ( ) ; <nl> if ( typed_old_to_old_slots_ ! = nullptr ) ReleaseTypedOldToOldSlots ( ) ; <nl> - <nl> - if ( local_tracker_ . Value ( ) ! = nullptr ) ReleaseLocalTracker ( ) ; <nl> } <nl> <nl> static SlotSet * AllocateSlotSet ( size_t size , Address page_start ) { <nl> void MemoryChunk : : ReleaseTypedOldToOldSlots ( ) { <nl> delete typed_old_to_old_slots_ ; <nl> typed_old_to_old_slots_ = nullptr ; <nl> } <nl> - <nl> - void MemoryChunk : : ReleaseLocalTracker ( ) { <nl> - delete local_tracker_ . Value ( ) ; <nl> - local_tracker_ . SetValue ( nullptr ) ; <nl> - } <nl> - <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> / / PagedSpace implementation <nl> <nl> mmm a / src / heap / spaces . h <nl> ppp b / src / heap / spaces . h <nl> <nl> # include " src / base / platform / mutex . h " <nl> # include " src / flags . h " <nl> # include " src / hashmap . h " <nl> - # include " src / heap / array - buffer - tracker . h " <nl> # include " src / list . h " <nl> # include " src / objects . h " <nl> # include " src / utils . h " <nl> class MemoryChunk { <nl> kSweepingInProgress , <nl> } ; <nl> <nl> - enum ArrayBufferTrackerAccessMode { kDontCreate , kCreateIfNotPresent } ; <nl> - <nl> / / Every n write barrier invocations we go to runtime even though <nl> / / we could have handled it in generated code . This lets us check <nl> / / whether we have hit the limit and should do some more marking . <nl> class MemoryChunk { <nl> + kPointerSize / / AtomicValue next_chunk_ <nl> + kPointerSize / / AtomicValue prev_chunk_ <nl> / / FreeListCategory categories_ [ kNumberOfCategories ] <nl> - + FreeListCategory : : kSize * kNumberOfCategories + <nl> - kPointerSize ; / / LocalArrayBufferTracker tracker_ <nl> + + FreeListCategory : : kSize * kNumberOfCategories ; <nl> <nl> / / We add some more space to the computed header size to amount for missing <nl> / / alignment requirements in our computation . <nl> class MemoryChunk { <nl> void AllocateTypedOldToOldSlots ( ) ; <nl> void ReleaseTypedOldToOldSlots ( ) ; <nl> <nl> - template < ArrayBufferTrackerAccessMode tracker_access > <nl> - inline LocalArrayBufferTracker * local_tracker ( ) { <nl> - LocalArrayBufferTracker * tracker = local_tracker_ . Value ( ) ; <nl> - if ( tracker = = nullptr & & tracker_access = = kCreateIfNotPresent ) { <nl> - tracker = new LocalArrayBufferTracker ( heap_ ) ; <nl> - if ( ! local_tracker_ . TrySetValue ( nullptr , tracker ) ) { <nl> - tracker = local_tracker_ . Value ( ) ; <nl> - } <nl> - DCHECK_NOT_NULL ( tracker ) ; <nl> - } <nl> - return tracker ; <nl> - } <nl> - <nl> - void ReleaseLocalTracker ( ) ; <nl> - <nl> Address area_start ( ) { return area_start_ ; } <nl> Address area_end ( ) { return area_end_ ; } <nl> int area_size ( ) { return static_cast < int > ( area_end ( ) - area_start ( ) ) ; } <nl> class MemoryChunk { <nl> <nl> FreeListCategory categories_ [ kNumberOfCategories ] ; <nl> <nl> - base : : AtomicValue < LocalArrayBufferTracker * > local_tracker_ ; <nl> - <nl> private : <nl> void InitializeReservedMemory ( ) { reservation_ . Reset ( ) ; } <nl> <nl> class PagedSpace : public Space { <nl> inline void UnlinkFreeListCategories ( Page * page ) ; <nl> inline intptr_t RelinkFreeListCategories ( Page * page ) ; <nl> <nl> - / / Callback signature : <nl> - / / void Callback ( Page * ) ; <nl> - template < typename Callback > <nl> - void ForAllPages ( Callback callback ) { <nl> - PageIterator it ( this ) ; <nl> - while ( it . has_next ( ) ) { <nl> - callback ( it . next ( ) ) ; <nl> - } <nl> - } <nl> - <nl> protected : <nl> / / PagedSpaces that should be included in snapshots have different , i . e . , <nl> / / smaller , initial pages . <nl> mmm a / src / v8 . gyp <nl> ppp b / src / v8 . gyp <nl> <nl> ' handles . h ' , <nl> ' hashmap . h ' , <nl> ' heap - symbols . h ' , <nl> - ' heap / array - buffer - tracker - inl . h ' , <nl> ' heap / array - buffer - tracker . cc ' , <nl> ' heap / array - buffer - tracker . h ' , <nl> ' heap / memory - reducer . cc ' , <nl> mmm a / test / cctest / cctest . gyp <nl> ppp b / test / cctest / cctest . gyp <nl> <nl> ' heap / heap - utils . cc ' , <nl> ' heap / heap - utils . h ' , <nl> ' heap / test - alloc . cc ' , <nl> - ' heap / test - array - buffer - tracker . cc ' , <nl> ' heap / test - compaction . cc ' , <nl> ' heap / test - heap . cc ' , <nl> ' heap / test - incremental - marking . cc ' , <nl> mmm a / test / cctest / heap / heap - utils . cc <nl> ppp b / test / cctest / heap / heap - utils . cc <nl> void SimulateFullSpace ( v8 : : internal : : PagedSpace * space ) { <nl> space - > ClearStats ( ) ; <nl> } <nl> <nl> - void AbandonCurrentlyFreeMemory ( PagedSpace * space ) { <nl> - space - > EmptyAllocationInfo ( ) ; <nl> - PageIterator pit ( space ) ; <nl> - while ( pit . has_next ( ) ) { <nl> - pit . next ( ) - > MarkNeverAllocateForTesting ( ) ; <nl> - } <nl> - } <nl> - <nl> - void GcAndSweep ( Heap * heap , AllocationSpace space ) { <nl> - heap - > CollectGarbage ( space ) ; <nl> - if ( heap - > mark_compact_collector ( ) - > sweeping_in_progress ( ) ) { <nl> - heap - > mark_compact_collector ( ) - > EnsureSweepingCompleted ( ) ; <nl> - } <nl> - } <nl> - <nl> } / / namespace heap <nl> } / / namespace internal <nl> } / / namespace v8 <nl> mmm a / test / cctest / heap / heap - utils . h <nl> ppp b / test / cctest / heap / heap - utils . h <nl> void SimulateIncrementalMarking ( i : : Heap * heap , bool force_completion = true ) ; <nl> / / Helper function that simulates a full old - space in the heap . <nl> void SimulateFullSpace ( v8 : : internal : : PagedSpace * space ) ; <nl> <nl> - void AbandonCurrentlyFreeMemory ( PagedSpace * space ) ; <nl> - <nl> - void GcAndSweep ( Heap * heap , AllocationSpace space ) ; <nl> - <nl> } / / namespace heap <nl> } / / namespace internal <nl> } / / namespace v8 <nl> deleted file mode 100644 <nl> index 0e8b65cd2b0 . . 00000000000 <nl> mmm a / test / cctest / heap / test - array - buffer - tracker . cc <nl> ppp / dev / null <nl> <nl> - / / Copyright 2016 the V8 project authors . All rights reserved . <nl> - / / Use of this source code is governed by a BSD - style license that can be <nl> - / / found in the LICENSE file . <nl> - <nl> - # include " src / heap / array - buffer - tracker - inl . h " <nl> - # include " src / heap / array - buffer - tracker . h " <nl> - # include " test / cctest / cctest . h " <nl> - # include " test / cctest / heap / heap - utils . h " <nl> - <nl> - namespace { <nl> - <nl> - typedef i : : LocalArrayBufferTracker LocalTracker ; <nl> - <nl> - void VerifyTrackedInNewSpace ( i : : JSArrayBuffer * buf ) { <nl> - CHECK ( i : : Page : : FromAddress ( buf - > address ( ) ) - > InNewSpace ( ) ) ; <nl> - CHECK ( i : : Page : : FromAddress ( buf - > address ( ) ) <nl> - - > local_tracker < i : : Page : : kCreateIfNotPresent > ( ) <nl> - - > IsTracked ( buf ) ) ; <nl> - } <nl> - <nl> - void VerifyTrackedInOldSpace ( i : : JSArrayBuffer * buf ) { <nl> - CHECK ( ! i : : Page : : FromAddress ( buf - > address ( ) ) - > InNewSpace ( ) ) ; <nl> - CHECK ( i : : Page : : FromAddress ( buf - > address ( ) ) <nl> - - > local_tracker < i : : Page : : kCreateIfNotPresent > ( ) <nl> - - > IsTracked ( buf ) ) ; <nl> - } <nl> - <nl> - void VerifyUntracked ( i : : JSArrayBuffer * buf ) { <nl> - CHECK ( ! i : : Page : : FromAddress ( buf - > address ( ) ) <nl> - - > local_tracker < i : : Page : : kCreateIfNotPresent > ( ) <nl> - - > IsTracked ( buf ) ) ; <nl> - } <nl> - <nl> - } / / namespace <nl> - <nl> - namespace v8 { <nl> - namespace internal { <nl> - <nl> - / / The following tests make sure that JSArrayBuffer tracking works expected when <nl> - / / moving the objects through various spaces during GC phases . <nl> - <nl> - TEST ( ArrayBuffer_OnlyMC ) { <nl> - CcTest : : InitializeVM ( ) ; <nl> - LocalContext env ; <nl> - v8 : : Isolate * isolate = env - > GetIsolate ( ) ; <nl> - Heap * heap = reinterpret_cast < Isolate * > ( isolate ) - > heap ( ) ; <nl> - <nl> - JSArrayBuffer * raw_ab = nullptr ; <nl> - { <nl> - v8 : : HandleScope handle_scope ( isolate ) ; <nl> - Local < v8 : : ArrayBuffer > ab = v8 : : ArrayBuffer : : New ( isolate , 100 ) ; <nl> - Handle < JSArrayBuffer > buf = v8 : : Utils : : OpenHandle ( * ab ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - raw_ab = * buf ; <nl> - / / Prohibit page from being released . <nl> - Page : : FromAddress ( buf - > address ( ) ) - > MarkNeverEvacuate ( ) ; <nl> - } <nl> - / / 2 GCs are needed because we promote to old space as live , meaning that <nl> - / / we will survive one GC . <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - VerifyUntracked ( raw_ab ) ; <nl> - } <nl> - <nl> - TEST ( ArrayBuffer_OnlyScavenge ) { <nl> - CcTest : : InitializeVM ( ) ; <nl> - LocalContext env ; <nl> - v8 : : Isolate * isolate = env - > GetIsolate ( ) ; <nl> - Heap * heap = reinterpret_cast < Isolate * > ( isolate ) - > heap ( ) ; <nl> - <nl> - JSArrayBuffer * raw_ab = nullptr ; <nl> - { <nl> - v8 : : HandleScope handle_scope ( isolate ) ; <nl> - Local < v8 : : ArrayBuffer > ab = v8 : : ArrayBuffer : : New ( isolate , 100 ) ; <nl> - Handle < JSArrayBuffer > buf = v8 : : Utils : : OpenHandle ( * ab ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - raw_ab = * buf ; <nl> - / / Prohibit page from being released . <nl> - Page : : FromAddress ( buf - > address ( ) ) - > MarkNeverEvacuate ( ) ; <nl> - } <nl> - / / 2 GCs are needed because we promote to old space as live , meaning that <nl> - / / we will survive one GC . <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - VerifyUntracked ( raw_ab ) ; <nl> - } <nl> - <nl> - TEST ( ArrayBuffer_ScavengeAndMC ) { <nl> - CcTest : : InitializeVM ( ) ; <nl> - LocalContext env ; <nl> - v8 : : Isolate * isolate = env - > GetIsolate ( ) ; <nl> - Heap * heap = reinterpret_cast < Isolate * > ( isolate ) - > heap ( ) ; <nl> - <nl> - JSArrayBuffer * raw_ab = nullptr ; <nl> - { <nl> - v8 : : HandleScope handle_scope ( isolate ) ; <nl> - Local < v8 : : ArrayBuffer > ab = v8 : : ArrayBuffer : : New ( isolate , 100 ) ; <nl> - Handle < JSArrayBuffer > buf = v8 : : Utils : : OpenHandle ( * ab ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - raw_ab = * buf ; <nl> - / / Prohibit page from being released . <nl> - Page : : FromAddress ( buf - > address ( ) ) - > MarkNeverEvacuate ( ) ; <nl> - } <nl> - / / 2 GCs are needed because we promote to old space as live , meaning that <nl> - / / we will survive one GC . <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - heap : : GcAndSweep ( heap , OLD_SPACE ) ; <nl> - VerifyUntracked ( raw_ab ) ; <nl> - } <nl> - <nl> - TEST ( ArrayBuffer_Compaction ) { <nl> - FLAG_manual_evacuation_candidates_selection = true ; <nl> - CcTest : : InitializeVM ( ) ; <nl> - LocalContext env ; <nl> - v8 : : Isolate * isolate = env - > GetIsolate ( ) ; <nl> - Heap * heap = reinterpret_cast < Isolate * > ( isolate ) - > heap ( ) ; <nl> - heap : : AbandonCurrentlyFreeMemory ( heap - > old_space ( ) ) ; <nl> - <nl> - v8 : : HandleScope handle_scope ( isolate ) ; <nl> - Local < v8 : : ArrayBuffer > ab1 = v8 : : ArrayBuffer : : New ( isolate , 100 ) ; <nl> - Handle < JSArrayBuffer > buf1 = v8 : : Utils : : OpenHandle ( * ab1 ) ; <nl> - VerifyTrackedInNewSpace ( * buf1 ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - <nl> - Page * page_before_gc = Page : : FromAddress ( buf1 - > address ( ) ) ; <nl> - page_before_gc - > SetFlag ( MemoryChunk : : FORCE_EVACUATION_CANDIDATE_FOR_TESTING ) ; <nl> - VerifyTrackedInOldSpace ( * buf1 ) ; <nl> - <nl> - heap - > CollectAllGarbage ( ) ; <nl> - <nl> - Page * page_after_gc = Page : : FromAddress ( buf1 - > address ( ) ) ; <nl> - VerifyTrackedInOldSpace ( * buf1 ) ; <nl> - <nl> - CHECK_NE ( page_before_gc , page_after_gc ) ; <nl> - } <nl> - <nl> - TEST ( ArrayBuffer_UnregisterDuringSweep ) { <nl> - / / Regular pages in old space ( without compaction ) are processed concurrently <nl> - / / in the sweeper . If we happen to unregister a buffer ( either explicitly , or <nl> - / / implicitly through e . g . | Externalize | ) we need to sync with the sweeper <nl> - / / task . <nl> - / / <nl> - / / Note : This test will will only fail on TSAN configurations . <nl> - <nl> - / / Disable verify - heap since it forces sweeping to be completed in the <nl> - / / epilogue of the GC . <nl> - # ifdef VERIFY_HEAP <nl> - i : : FLAG_verify_heap = false ; <nl> - # endif / / VERIFY_HEAP <nl> - <nl> - CcTest : : InitializeVM ( ) ; <nl> - LocalContext env ; <nl> - v8 : : Isolate * isolate = env - > GetIsolate ( ) ; <nl> - Heap * heap = reinterpret_cast < Isolate * > ( isolate ) - > heap ( ) ; <nl> - { <nl> - v8 : : HandleScope handle_scope ( isolate ) ; <nl> - Local < v8 : : ArrayBuffer > ab = v8 : : ArrayBuffer : : New ( isolate , 100 ) ; <nl> - Handle < JSArrayBuffer > buf = v8 : : Utils : : OpenHandle ( * ab ) ; <nl> - <nl> - { <nl> - v8 : : HandleScope handle_scope ( isolate ) ; <nl> - / / Allocate another buffer on the same page to force processing a <nl> - / / non - empty set of buffers in the last GC . <nl> - Local < v8 : : ArrayBuffer > ab2 = v8 : : ArrayBuffer : : New ( isolate , 100 ) ; <nl> - Handle < JSArrayBuffer > buf2 = v8 : : Utils : : OpenHandle ( * ab2 ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - VerifyTrackedInNewSpace ( * buf2 ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInNewSpace ( * buf ) ; <nl> - VerifyTrackedInNewSpace ( * buf2 ) ; <nl> - heap : : GcAndSweep ( heap , NEW_SPACE ) ; <nl> - VerifyTrackedInOldSpace ( * buf ) ; <nl> - VerifyTrackedInOldSpace ( * buf2 ) ; <nl> - } <nl> - <nl> - heap - > CollectGarbage ( OLD_SPACE ) ; <nl> - / / | Externalize | will cause the buffer to be | Unregister | ed . Without <nl> - / / barriers and proper synchronization this will trigger a data race on <nl> - / / TSAN . <nl> - v8 : : ArrayBuffer : : Contents contents = ab - > Externalize ( ) ; <nl> - heap - > isolate ( ) - > array_buffer_allocator ( ) - > Free ( contents . Data ( ) , <nl> - contents . ByteLength ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - } / / namespace internal <nl> - } / / namespace v8 <nl>
|
Revert of " [ heap ] Fine - grained JSArrayBuffer tracking " ( patchset id : 1 of https : / / codereview . chromium . org / 2009383002 / )
|
v8/v8
|
6a92d748759ada2ee404dfab1e3158565397efb2
|
2016-05-25T21:21:15Z
|
mmm a / src / api . h <nl> ppp b / src / api . h <nl> static inline v8 : : internal : : Handle < v8 : : internal : : Object > FromCData ( T obj ) { <nl> } <nl> <nl> <nl> - class ApiFunction { <nl> - public : <nl> - explicit ApiFunction ( v8 : : internal : : Address addr ) : addr_ ( addr ) { } <nl> - v8 : : internal : : Address address ( ) { return addr_ ; } <nl> - private : <nl> - v8 : : internal : : Address addr_ ; <nl> - } ; <nl> - <nl> - <nl> v8 : : Arguments : : Arguments ( v8 : : Local < v8 : : Value > data , <nl> v8 : : Local < v8 : : Object > holder , <nl> v8 : : Local < v8 : : Function > callee , <nl> mmm a / src / arm / codegen - arm . cc <nl> ppp b / src / arm / codegen - arm . cc <nl> void CEntryStub : : GenerateCore ( MacroAssembler * masm , <nl> Label * throw_normal_exception , <nl> Label * throw_termination_exception , <nl> Label * throw_out_of_memory_exception , <nl> - ExitFrame : : Mode mode , <nl> + StackFrame : : Type frame_type , <nl> bool do_gc , <nl> bool always_allocate ) { <nl> / / r0 : result parameter for PerformGC , if any <nl> void CEntryStub : : GenerateCore ( MacroAssembler * masm , <nl> / / r0 : r1 : result <nl> / / sp : stack pointer <nl> / / fp : frame pointer <nl> - __ LeaveExitFrame ( mode ) ; <nl> + __ LeaveExitFrame ( frame_type ) ; <nl> <nl> / / check if we should retry or throw exception <nl> Label retry ; <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> / / this by performing a garbage collection and retrying the <nl> / / builtin once . <nl> <nl> - ExitFrame : : Mode mode = is_debug_break <nl> - ? ExitFrame : : MODE_DEBUG <nl> - : ExitFrame : : MODE_NORMAL ; <nl> + StackFrame : : Type frame_type = is_debug_break <nl> + ? StackFrame : : EXIT_DEBUG <nl> + : StackFrame : : EXIT ; <nl> <nl> / / Enter the exit frame that transitions from JavaScript to C + + . <nl> - __ EnterExitFrame ( mode ) ; <nl> + __ EnterExitFrame ( frame_type ) ; <nl> <nl> / / r4 : number of arguments ( C callee - saved ) <nl> / / r5 : pointer to builtin function ( C callee - saved ) <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> false , <nl> false ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> true , <nl> false ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> true , <nl> true ) ; <nl> <nl> mmm a / src / arm / frames - arm . cc <nl> ppp b / src / arm / frames - arm . cc <nl> StackFrame : : Type ExitFrame : : GetStateForFramePointer ( Address fp , State * state ) { <nl> if ( fp = = 0 ) return NONE ; <nl> / / Compute frame type and stack pointer . <nl> Address sp = fp + ExitFrameConstants : : kSPDisplacement ; <nl> - const int offset = ExitFrameConstants : : kCodeOffset ; <nl> - Object * code = Memory : : Object_at ( fp + offset ) ; <nl> - bool is_debug_exit = code - > IsSmi ( ) ; <nl> - if ( is_debug_exit ) <nl> + Type type ; <nl> + if ( Memory : : Address_at ( fp + ExitFrameConstants : : kDebugMarkOffset ) ! = 0 ) { <nl> + type = EXIT_DEBUG ; <nl> sp - = kNumJSCallerSaved * kPointerSize ; <nl> + } else { <nl> + type = EXIT ; <nl> + } <nl> / / Fill in the state . <nl> state - > sp = sp ; <nl> state - > fp = fp ; <nl> state - > pc_address = reinterpret_cast < Address * > ( sp - 1 * kPointerSize ) ; <nl> - return EXIT ; <nl> + return type ; <nl> } <nl> <nl> <nl> mmm a / src / arm / frames - arm . h <nl> ppp b / src / arm / frames - arm . h <nl> class ExitFrameConstants : public AllStatic { <nl> static const int kSPDisplacement = - 1 * kPointerSize ; <nl> <nl> / / The debug marker is just above the frame pointer . <nl> - static const int kCodeOffset = - 1 * kPointerSize ; <nl> + static const int kDebugMarkOffset = - 1 * kPointerSize ; <nl> <nl> static const int kSavedRegistersOffset = 0 * kPointerSize ; <nl> <nl> mmm a / src / arm / macro - assembler - arm . cc <nl> ppp b / src / arm / macro - assembler - arm . cc <nl> void MacroAssembler : : LeaveFrame ( StackFrame : : Type type ) { <nl> } <nl> <nl> <nl> - void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode ) { <nl> + void MacroAssembler : : EnterExitFrame ( StackFrame : : Type type ) { <nl> + ASSERT ( type = = StackFrame : : EXIT | | type = = StackFrame : : EXIT_DEBUG ) ; <nl> + <nl> / / Compute the argv pointer and keep it in a callee - saved register . <nl> / / r0 is argc . <nl> add ( r6 , sp , Operand ( r0 , LSL , kPointerSizeLog2 ) ) ; <nl> void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode ) { <nl> stm ( db_w , sp , fp . bit ( ) | ip . bit ( ) | lr . bit ( ) ) ; <nl> mov ( fp , Operand ( sp ) ) ; / / setup new frame pointer <nl> <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> - mov ( ip , Operand ( 0 ) ) ; <nl> - } else { <nl> - mov ( ip , Operand ( CodeObject ( ) ) ) ; <nl> - } <nl> + / / Push debug marker . <nl> + mov ( ip , Operand ( type = = StackFrame : : EXIT_DEBUG ? 1 : 0 ) ) ; <nl> push ( ip ) ; <nl> <nl> / / Save the frame pointer and the context in top . <nl> void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode ) { <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> / / Save the state of all registers to the stack from the memory <nl> / / location . This is needed to allow nested break points . <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> + if ( type = = StackFrame : : EXIT_DEBUG ) { <nl> / / Use sp as base to push . <nl> CopyRegistersFromMemoryToStack ( sp , kJSCallerSaved ) ; <nl> } <nl> void MacroAssembler : : AlignStack ( int offset ) { <nl> } <nl> <nl> <nl> - void MacroAssembler : : LeaveExitFrame ( ExitFrame : : Mode mode ) { <nl> + void MacroAssembler : : LeaveExitFrame ( StackFrame : : Type type ) { <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> / / Restore the memory copy of the registers by digging them out from <nl> / / the stack . This is needed to allow nested break points . <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> + if ( type = = StackFrame : : EXIT_DEBUG ) { <nl> / / This code intentionally clobbers r2 and r3 . <nl> const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize ; <nl> - const int kOffset = ExitFrameConstants : : kCodeOffset - kCallerSavedSize ; <nl> + const int kOffset = ExitFrameConstants : : kDebugMarkOffset - kCallerSavedSize ; <nl> add ( r3 , fp , Operand ( kOffset ) ) ; <nl> CopyRegistersFromStackToMemory ( r3 , r2 , kJSCallerSaved ) ; <nl> } <nl> mmm a / src / arm / macro - assembler - arm . h <nl> ppp b / src / arm / macro - assembler - arm . h <nl> class MacroAssembler : public Assembler { <nl> void EnterConstructFrame ( ) { EnterFrame ( StackFrame : : CONSTRUCT ) ; } <nl> void LeaveConstructFrame ( ) { LeaveFrame ( StackFrame : : CONSTRUCT ) ; } <nl> <nl> - / / Enter specific kind of exit frame ; either normal or debug mode . <nl> - / / Expects the number of arguments in register r0 and <nl> + / / Enter specific kind of exit frame ; either EXIT or <nl> + / / EXIT_DEBUG . Expects the number of arguments in register r0 and <nl> / / the builtin function to call in register r1 . Exits with argc in <nl> / / r4 , argv in r6 , and and the builtin function to call in r5 . <nl> - void EnterExitFrame ( ExitFrame : : Mode mode ) ; <nl> + void EnterExitFrame ( StackFrame : : Type type ) ; <nl> <nl> / / Leave the current exit frame . Expects the return value in r0 . <nl> - void LeaveExitFrame ( ExitFrame : : Mode mode ) ; <nl> + void LeaveExitFrame ( StackFrame : : Type type ) ; <nl> <nl> / / Align the stack by optionally pushing a Smi zero . <nl> void AlignStack ( int offset ) ; <nl> mmm a / src / assembler . cc <nl> ppp b / src / assembler . cc <nl> ExternalReference : : ExternalReference ( Builtins : : CFunctionId id ) <nl> : address_ ( Redirect ( Builtins : : c_function_address ( id ) ) ) { } <nl> <nl> <nl> - ExternalReference : : ExternalReference ( ApiFunction * fun ) <nl> - : address_ ( Redirect ( fun - > address ( ) ) ) { } <nl> - <nl> - <nl> ExternalReference : : ExternalReference ( Builtins : : Name name ) <nl> : address_ ( Builtins : : builtin_address ( name ) ) { } <nl> <nl> ExternalReference ExternalReference : : new_space_allocation_limit_address ( ) { <nl> return ExternalReference ( Heap : : NewSpaceAllocationLimitAddress ( ) ) ; <nl> } <nl> <nl> - <nl> - ExternalReference ExternalReference : : handle_scope_extensions_address ( ) { <nl> - return ExternalReference ( HandleScope : : current_extensions_address ( ) ) ; <nl> - } <nl> - <nl> - <nl> - ExternalReference ExternalReference : : handle_scope_next_address ( ) { <nl> - return ExternalReference ( HandleScope : : current_next_address ( ) ) ; <nl> - } <nl> - <nl> - <nl> - ExternalReference ExternalReference : : handle_scope_limit_address ( ) { <nl> - return ExternalReference ( HandleScope : : current_limit_address ( ) ) ; <nl> - } <nl> - <nl> - <nl> - ExternalReference ExternalReference : : scheduled_exception_address ( ) { <nl> - return ExternalReference ( Top : : scheduled_exception_address ( ) ) ; <nl> - } <nl> - <nl> - <nl> # ifdef V8_NATIVE_REGEXP <nl> <nl> ExternalReference ExternalReference : : re_check_stack_guard_state ( ) { <nl> mmm a / src / assembler . h <nl> ppp b / src / assembler . h <nl> class ExternalReference BASE_EMBEDDED { <nl> public : <nl> explicit ExternalReference ( Builtins : : CFunctionId id ) ; <nl> <nl> - explicit ExternalReference ( ApiFunction * ptr ) ; <nl> - <nl> explicit ExternalReference ( Builtins : : Name name ) ; <nl> <nl> explicit ExternalReference ( Runtime : : FunctionId id ) ; <nl> class ExternalReference BASE_EMBEDDED { <nl> static ExternalReference double_fp_operation ( Token : : Value operation ) ; <nl> static ExternalReference compare_doubles ( ) ; <nl> <nl> - static ExternalReference handle_scope_extensions_address ( ) ; <nl> - static ExternalReference handle_scope_next_address ( ) ; <nl> - static ExternalReference handle_scope_limit_address ( ) ; <nl> - <nl> - static ExternalReference scheduled_exception_address ( ) ; <nl> - <nl> Address address ( ) const { return reinterpret_cast < Address > ( address_ ) ; } <nl> <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> mmm a / src / code - stubs . cc <nl> ppp b / src / code - stubs . cc <nl> namespace v8 { <nl> namespace internal { <nl> <nl> Handle < Code > CodeStub : : GetCode ( ) { <nl> - bool custom_cache = has_custom_cache ( ) ; <nl> - <nl> - int index = 0 ; <nl> - uint32_t key = 0 ; <nl> - if ( custom_cache ) { <nl> - Code * cached ; <nl> - if ( GetCustomCache ( & cached ) ) { <nl> - return Handle < Code > ( cached ) ; <nl> - } else { <nl> - index = NumberDictionary : : kNotFound ; <nl> - } <nl> - } else { <nl> - key = GetKey ( ) ; <nl> - index = Heap : : code_stubs ( ) - > FindEntry ( key ) ; <nl> - if ( index ! = NumberDictionary : : kNotFound ) <nl> - return Handle < Code > ( Code : : cast ( Heap : : code_stubs ( ) - > ValueAt ( index ) ) ) ; <nl> - } <nl> - <nl> - Code * result ; <nl> - { <nl> - v8 : : HandleScope scope ; <nl> + uint32_t key = GetKey ( ) ; <nl> + int index = Heap : : code_stubs ( ) - > FindEntry ( key ) ; <nl> + if ( index = = NumberDictionary : : kNotFound ) { <nl> + HandleScope scope ; <nl> <nl> / / Update the static counter each time a new code stub is generated . <nl> Counters : : code_stubs . Increment ( ) ; <nl> Handle < Code > CodeStub : : GetCode ( ) { <nl> } <nl> # endif <nl> <nl> - if ( custom_cache ) { <nl> - SetCustomCache ( * code ) ; <nl> - } else { <nl> - / / Update the dictionary and the root in Heap . <nl> - Handle < NumberDictionary > dict = <nl> - Factory : : DictionaryAtNumberPut ( <nl> - Handle < NumberDictionary > ( Heap : : code_stubs ( ) ) , <nl> - key , <nl> - code ) ; <nl> - Heap : : public_set_code_stubs ( * dict ) ; <nl> - } <nl> - result = * code ; <nl> + / / Update the dictionary and the root in Heap . <nl> + Handle < NumberDictionary > dict = <nl> + Factory : : DictionaryAtNumberPut ( <nl> + Handle < NumberDictionary > ( Heap : : code_stubs ( ) ) , <nl> + key , <nl> + code ) ; <nl> + Heap : : public_set_code_stubs ( * dict ) ; <nl> + index = Heap : : code_stubs ( ) - > FindEntry ( key ) ; <nl> } <nl> + ASSERT ( index ! = NumberDictionary : : kNotFound ) ; <nl> <nl> - return Handle < Code > ( result ) ; <nl> + return Handle < Code > ( Code : : cast ( Heap : : code_stubs ( ) - > ValueAt ( index ) ) ) ; <nl> } <nl> <nl> <nl> mmm a / src / code - stubs . h <nl> ppp b / src / code - stubs . h <nl> class CodeStub BASE_EMBEDDED { <nl> # define DEF_ENUM ( name ) name , <nl> CODE_STUB_LIST ( DEF_ENUM ) <nl> # undef DEF_ENUM <nl> - NoCache , / / marker for stubs that do custom caching <nl> NUMBER_OF_IDS <nl> } ; <nl> <nl> class CodeStub BASE_EMBEDDED { <nl> <nl> virtual ~ CodeStub ( ) { } <nl> <nl> - / / Override these methods to provide a custom caching mechanism for <nl> - / / an individual type of code stub . <nl> - virtual bool GetCustomCache ( Code * * code_out ) { return false ; } <nl> - virtual void SetCustomCache ( Code * value ) { } <nl> - virtual bool has_custom_cache ( ) { return false ; } <nl> - <nl> protected : <nl> static const int kMajorBits = 5 ; <nl> static const int kMinorBits = kBitsPerInt - kSmiTagSize - kMajorBits ; <nl> mmm a / src / codegen . cc <nl> ppp b / src / codegen . cc <nl> void ArgumentsAccessStub : : Generate ( MacroAssembler * masm ) { <nl> } <nl> <nl> <nl> - bool ApiGetterEntryStub : : GetCustomCache ( Code * * code_out ) { <nl> - Object * cache = info ( ) - > load_stub_cache ( ) ; <nl> - if ( cache - > IsUndefined ( ) ) { <nl> - return false ; <nl> - } else { <nl> - * code_out = Code : : cast ( cache ) ; <nl> - return true ; <nl> - } <nl> - } <nl> - <nl> - <nl> - void ApiGetterEntryStub : : SetCustomCache ( Code * value ) { <nl> - info ( ) - > set_load_stub_cache ( value ) ; <nl> - } <nl> - <nl> - <nl> } } / / namespace v8 : : internal <nl> mmm a / src / codegen . h <nl> ppp b / src / codegen . h <nl> class CEntryStub : public CodeStub { <nl> Label * throw_normal_exception , <nl> Label * throw_termination_exception , <nl> Label * throw_out_of_memory_exception , <nl> - ExitFrame : : Mode mode , <nl> + StackFrame : : Type frame_type , <nl> bool do_gc , <nl> bool always_allocate_scope ) ; <nl> void GenerateThrowTOS ( MacroAssembler * masm ) ; <nl> class CEntryStub : public CodeStub { <nl> } ; <nl> <nl> <nl> - class ApiGetterEntryStub : public CodeStub { <nl> - public : <nl> - ApiGetterEntryStub ( Handle < AccessorInfo > info , <nl> - ApiFunction * fun ) <nl> - : info_ ( info ) , <nl> - fun_ ( fun ) { } <nl> - void Generate ( MacroAssembler * masm ) ; <nl> - virtual bool has_custom_cache ( ) { return true ; } <nl> - virtual bool GetCustomCache ( Code * * code_out ) ; <nl> - virtual void SetCustomCache ( Code * value ) ; <nl> - <nl> - static const int kStackSpace = 6 ; <nl> - static const int kArgc = 4 ; <nl> - private : <nl> - Handle < AccessorInfo > info ( ) { return info_ ; } <nl> - ApiFunction * fun ( ) { return fun_ ; } <nl> - Major MajorKey ( ) { return NoCache ; } <nl> - int MinorKey ( ) { return 0 ; } <nl> - const char * GetName ( ) { return " ApiEntryStub " ; } <nl> - / / The accessor info associated with the function <nl> - Handle < AccessorInfo > info_ ; <nl> - / / The function to be called <nl> - ApiFunction * fun_ ; <nl> - } ; <nl> - <nl> - <nl> class CEntryDebugBreakStub : public CEntryStub { <nl> public : <nl> CEntryDebugBreakStub ( ) : CEntryStub ( 1 ) { } <nl> mmm a / src / frames . cc <nl> ppp b / src / frames . cc <nl> Code * EntryConstructFrame : : code ( ) const { <nl> <nl> <nl> Code * ExitFrame : : code ( ) const { <nl> - const int offset = ExitFrameConstants : : kCodeOffset ; <nl> - Object * code = Memory : : Object_at ( fp ( ) + offset ) ; <nl> - if ( code - > IsSmi ( ) ) { <nl> - return Heap : : c_entry_debug_break_code ( ) ; <nl> - } else { <nl> - return Code : : cast ( code ) ; <nl> - } <nl> + return Heap : : c_entry_code ( ) ; <nl> } <nl> <nl> <nl> Address ExitFrame : : GetCallerStackPointer ( ) const { <nl> } <nl> <nl> <nl> + Code * ExitDebugFrame : : code ( ) const { <nl> + return Heap : : c_entry_debug_break_code ( ) ; <nl> + } <nl> + <nl> + <nl> Address StandardFrame : : GetExpressionAddress ( int n ) const { <nl> const int offset = StandardFrameConstants : : kExpressionsOffset ; <nl> return fp ( ) + offset - n * kPointerSize ; <nl> mmm a / src / frames . h <nl> ppp b / src / frames . h <nl> class StackHandler BASE_EMBEDDED { <nl> V ( ENTRY , EntryFrame ) \ <nl> V ( ENTRY_CONSTRUCT , EntryConstructFrame ) \ <nl> V ( EXIT , ExitFrame ) \ <nl> + V ( EXIT_DEBUG , ExitDebugFrame ) \ <nl> V ( JAVA_SCRIPT , JavaScriptFrame ) \ <nl> V ( INTERNAL , InternalFrame ) \ <nl> V ( CONSTRUCT , ConstructFrame ) \ <nl> class StackFrame BASE_EMBEDDED { <nl> bool is_entry ( ) const { return type ( ) = = ENTRY ; } <nl> bool is_entry_construct ( ) const { return type ( ) = = ENTRY_CONSTRUCT ; } <nl> bool is_exit ( ) const { return type ( ) = = EXIT ; } <nl> + bool is_exit_debug ( ) const { return type ( ) = = EXIT_DEBUG ; } <nl> bool is_java_script ( ) const { return type ( ) = = JAVA_SCRIPT ; } <nl> bool is_arguments_adaptor ( ) const { return type ( ) = = ARGUMENTS_ADAPTOR ; } <nl> bool is_internal ( ) const { return type ( ) = = INTERNAL ; } <nl> class EntryConstructFrame : public EntryFrame { <nl> / / Exit frames are used to exit JavaScript execution and go to C . <nl> class ExitFrame : public StackFrame { <nl> public : <nl> - enum Mode { MODE_NORMAL , MODE_DEBUG } ; <nl> virtual Type type ( ) const { return EXIT ; } <nl> <nl> virtual Code * code ( ) const ; <nl> class ExitFrame : public StackFrame { <nl> } ; <nl> <nl> <nl> + class ExitDebugFrame : public ExitFrame { <nl> + public : <nl> + virtual Type type ( ) const { return EXIT_DEBUG ; } <nl> + <nl> + virtual Code * code ( ) const ; <nl> + <nl> + static ExitDebugFrame * cast ( StackFrame * frame ) { <nl> + ASSERT ( frame - > is_exit_debug ( ) ) ; <nl> + return static_cast < ExitDebugFrame * > ( frame ) ; <nl> + } <nl> + <nl> + protected : <nl> + explicit ExitDebugFrame ( StackFrameIterator * iterator ) <nl> + : ExitFrame ( iterator ) { } <nl> + <nl> + private : <nl> + friend class StackFrameIterator ; <nl> + } ; <nl> + <nl> + <nl> class StandardFrame : public StackFrame { <nl> public : <nl> / / Testers . <nl> mmm a / src / handles . cc <nl> ppp b / src / handles . cc <nl> void HandleScope : : ZapRange ( Object * * start , Object * * end ) { <nl> } <nl> <nl> <nl> - Address HandleScope : : current_extensions_address ( ) { <nl> - return reinterpret_cast < Address > ( & current_ . extensions ) ; <nl> - } <nl> - <nl> - <nl> - Address HandleScope : : current_next_address ( ) { <nl> - return reinterpret_cast < Address > ( & current_ . next ) ; <nl> - } <nl> - <nl> - <nl> - Address HandleScope : : current_limit_address ( ) { <nl> - return reinterpret_cast < Address > ( & current_ . limit ) ; <nl> - } <nl> - <nl> - <nl> Handle < FixedArray > AddKeysFromJSArray ( Handle < FixedArray > content , <nl> Handle < JSArray > array ) { <nl> CALL_HEAP_FUNCTION ( content - > AddKeysFromJSArray ( * array ) , FixedArray ) ; <nl> mmm a / src / handles . h <nl> ppp b / src / handles . h <nl> class HandleScope { <nl> return result ; <nl> } <nl> <nl> - / / Deallocates any extensions used by the current scope . <nl> - static void DeleteExtensions ( ) ; <nl> - <nl> - static Address current_extensions_address ( ) ; <nl> - static Address current_next_address ( ) ; <nl> - static Address current_limit_address ( ) ; <nl> - <nl> private : <nl> / / Prevent heap allocation or illegal handle scopes . <nl> HandleScope ( const HandleScope & ) ; <nl> class HandleScope { <nl> / / Extend the handle scope making room for more handles . <nl> static internal : : Object * * Extend ( ) ; <nl> <nl> + / / Deallocates any extensions used by the current scope . <nl> + static void DeleteExtensions ( ) ; <nl> + <nl> / / Zaps the handles in the half - open interval [ start , end ) . <nl> static void ZapRange ( internal : : Object * * start , internal : : Object * * end ) ; <nl> <nl> mmm a / src / ia32 / codegen - ia32 . cc <nl> ppp b / src / ia32 / codegen - ia32 . cc <nl> void CEntryStub : : GenerateThrowTOS ( MacroAssembler * masm ) { <nl> } <nl> <nl> <nl> - void ApiGetterEntryStub : : Generate ( MacroAssembler * masm ) { <nl> - Label get_result ; <nl> - Label prologue ; <nl> - Label promote_scheduled_exception ; <nl> - __ EnterApiExitFrame ( ExitFrame : : MODE_NORMAL , kStackSpace , kArgc ) ; <nl> - ASSERT_EQ ( kArgc , 4 ) ; <nl> - / / The function expects three arguments to be passed but we allocate <nl> - / / four to get space for the output cell . The argument slots are filled <nl> - / / as follows : <nl> - / / <nl> - / / 3 : output cell <nl> - / / 2 : arguments pointer <nl> - / / 1 : name <nl> - / / 0 : pointer to the output cell <nl> - / / <nl> - / / Note that this is one more " argument " than the function expects <nl> - / / so the out cell will have to be popped explicitly after returning <nl> - / / from the function . <nl> - __ mov ( Operand ( esp , 1 * kPointerSize ) , ebx ) ; / / name . <nl> - __ mov ( Operand ( esp , 2 * kPointerSize ) , eax ) ; / / arguments pointer . <nl> - __ mov ( ebx , esp ) ; <nl> - __ add ( Operand ( ebx ) , Immediate ( 3 * kPointerSize ) ) ; <nl> - __ mov ( Operand ( esp , 0 * kPointerSize ) , ebx ) ; / / output <nl> - __ mov ( Operand ( esp , 3 * kPointerSize ) , Immediate ( 0 ) ) ; / / out cell . <nl> - __ mov ( eax , Immediate ( ExternalReference ( fun ( ) ) ) ) ; <nl> - / / Call the api function ! <nl> - __ call ( Operand ( eax ) ) ; <nl> - / / Check if the function scheduled an exception . <nl> - ExternalReference scheduled_exception_address = <nl> - ExternalReference : : scheduled_exception_address ( ) ; <nl> - __ cmp ( Operand : : StaticVariable ( scheduled_exception_address ) , <nl> - Immediate ( Factory : : the_hole_value ( ) ) ) ; <nl> - __ j ( not_equal , & promote_scheduled_exception , not_taken ) ; <nl> - / / The returned value is a pointer to the handle holding the result . <nl> - / / Dereference this to get to the handle . <nl> - __ mov ( eax , Operand ( eax , 0 ) ) ; <nl> - / / Check if the result handle holds 0 <nl> - __ test ( eax , Operand ( eax ) ) ; <nl> - __ j ( not_zero , & get_result , taken ) ; <nl> - / / It was zero ; the result is undefined . <nl> - __ mov ( eax , Factory : : undefined_value ( ) ) ; <nl> - __ jmp ( & prologue ) ; <nl> - / / It was non - zero . Dereference to get the result value . <nl> - __ bind ( & get_result ) ; <nl> - __ mov ( eax , Operand ( eax , 0 ) ) ; <nl> - __ bind ( & prologue ) ; <nl> - __ LeaveExitFrame ( ExitFrame : : MODE_NORMAL ) ; <nl> - __ ret ( 0 ) ; <nl> - __ bind ( & promote_scheduled_exception ) ; <nl> - __ TailCallRuntime ( ExternalReference ( Runtime : : kPromoteScheduledException ) , <nl> - 0 , <nl> - 1 ) ; <nl> - } <nl> - <nl> - <nl> void CEntryStub : : GenerateCore ( MacroAssembler * masm , <nl> Label * throw_normal_exception , <nl> Label * throw_termination_exception , <nl> Label * throw_out_of_memory_exception , <nl> - ExitFrame : : Mode mode , <nl> + StackFrame : : Type frame_type , <nl> bool do_gc , <nl> bool always_allocate_scope ) { <nl> / / eax : result parameter for PerformGC , if any <nl> void CEntryStub : : GenerateCore ( MacroAssembler * masm , <nl> __ j ( zero , & failure_returned , not_taken ) ; <nl> <nl> / / Exit the JavaScript to C + + exit frame . <nl> - __ LeaveExitFrame ( mode ) ; <nl> + __ LeaveExitFrame ( frame_type ) ; <nl> __ ret ( 0 ) ; <nl> <nl> / / Handling of failure . <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> / / of a proper result . The builtin entry handles this by performing <nl> / / a garbage collection and retrying the builtin ( twice ) . <nl> <nl> - ExitFrame : : Mode mode = is_debug_break <nl> - ? ExitFrame : : MODE_DEBUG <nl> - : ExitFrame : : MODE_NORMAL ; <nl> + StackFrame : : Type frame_type = is_debug_break ? <nl> + StackFrame : : EXIT_DEBUG : <nl> + StackFrame : : EXIT ; <nl> <nl> / / Enter the exit frame that transitions from JavaScript to C + + . <nl> - __ EnterExitFrame ( mode ) ; <nl> + __ EnterExitFrame ( frame_type ) ; <nl> <nl> / / eax : result parameter for PerformGC , if any ( setup below ) <nl> / / ebx : pointer to builtin function ( C callee - saved ) <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> false , <nl> false ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> true , <nl> false ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> true , <nl> true ) ; <nl> <nl> mmm a / src / ia32 / frames - ia32 . cc <nl> ppp b / src / ia32 / frames - ia32 . cc <nl> StackFrame : : Type ExitFrame : : GetStateForFramePointer ( Address fp , State * state ) { <nl> state - > fp = fp ; <nl> state - > sp = sp ; <nl> state - > pc_address = reinterpret_cast < Address * > ( sp - 1 * kPointerSize ) ; <nl> - return EXIT ; <nl> + / / Determine frame type . <nl> + if ( Memory : : Address_at ( fp + ExitFrameConstants : : kDebugMarkOffset ) ! = 0 ) { <nl> + return EXIT_DEBUG ; <nl> + } else { <nl> + return EXIT ; <nl> + } <nl> } <nl> <nl> <nl> mmm a / src / ia32 / frames - ia32 . h <nl> ppp b / src / ia32 / frames - ia32 . h <nl> class EntryFrameConstants : public AllStatic { <nl> <nl> class ExitFrameConstants : public AllStatic { <nl> public : <nl> - static const int kCodeOffset = - 2 * kPointerSize ; <nl> + static const int kDebugMarkOffset = - 2 * kPointerSize ; <nl> static const int kSPOffset = - 1 * kPointerSize ; <nl> <nl> static const int kCallerFPOffset = 0 * kPointerSize ; <nl> mmm a / src / ia32 / macro - assembler - ia32 . cc <nl> ppp b / src / ia32 / macro - assembler - ia32 . cc <nl> void MacroAssembler : : LeaveFrame ( StackFrame : : Type type ) { <nl> leave ( ) ; <nl> } <nl> <nl> - void MacroAssembler : : EnterExitFramePrologue ( ExitFrame : : Mode mode ) { <nl> + <nl> + void MacroAssembler : : EnterExitFrame ( StackFrame : : Type type ) { <nl> + ASSERT ( type = = StackFrame : : EXIT | | type = = StackFrame : : EXIT_DEBUG ) ; <nl> + <nl> / / Setup the frame structure on the stack . <nl> ASSERT ( ExitFrameConstants : : kCallerSPDisplacement = = + 2 * kPointerSize ) ; <nl> ASSERT ( ExitFrameConstants : : kCallerPCOffset = = + 1 * kPointerSize ) ; <nl> void MacroAssembler : : EnterExitFramePrologue ( ExitFrame : : Mode mode ) { <nl> / / Reserve room for entry stack pointer and push the debug marker . <nl> ASSERT ( ExitFrameConstants : : kSPOffset = = - 1 * kPointerSize ) ; <nl> push ( Immediate ( 0 ) ) ; / / saved entry sp , patched before call <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> - push ( Immediate ( 0 ) ) ; <nl> - } else { <nl> - push ( Immediate ( CodeObject ( ) ) ) ; <nl> - } <nl> + push ( Immediate ( type = = StackFrame : : EXIT_DEBUG ? 1 : 0 ) ) ; <nl> <nl> / / Save the frame pointer and the context in top . <nl> ExternalReference c_entry_fp_address ( Top : : k_c_entry_fp_address ) ; <nl> ExternalReference context_address ( Top : : k_context_address ) ; <nl> mov ( Operand : : StaticVariable ( c_entry_fp_address ) , ebp ) ; <nl> mov ( Operand : : StaticVariable ( context_address ) , esi ) ; <nl> - } <nl> <nl> - void MacroAssembler : : EnterExitFrameEpilogue ( ExitFrame : : Mode mode , int argc ) { <nl> + / / Setup argc and argv in callee - saved registers . <nl> + int offset = StandardFrameConstants : : kCallerSPOffset - kPointerSize ; <nl> + mov ( edi , Operand ( eax ) ) ; <nl> + lea ( esi , Operand ( ebp , eax , times_4 , offset ) ) ; <nl> + <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> / / Save the state of all registers to the stack from the memory <nl> / / location . This is needed to allow nested break points . <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> + if ( type = = StackFrame : : EXIT_DEBUG ) { <nl> / / TODO ( 1243899 ) : This should be symmetric to <nl> / / CopyRegistersFromStackToMemory ( ) but it isn ' t ! esp is assumed <nl> / / correct here , but computed for the other call . Very error <nl> void MacroAssembler : : EnterExitFrameEpilogue ( ExitFrame : : Mode mode , int argc ) { <nl> } <nl> # endif <nl> <nl> - / / Reserve space for arguments . <nl> - sub ( Operand ( esp ) , Immediate ( argc * kPointerSize ) ) ; <nl> + / / Reserve space for two arguments : argc and argv . <nl> + sub ( Operand ( esp ) , Immediate ( 2 * kPointerSize ) ) ; <nl> <nl> / / Get the required frame alignment for the OS . <nl> static const int kFrameAlignment = OS : : ActivationFrameAlignment ( ) ; <nl> void MacroAssembler : : EnterExitFrameEpilogue ( ExitFrame : : Mode mode , int argc ) { <nl> } <nl> <nl> <nl> - void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode ) { <nl> - EnterExitFramePrologue ( mode ) ; <nl> - <nl> - / / Setup argc and argv in callee - saved registers . <nl> - int offset = StandardFrameConstants : : kCallerSPOffset - kPointerSize ; <nl> - mov ( edi , Operand ( eax ) ) ; <nl> - lea ( esi , Operand ( ebp , eax , times_4 , offset ) ) ; <nl> - <nl> - EnterExitFrameEpilogue ( mode , 2 ) ; <nl> - } <nl> - <nl> - <nl> - void MacroAssembler : : EnterApiExitFrame ( ExitFrame : : Mode mode , <nl> - int stack_space , <nl> - int argc ) { <nl> - EnterExitFramePrologue ( mode ) ; <nl> - <nl> - int offset = StandardFrameConstants : : kCallerSPOffset - kPointerSize ; <nl> - lea ( esi , Operand ( ebp , ( stack_space * kPointerSize ) + offset ) ) ; <nl> - <nl> - EnterExitFrameEpilogue ( mode , argc ) ; <nl> - } <nl> - <nl> - <nl> - void MacroAssembler : : LeaveExitFrame ( ExitFrame : : Mode mode ) { <nl> + void MacroAssembler : : LeaveExitFrame ( StackFrame : : Type type ) { <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> / / Restore the memory copy of the registers by digging them out from <nl> / / the stack . This is needed to allow nested break points . <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> + if ( type = = StackFrame : : EXIT_DEBUG ) { <nl> / / It ' s okay to clobber register ebx below because we don ' t need <nl> / / the function pointer after this . <nl> const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize ; <nl> - int kOffset = ExitFrameConstants : : kCodeOffset - kCallerSavedSize ; <nl> + int kOffset = ExitFrameConstants : : kDebugMarkOffset - kCallerSavedSize ; <nl> lea ( ebx , Operand ( ebp , kOffset ) ) ; <nl> CopyRegistersFromStackToMemory ( ebx , ecx , kJSCallerSaved ) ; <nl> } <nl> void MacroAssembler : : TailCallRuntime ( const ExternalReference & ext , <nl> } <nl> <nl> <nl> - void MacroAssembler : : PushHandleScope ( Register scratch ) { <nl> - / / Push the number of extensions , smi - tagged for make benefit the gc . <nl> - ExternalReference extensions_address = <nl> - ExternalReference : : handle_scope_extensions_address ( ) ; <nl> - mov ( scratch , Operand : : StaticVariable ( extensions_address ) ) ; <nl> - shl ( scratch , kSmiTagSize ) ; <nl> - push ( scratch ) ; <nl> - mov ( Operand : : StaticVariable ( extensions_address ) , Immediate ( 0 ) ) ; <nl> - / / Push next and limit pointers which will be wordsize aligned and <nl> - / / hence automatically smi tagged . <nl> - ExternalReference next_address = <nl> - ExternalReference : : handle_scope_next_address ( ) ; <nl> - push ( Operand : : StaticVariable ( next_address ) ) ; <nl> - ExternalReference limit_address = <nl> - ExternalReference : : handle_scope_limit_address ( ) ; <nl> - push ( Operand : : StaticVariable ( limit_address ) ) ; <nl> - } <nl> - <nl> - <nl> - void MacroAssembler : : PopHandleScope ( Register scratch ) { <nl> - ExternalReference extensions_address = <nl> - ExternalReference : : handle_scope_extensions_address ( ) ; <nl> - Label write_back ; <nl> - mov ( scratch , Operand : : StaticVariable ( extensions_address ) ) ; <nl> - cmp ( Operand ( scratch ) , Immediate ( 0 ) ) ; <nl> - j ( equal , & write_back ) ; <nl> - CallRuntime ( Runtime : : kDeleteHandleScopeExtensions , 0 ) ; <nl> - <nl> - bind ( & write_back ) ; <nl> - ExternalReference limit_address = <nl> - ExternalReference : : handle_scope_limit_address ( ) ; <nl> - pop ( Operand : : StaticVariable ( limit_address ) ) ; <nl> - ExternalReference next_address = <nl> - ExternalReference : : handle_scope_next_address ( ) ; <nl> - pop ( Operand : : StaticVariable ( next_address ) ) ; <nl> - pop ( scratch ) ; <nl> - shr ( scratch , kSmiTagSize ) ; <nl> - mov ( Operand : : StaticVariable ( extensions_address ) , scratch ) ; <nl> - } <nl> - <nl> - <nl> void MacroAssembler : : JumpToRuntime ( const ExternalReference & ext ) { <nl> / / Set the entry point and jump to the C entry runtime stub . <nl> mov ( ebx , Immediate ( ext ) ) ; <nl> mmm a / src / ia32 / macro - assembler - ia32 . h <nl> ppp b / src / ia32 / macro - assembler - ia32 . h <nl> class MacroAssembler : public Assembler { <nl> / / EXIT_DEBUG . Expects the number of arguments in register eax and <nl> / / sets up the number of arguments in register edi and the pointer <nl> / / to the first argument in register esi . <nl> - void EnterExitFrame ( ExitFrame : : Mode mode ) ; <nl> - <nl> - void EnterApiExitFrame ( ExitFrame : : Mode mode , int stack_space , int argc ) ; <nl> + void EnterExitFrame ( StackFrame : : Type type ) ; <nl> <nl> / / Leave the current exit frame . Expects the return value in <nl> / / register eax : edx ( untouched ) and the pointer to the first <nl> / / argument in register esi . <nl> - void LeaveExitFrame ( ExitFrame : : Mode mode ) ; <nl> + void LeaveExitFrame ( StackFrame : : Type type ) ; <nl> <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> class MacroAssembler : public Assembler { <nl> int num_arguments , <nl> int result_size ) ; <nl> <nl> - void PushHandleScope ( Register scratch ) ; <nl> - void PopHandleScope ( Register scratch ) ; <nl> - <nl> / / Jump to a runtime routine . <nl> void JumpToRuntime ( const ExternalReference & ext ) ; <nl> <nl> class MacroAssembler : public Assembler { <nl> void EnterFrame ( StackFrame : : Type type ) ; <nl> void LeaveFrame ( StackFrame : : Type type ) ; <nl> <nl> - void EnterExitFramePrologue ( ExitFrame : : Mode mode ) ; <nl> - void EnterExitFrameEpilogue ( ExitFrame : : Mode mode , int argc ) ; <nl> - <nl> / / Allocation support helpers . <nl> void LoadAllocationTopHelper ( Register result , <nl> Register result_end , <nl> mmm a / src / ia32 / stub - cache - ia32 . cc <nl> ppp b / src / ia32 / stub - cache - ia32 . cc <nl> void StubCompiler : : GenerateLoadCallback ( JSObject * object , <nl> CheckPrototypes ( object , receiver , holder , <nl> scratch1 , scratch2 , name , miss ) ; <nl> <nl> - Handle < AccessorInfo > callback_handle ( callback ) ; <nl> - <nl> - Register other = reg . is ( scratch1 ) ? scratch2 : scratch1 ; <nl> - __ EnterInternalFrame ( ) ; <nl> - __ PushHandleScope ( other ) ; <nl> - / / Push the stack address where the list of arguments ends <nl> - __ mov ( other , esp ) ; <nl> - __ sub ( Operand ( other ) , Immediate ( 2 * kPointerSize ) ) ; <nl> - __ push ( other ) ; <nl> + / / Push the arguments on the JS stack of the caller . <nl> + __ pop ( scratch2 ) ; / / remove return address <nl> __ push ( receiver ) ; / / receiver <nl> __ push ( reg ) ; / / holder <nl> - __ mov ( other , Immediate ( callback_handle ) ) ; <nl> - __ push ( other ) ; <nl> - __ push ( FieldOperand ( other , AccessorInfo : : kDataOffset ) ) ; / / data <nl> + __ mov ( reg , Immediate ( Handle < AccessorInfo > ( callback ) ) ) ; / / callback data <nl> + __ push ( reg ) ; <nl> + __ push ( FieldOperand ( reg , AccessorInfo : : kDataOffset ) ) ; <nl> __ push ( name_reg ) ; / / name <nl> - / / Save a pointer to where we pushed the arguments pointer . <nl> - / / This will be passed as the const Arguments & to the C + + callback . <nl> - __ mov ( eax , esp ) ; <nl> - __ add ( Operand ( eax ) , Immediate ( 5 * kPointerSize ) ) ; <nl> - __ mov ( ebx , esp ) ; <nl> - <nl> - / / Do call through the api . <nl> - ASSERT_EQ ( 6 , ApiGetterEntryStub : : kStackSpace ) ; <nl> - Address getter_address = v8 : : ToCData < Address > ( callback - > getter ( ) ) ; <nl> - ApiFunction fun ( getter_address ) ; <nl> - ApiGetterEntryStub stub ( callback_handle , & fun ) ; <nl> - __ CallStub ( & stub ) ; <nl> + __ push ( scratch2 ) ; / / restore return address <nl> <nl> - Register tmp = other . is ( eax ) ? reg : other ; <nl> - __ PopHandleScope ( tmp ) ; <nl> - __ LeaveInternalFrame ( ) ; <nl> - <nl> - __ ret ( 0 ) ; <nl> + / / Do tail - call to the runtime system . <nl> + ExternalReference load_callback_property = <nl> + ExternalReference ( IC_Utility ( IC : : kLoadCallbackProperty ) ) ; <nl> + __ TailCallRuntime ( load_callback_property , 5 , 1 ) ; <nl> } <nl> <nl> <nl> mmm a / src / objects - debug . cc <nl> ppp b / src / objects - debug . cc <nl> void AccessorInfo : : AccessorInfoVerify ( ) { <nl> VerifyPointer ( name ( ) ) ; <nl> VerifyPointer ( data ( ) ) ; <nl> VerifyPointer ( flag ( ) ) ; <nl> - VerifyPointer ( load_stub_cache ( ) ) ; <nl> } <nl> <nl> void AccessorInfo : : AccessorInfoPrint ( ) { <nl> mmm a / src / objects - inl . h <nl> ppp b / src / objects - inl . h <nl> ACCESSORS ( AccessorInfo , setter , Object , kSetterOffset ) <nl> ACCESSORS ( AccessorInfo , data , Object , kDataOffset ) <nl> ACCESSORS ( AccessorInfo , name , Object , kNameOffset ) <nl> ACCESSORS ( AccessorInfo , flag , Smi , kFlagOffset ) <nl> - ACCESSORS ( AccessorInfo , load_stub_cache , Object , kLoadStubCacheOffset ) <nl> <nl> ACCESSORS ( AccessCheckInfo , named_callback , Object , kNamedCallbackOffset ) <nl> ACCESSORS ( AccessCheckInfo , indexed_callback , Object , kIndexedCallbackOffset ) <nl> mmm a / src / objects . h <nl> ppp b / src / objects . h <nl> class AccessorInfo : public Struct { <nl> DECL_ACCESSORS ( data , Object ) <nl> DECL_ACCESSORS ( name , Object ) <nl> DECL_ACCESSORS ( flag , Smi ) <nl> - DECL_ACCESSORS ( load_stub_cache , Object ) <nl> <nl> inline bool all_can_read ( ) ; <nl> inline void set_all_can_read ( bool value ) ; <nl> class AccessorInfo : public Struct { <nl> static const int kDataOffset = kSetterOffset + kPointerSize ; <nl> static const int kNameOffset = kDataOffset + kPointerSize ; <nl> static const int kFlagOffset = kNameOffset + kPointerSize ; <nl> - static const int kLoadStubCacheOffset = kFlagOffset + kPointerSize ; <nl> - static const int kSize = kLoadStubCacheOffset + kPointerSize ; <nl> + static const int kSize = kFlagOffset + kPointerSize ; <nl> <nl> private : <nl> / / Bit positions in flag . <nl> mmm a / src / runtime . cc <nl> ppp b / src / runtime . cc <nl> static Object * Runtime_ReThrow ( Arguments args ) { <nl> } <nl> <nl> <nl> - static Object * Runtime_PromoteScheduledException ( Arguments args ) { <nl> - ASSERT_EQ ( 0 , args . length ( ) ) ; <nl> - return Top : : PromoteScheduledException ( ) ; <nl> - } <nl> - <nl> - <nl> static Object * Runtime_ThrowReferenceError ( Arguments args ) { <nl> HandleScope scope ; <nl> ASSERT ( args . length ( ) = = 1 ) ; <nl> static Object * Runtime_Abort ( Arguments args ) { <nl> } <nl> <nl> <nl> - static Object * Runtime_DeleteHandleScopeExtensions ( Arguments args ) { <nl> - ASSERT ( args . length ( ) = = 0 ) ; <nl> - HandleScope : : DeleteExtensions ( ) ; <nl> - return Heap : : undefined_value ( ) ; <nl> - } <nl> - <nl> - <nl> # ifdef DEBUG <nl> / / ListNatives is ONLY used by the fuzz - natives . js in debug mode <nl> / / Exclude the code in release mode . <nl> mmm a / src / runtime . h <nl> ppp b / src / runtime . h <nl> namespace internal { <nl> F ( ReThrow , 1 , 1 ) \ <nl> F ( ThrowReferenceError , 1 , 1 ) \ <nl> F ( StackGuard , 1 , 1 ) \ <nl> - F ( PromoteScheduledException , 0 , 1 ) \ <nl> \ <nl> / * Contexts * / \ <nl> F ( NewContext , 1 , 1 ) \ <nl> namespace internal { <nl> F ( Log , 2 , 1 ) \ <nl> / * ES5 * / \ <nl> F ( LocalKeys , 1 , 1 ) \ <nl> - / * Handle scopes * / \ <nl> - F ( DeleteHandleScopeExtensions , 0 , 1 ) \ <nl> \ <nl> / * Pseudo functions - handled as macros by parser * / \ <nl> F ( IS_VAR , 1 , 1 ) <nl> mmm a / src / stub - cache . cc <nl> ppp b / src / stub - cache . cc <nl> Handle < Code > ComputeCallMiss ( int argc ) { <nl> <nl> <nl> Object * LoadCallbackProperty ( Arguments args ) { <nl> - ASSERT ( args [ 0 ] - > IsJSObject ( ) ) ; <nl> - ASSERT ( args [ 1 ] - > IsJSObject ( ) ) ; <nl> AccessorInfo * callback = AccessorInfo : : cast ( args [ 2 ] ) ; <nl> Address getter_address = v8 : : ToCData < Address > ( callback - > getter ( ) ) ; <nl> v8 : : AccessorGetter fun = FUNCTION_CAST < v8 : : AccessorGetter > ( getter_address ) ; <nl> ASSERT ( fun ! = NULL ) ; <nl> - CustomArguments custom_args ( callback - > data ( ) , <nl> - JSObject : : cast ( args [ 0 ] ) , <nl> - JSObject : : cast ( args [ 1 ] ) ) ; <nl> - v8 : : AccessorInfo info ( custom_args . end ( ) ) ; <nl> + v8 : : AccessorInfo info ( args . arguments ( ) ) ; <nl> HandleScope scope ; <nl> v8 : : Handle < v8 : : Value > result ; <nl> { <nl> mmm a / src / top . h <nl> ppp b / src / top . h <nl> class Top { <nl> return & thread_local_ . external_caught_exception_ ; <nl> } <nl> <nl> - static Object * * scheduled_exception_address ( ) { <nl> - return & thread_local_ . scheduled_exception_ ; <nl> - } <nl> - <nl> static Object * scheduled_exception ( ) { <nl> ASSERT ( has_scheduled_exception ( ) ) ; <nl> return thread_local_ . scheduled_exception_ ; <nl> mmm a / src / x64 / codegen - x64 . cc <nl> ppp b / src / x64 / codegen - x64 . cc <nl> void CEntryStub : : GenerateCore ( MacroAssembler * masm , <nl> Label * throw_normal_exception , <nl> Label * throw_termination_exception , <nl> Label * throw_out_of_memory_exception , <nl> - ExitFrame : : Mode mode , <nl> + StackFrame : : Type frame_type , <nl> bool do_gc , <nl> bool always_allocate_scope ) { <nl> / / rax : result parameter for PerformGC , if any . <nl> void CEntryStub : : GenerateCore ( MacroAssembler * masm , <nl> __ j ( zero , & failure_returned ) ; <nl> <nl> / / Exit the JavaScript to C + + exit frame . <nl> - __ LeaveExitFrame ( mode , result_size_ ) ; <nl> + __ LeaveExitFrame ( frame_type , result_size_ ) ; <nl> __ ret ( 0 ) ; <nl> <nl> / / Handling of failure . <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> / / this by performing a garbage collection and retrying the <nl> / / builtin once . <nl> <nl> - ExitFrame : : Mode mode = is_debug_break ? <nl> - ExitFrame : : MODE_DEBUG : <nl> - ExitFrame : : MODE_NORMAL ; <nl> + StackFrame : : Type frame_type = is_debug_break ? <nl> + StackFrame : : EXIT_DEBUG : <nl> + StackFrame : : EXIT ; <nl> <nl> / / Enter the exit frame that transitions from JavaScript to C + + . <nl> - __ EnterExitFrame ( mode , result_size_ ) ; <nl> + __ EnterExitFrame ( frame_type , result_size_ ) ; <nl> <nl> / / rax : Holds the context at this point , but should not be used . <nl> / / On entry to code generated by GenerateCore , it must hold <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> false , <nl> false ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> true , <nl> false ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> & throw_normal_exception , <nl> & throw_termination_exception , <nl> & throw_out_of_memory_exception , <nl> - mode , <nl> + frame_type , <nl> true , <nl> true ) ; <nl> <nl> void CEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_debug_break ) { <nl> } <nl> <nl> <nl> - void ApiGetterEntryStub : : Generate ( MacroAssembler * masm ) { <nl> - UNREACHABLE ( ) ; <nl> - } <nl> - <nl> - <nl> void JSEntryStub : : GenerateBody ( MacroAssembler * masm , bool is_construct ) { <nl> Label invoke , exit ; <nl> # ifdef ENABLE_LOGGING_AND_PROFILING <nl> mmm a / src / x64 / frames - x64 . cc <nl> ppp b / src / x64 / frames - x64 . cc <nl> StackFrame : : Type ExitFrame : : GetStateForFramePointer ( Address fp , State * state ) { <nl> state - > sp = sp ; <nl> state - > pc_address = reinterpret_cast < Address * > ( sp - 1 * kPointerSize ) ; <nl> / / Determine frame type . <nl> - return EXIT ; <nl> + if ( Memory : : Address_at ( fp + ExitFrameConstants : : kDebugMarkOffset ) ! = 0 ) { <nl> + return EXIT_DEBUG ; <nl> + } else { <nl> + return EXIT ; <nl> + } <nl> } <nl> <nl> int JavaScriptFrame : : GetProvidedParametersCount ( ) const { <nl> mmm a / src / x64 / frames - x64 . h <nl> ppp b / src / x64 / frames - x64 . h <nl> class EntryFrameConstants : public AllStatic { <nl> <nl> class ExitFrameConstants : public AllStatic { <nl> public : <nl> - static const int kCodeOffset = - 2 * kPointerSize ; <nl> + static const int kDebugMarkOffset = - 2 * kPointerSize ; <nl> static const int kSPOffset = - 1 * kPointerSize ; <nl> <nl> static const int kCallerFPOffset = + 0 * kPointerSize ; <nl> mmm a / src / x64 / macro - assembler - x64 . cc <nl> ppp b / src / x64 / macro - assembler - x64 . cc <nl> void MacroAssembler : : LeaveFrame ( StackFrame : : Type type ) { <nl> } <nl> <nl> <nl> - void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode , int result_size ) { <nl> + void MacroAssembler : : EnterExitFrame ( StackFrame : : Type type , int result_size ) { <nl> + ASSERT ( type = = StackFrame : : EXIT | | type = = StackFrame : : EXIT_DEBUG ) ; <nl> + <nl> / / Setup the frame structure on the stack . <nl> / / All constants are relative to the frame pointer of the exit frame . <nl> ASSERT ( ExitFrameConstants : : kCallerSPDisplacement = = + 2 * kPointerSize ) ; <nl> void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode , int result_size ) { <nl> / / Reserve room for entry stack pointer and push the debug marker . <nl> ASSERT ( ExitFrameConstants : : kSPOffset = = - 1 * kPointerSize ) ; <nl> push ( Immediate ( 0 ) ) ; / / saved entry sp , patched before call <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> - push ( Immediate ( 0 ) ) ; <nl> - } else { <nl> - movq ( kScratchRegister , CodeObject ( ) , RelocInfo : : EMBEDDED_OBJECT ) ; <nl> - push ( kScratchRegister ) ; <nl> - } <nl> + push ( Immediate ( type = = StackFrame : : EXIT_DEBUG ? 1 : 0 ) ) ; <nl> <nl> / / Save the frame pointer and the context in top . <nl> ExternalReference c_entry_fp_address ( Top : : k_c_entry_fp_address ) ; <nl> void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode , int result_size ) { <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> / / Save the state of all registers to the stack from the memory <nl> / / location . This is needed to allow nested break points . <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> + if ( type = = StackFrame : : EXIT_DEBUG ) { <nl> / / TODO ( 1243899 ) : This should be symmetric to <nl> / / CopyRegistersFromStackToMemory ( ) but it isn ' t ! esp is assumed <nl> / / correct here , but computed for the other call . Very error <nl> void MacroAssembler : : EnterExitFrame ( ExitFrame : : Mode mode , int result_size ) { <nl> } <nl> <nl> <nl> - void MacroAssembler : : LeaveExitFrame ( ExitFrame : : Mode mode , int result_size ) { <nl> + void MacroAssembler : : LeaveExitFrame ( StackFrame : : Type type , int result_size ) { <nl> / / Registers : <nl> / / r15 : argv <nl> # ifdef ENABLE_DEBUGGER_SUPPORT <nl> / / Restore the memory copy of the registers by digging them out from <nl> / / the stack . This is needed to allow nested break points . <nl> - if ( mode = = ExitFrame : : MODE_DEBUG ) { <nl> + if ( type = = StackFrame : : EXIT_DEBUG ) { <nl> / / It ' s okay to clobber register rbx below because we don ' t need <nl> / / the function pointer after this . <nl> const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize ; <nl> - int kOffset = ExitFrameConstants : : kCodeOffset - kCallerSavedSize ; <nl> + int kOffset = ExitFrameConstants : : kDebugMarkOffset - kCallerSavedSize ; <nl> lea ( rbx , Operand ( rbp , kOffset ) ) ; <nl> CopyRegistersFromStackToMemory ( rbx , rcx , kJSCallerSaved ) ; <nl> } <nl> mmm a / src / x64 / macro - assembler - x64 . h <nl> ppp b / src / x64 / macro - assembler - x64 . h <nl> class MacroAssembler : public Assembler { <nl> void EnterConstructFrame ( ) { EnterFrame ( StackFrame : : CONSTRUCT ) ; } <nl> void LeaveConstructFrame ( ) { LeaveFrame ( StackFrame : : CONSTRUCT ) ; } <nl> <nl> - / / Enter specific kind of exit frame ; either in normal or <nl> - / / debug mode . Expects the number of arguments in register rax and <nl> + / / Enter specific kind of exit frame ; either EXIT or <nl> + / / EXIT_DEBUG . Expects the number of arguments in register rax and <nl> / / sets up the number of arguments in register rdi and the pointer <nl> / / to the first argument in register rsi . <nl> - void EnterExitFrame ( ExitFrame : : Mode mode , int result_size = 1 ) ; <nl> + void EnterExitFrame ( StackFrame : : Type type , int result_size = 1 ) ; <nl> <nl> / / Leave the current exit frame . Expects / provides the return value in <nl> / / register rax : rdx ( untouched ) and the pointer to the first <nl> / / argument in register rsi . <nl> - void LeaveExitFrame ( ExitFrame : : Mode mode , int result_size = 1 ) ; <nl> + void LeaveExitFrame ( StackFrame : : Type type , int result_size = 1 ) ; <nl> <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm a / test / cctest / SConscript <nl> ppp b / test / cctest / SConscript <nl> Import ( ' context object_files ' ) <nl> <nl> SOURCES = { <nl> ' all ' : [ <nl> - ' test - accessors . cc ' , <nl> ' test - alloc . cc ' , <nl> ' test - api . cc ' , <nl> ' test - ast . cc ' , <nl> mmm a / test / cctest / cctest . cc <nl> ppp b / test / cctest / cctest . cc <nl> int main ( int argc , char * argv [ ] ) { <nl> v8 : : V8 : : Dispose ( ) ; <nl> return 0 ; <nl> } <nl> - <nl> - RegisterThreadedTest * RegisterThreadedTest : : first_ = NULL ; <nl> - int RegisterThreadedTest : : count_ = 0 ; <nl> mmm a / test / cctest / cctest . h <nl> ppp b / test / cctest / cctest . h <nl> <nl> # ifndef CCTEST_H_ <nl> # define CCTEST_H_ <nl> <nl> - # include " v8 . h " <nl> - <nl> # ifndef TEST <nl> # define TEST ( Name ) \ <nl> static void Test # # Name ( ) ; \ <nl> class CcTest { <nl> CcTest * prev_ ; <nl> } ; <nl> <nl> - / / Switches between all the Api tests using the threading support . <nl> - / / In order to get a surprising but repeatable pattern of thread <nl> - / / switching it has extra semaphores to control the order in which <nl> - / / the tests alternate , not relying solely on the big V8 lock . <nl> - / / <nl> - / / A test is augmented with calls to ApiTestFuzzer : : Fuzz ( ) in its <nl> - / / callbacks . This will have no effect when we are not running the <nl> - / / thread fuzzing test . In the thread fuzzing test it will <nl> - / / pseudorandomly select a successor thread and switch execution <nl> - / / to that thread , suspending the current test . <nl> - class ApiTestFuzzer : public v8 : : internal : : Thread { <nl> - public : <nl> - void CallTest ( ) ; <nl> - explicit ApiTestFuzzer ( int num ) <nl> - : test_number_ ( num ) , <nl> - gate_ ( v8 : : internal : : OS : : CreateSemaphore ( 0 ) ) , <nl> - active_ ( true ) { <nl> - } <nl> - ~ ApiTestFuzzer ( ) { delete gate_ ; } <nl> - <nl> - / / The ApiTestFuzzer is also a Thread , so it has a Run method . <nl> - virtual void Run ( ) ; <nl> - <nl> - enum PartOfTest { FIRST_PART , SECOND_PART } ; <nl> - <nl> - static void Setup ( PartOfTest part ) ; <nl> - static void RunAllTests ( ) ; <nl> - static void TearDown ( ) ; <nl> - / / This method switches threads if we are running the Threading test . <nl> - / / Otherwise it does nothing . <nl> - static void Fuzz ( ) ; <nl> - private : <nl> - static bool fuzzing_ ; <nl> - static int tests_being_run_ ; <nl> - static int current_ ; <nl> - static int active_tests_ ; <nl> - static bool NextThread ( ) ; <nl> - int test_number_ ; <nl> - v8 : : internal : : Semaphore * gate_ ; <nl> - bool active_ ; <nl> - void ContextSwitch ( ) ; <nl> - static int GetNextTestNumber ( ) ; <nl> - static v8 : : internal : : Semaphore * all_tests_done_ ; <nl> - } ; <nl> - <nl> - <nl> - # define THREADED_TEST ( Name ) \ <nl> - static void Test # # Name ( ) ; \ <nl> - RegisterThreadedTest register_ # # Name ( Test # # Name , # Name ) ; \ <nl> - / * * / TEST ( Name ) <nl> - <nl> - <nl> - class RegisterThreadedTest { <nl> - public : <nl> - explicit RegisterThreadedTest ( CcTest : : TestFunction * callback , <nl> - const char * name ) <nl> - : fuzzer_ ( NULL ) , callback_ ( callback ) , name_ ( name ) { <nl> - prev_ = first_ ; <nl> - first_ = this ; <nl> - count_ + + ; <nl> - } <nl> - static int count ( ) { return count_ ; } <nl> - static RegisterThreadedTest * nth ( int i ) { <nl> - CHECK ( i < count ( ) ) ; <nl> - RegisterThreadedTest * current = first_ ; <nl> - while ( i > 0 ) { <nl> - i - - ; <nl> - current = current - > prev_ ; <nl> - } <nl> - return current ; <nl> - } <nl> - CcTest : : TestFunction * callback ( ) { return callback_ ; } <nl> - ApiTestFuzzer * fuzzer_ ; <nl> - const char * name ( ) { return name_ ; } <nl> - <nl> - private : <nl> - static RegisterThreadedTest * first_ ; <nl> - static int count_ ; <nl> - CcTest : : TestFunction * callback_ ; <nl> - RegisterThreadedTest * prev_ ; <nl> - const char * name_ ; <nl> - } ; <nl> - <nl> - <nl> - / / A LocalContext holds a reference to a v8 : : Context . <nl> - class LocalContext { <nl> - public : <nl> - LocalContext ( v8 : : ExtensionConfiguration * extensions = 0 , <nl> - v8 : : Handle < v8 : : ObjectTemplate > global_template = <nl> - v8 : : Handle < v8 : : ObjectTemplate > ( ) , <nl> - v8 : : Handle < v8 : : Value > global_object = v8 : : Handle < v8 : : Value > ( ) ) <nl> - : context_ ( v8 : : Context : : New ( extensions , global_template , global_object ) ) { <nl> - context_ - > Enter ( ) ; <nl> - } <nl> - <nl> - virtual ~ LocalContext ( ) { <nl> - context_ - > Exit ( ) ; <nl> - context_ . Dispose ( ) ; <nl> - } <nl> - <nl> - v8 : : Context * operator - > ( ) { return * context_ ; } <nl> - v8 : : Context * operator * ( ) { return * context_ ; } <nl> - bool IsReady ( ) { return ! context_ . IsEmpty ( ) ; } <nl> - <nl> - v8 : : Local < v8 : : Context > local ( ) { <nl> - return v8 : : Local < v8 : : Context > : : New ( context_ ) ; <nl> - } <nl> - <nl> - private : <nl> - v8 : : Persistent < v8 : : Context > context_ ; <nl> - } ; <nl> - <nl> - <nl> - static inline v8 : : Local < v8 : : Value > v8_num ( double x ) { <nl> - return v8 : : Number : : New ( x ) ; <nl> - } <nl> - <nl> - <nl> - static inline v8 : : Local < v8 : : String > v8_str ( const char * x ) { <nl> - return v8 : : String : : New ( x ) ; <nl> - } <nl> - <nl> - <nl> - static inline v8 : : Local < v8 : : Script > v8_compile ( const char * x ) { <nl> - return v8 : : Script : : Compile ( v8_str ( x ) ) ; <nl> - } <nl> - <nl> - <nl> - / / Helper function that compiles and runs the source . <nl> - static inline v8 : : Local < v8 : : Value > CompileRun ( const char * source ) { <nl> - return v8 : : Script : : Compile ( v8 : : String : : New ( source ) ) - > Run ( ) ; <nl> - } <nl> - <nl> - <nl> # endif / / ifndef CCTEST_H_ <nl> deleted file mode 100644 <nl> index b56238ad695 . . 00000000000 <nl> mmm a / test / cctest / test - accessors . cc <nl> ppp / dev / null <nl> <nl> - / / Copyright 2009 the V8 project authors . All rights reserved . <nl> - / / Redistribution and use in source and binary forms , with or without <nl> - / / modification , are permitted provided that the following conditions are <nl> - / / met : <nl> - / / <nl> - / / * Redistributions of source code must retain the above copyright <nl> - / / notice , this list of conditions and the following disclaimer . <nl> - / / * Redistributions in binary form must reproduce the above <nl> - / / copyright notice , this list of conditions and the following <nl> - / / disclaimer in the documentation and / or other materials provided <nl> - / / with the distribution . <nl> - / / * Neither the name of Google Inc . nor the names of its <nl> - / / contributors may be used to endorse or promote products derived <nl> - / / from this software without specific prior written permission . <nl> - / / <nl> - / / THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <nl> - / / " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT <nl> - / / LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR <nl> - / / A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT <nl> - / / OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , <nl> - / / SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT <nl> - / / LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , <nl> - / / DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY <nl> - / / THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT <nl> - / / ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE <nl> - / / OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE . <nl> - <nl> - # include < stdlib . h > <nl> - <nl> - # include " v8 . h " <nl> - <nl> - # include " api . h " <nl> - # include " cctest . h " <nl> - # include " frames - inl . h " <nl> - # include " string - stream . h " <nl> - <nl> - using : : v8 : : ObjectTemplate ; <nl> - using : : v8 : : Value ; <nl> - using : : v8 : : Context ; <nl> - using : : v8 : : Local ; <nl> - using : : v8 : : String ; <nl> - using : : v8 : : Script ; <nl> - using : : v8 : : Function ; <nl> - using : : v8 : : AccessorInfo ; <nl> - using : : v8 : : Extension ; <nl> - <nl> - namespace i = : : v8 : : internal ; <nl> - <nl> - static v8 : : Handle < Value > handle_property ( Local < String > name , <nl> - const AccessorInfo & ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - return v8_num ( 900 ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( PropertyHandler ) { <nl> - v8 : : HandleScope scope ; <nl> - Local < v8 : : FunctionTemplate > fun_templ = v8 : : FunctionTemplate : : New ( ) ; <nl> - fun_templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " foo " ) , handle_property ) ; <nl> - LocalContext env ; <nl> - Local < Function > fun = fun_templ - > GetFunction ( ) ; <nl> - env - > Global ( ) - > Set ( v8_str ( " Fun " ) , fun ) ; <nl> - Local < Script > getter = v8_compile ( " var obj = new Fun ( ) ; obj . foo ; " ) ; <nl> - CHECK_EQ ( 900 , getter - > Run ( ) - > Int32Value ( ) ) ; <nl> - Local < Script > setter = v8_compile ( " obj . foo = 901 ; " ) ; <nl> - CHECK_EQ ( 901 , setter - > Run ( ) - > Int32Value ( ) ) ; <nl> - } <nl> - <nl> - <nl> - static v8 : : Handle < Value > GetIntValue ( Local < String > property , <nl> - const AccessorInfo & info ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - int * value = <nl> - static_cast < int * > ( v8 : : Handle < v8 : : External > : : Cast ( info . Data ( ) ) - > Value ( ) ) ; <nl> - return v8_num ( * value ) ; <nl> - } <nl> - <nl> - <nl> - static void SetIntValue ( Local < String > property , <nl> - Local < Value > value , <nl> - const AccessorInfo & info ) { <nl> - int * field = <nl> - static_cast < int * > ( v8 : : Handle < v8 : : External > : : Cast ( info . Data ( ) ) - > Value ( ) ) ; <nl> - * field = value - > Int32Value ( ) ; <nl> - } <nl> - <nl> - int foo , bar , baz ; <nl> - <nl> - THREADED_TEST ( GlobalVariableAccess ) { <nl> - foo = 0 ; <nl> - bar = - 4 ; <nl> - baz = 10 ; <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : FunctionTemplate > templ = v8 : : FunctionTemplate : : New ( ) ; <nl> - templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " foo " ) , <nl> - GetIntValue , <nl> - SetIntValue , <nl> - v8 : : External : : New ( & foo ) ) ; <nl> - templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " bar " ) , <nl> - GetIntValue , <nl> - SetIntValue , <nl> - v8 : : External : : New ( & bar ) ) ; <nl> - templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " baz " ) , <nl> - GetIntValue , <nl> - SetIntValue , <nl> - v8 : : External : : New ( & baz ) ) ; <nl> - LocalContext env ( 0 , templ - > InstanceTemplate ( ) ) ; <nl> - v8_compile ( " foo = ( + + bar ) + baz " ) - > Run ( ) ; <nl> - CHECK_EQ ( bar , - 3 ) ; <nl> - CHECK_EQ ( foo , 7 ) ; <nl> - } <nl> - <nl> - <nl> - static int x_register = 0 ; <nl> - static v8 : : Handle < v8 : : Object > x_receiver ; <nl> - static v8 : : Handle < v8 : : Object > x_holder ; <nl> - <nl> - <nl> - static v8 : : Handle < Value > XGetter ( Local < String > name , const AccessorInfo & info ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - CHECK_EQ ( x_receiver , info . This ( ) ) ; <nl> - CHECK_EQ ( x_holder , info . Holder ( ) ) ; <nl> - return v8_num ( x_register ) ; <nl> - } <nl> - <nl> - <nl> - static void XSetter ( Local < String > name , <nl> - Local < Value > value , <nl> - const AccessorInfo & info ) { <nl> - CHECK_EQ ( x_holder , info . This ( ) ) ; <nl> - CHECK_EQ ( x_holder , info . Holder ( ) ) ; <nl> - x_register = value - > Int32Value ( ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( AccessorIC ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " x " ) , XGetter , XSetter ) ; <nl> - LocalContext context ; <nl> - x_holder = obj - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8_str ( " holder " ) , x_holder ) ; <nl> - x_receiver = v8 : : Object : : New ( ) ; <nl> - context - > Global ( ) - > Set ( v8_str ( " obj " ) , x_receiver ) ; <nl> - v8 : : Handle < v8 : : Array > array = v8 : : Handle < v8 : : Array > : : Cast ( CompileRun ( <nl> - " obj . __proto__ = holder ; " <nl> - " var result = [ ] ; " <nl> - " for ( var i = 0 ; i < 10 ; i + + ) { " <nl> - " holder . x = i ; " <nl> - " result . push ( obj . x ) ; " <nl> - " } " <nl> - " result " ) ) ; <nl> - CHECK_EQ ( 10 , array - > Length ( ) ) ; <nl> - for ( int i = 0 ; i < 10 ; i + + ) { <nl> - v8 : : Handle < Value > entry = array - > Get ( v8 : : Integer : : New ( i ) ) ; <nl> - CHECK_EQ ( v8 : : Integer : : New ( i ) , entry ) ; <nl> - } <nl> - } <nl> - <nl> - <nl> - static v8 : : Handle < Value > AccessorProhibitsOverwritingGetter ( <nl> - Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - return v8 : : True ( ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( AccessorProhibitsOverwriting ) { <nl> - v8 : : HandleScope scope ; <nl> - LocalContext context ; <nl> - Local < ObjectTemplate > templ = ObjectTemplate : : New ( ) ; <nl> - templ - > SetAccessor ( v8_str ( " x " ) , <nl> - AccessorProhibitsOverwritingGetter , <nl> - 0 , <nl> - v8 : : Handle < Value > ( ) , <nl> - v8 : : PROHIBITS_OVERWRITING , <nl> - v8 : : ReadOnly ) ; <nl> - Local < v8 : : Object > instance = templ - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8_str ( " obj " ) , instance ) ; <nl> - Local < Value > value = CompileRun ( <nl> - " obj . __defineGetter__ ( ' x ' , function ( ) { return false ; } ) ; " <nl> - " obj . x " ) ; <nl> - CHECK ( value - > BooleanValue ( ) ) ; <nl> - value = CompileRun ( <nl> - " var setter_called = false ; " <nl> - " obj . __defineSetter__ ( ' x ' , function ( ) { setter_called = true ; } ) ; " <nl> - " obj . x = 42 ; " <nl> - " setter_called " ) ; <nl> - CHECK ( ! value - > BooleanValue ( ) ) ; <nl> - value = CompileRun ( <nl> - " obj2 = { } ; " <nl> - " obj2 . __proto__ = obj ; " <nl> - " obj2 . __defineGetter__ ( ' x ' , function ( ) { return false ; } ) ; " <nl> - " obj2 . x " ) ; <nl> - CHECK ( value - > BooleanValue ( ) ) ; <nl> - value = CompileRun ( <nl> - " var setter_called = false ; " <nl> - " obj2 = { } ; " <nl> - " obj2 . __proto__ = obj ; " <nl> - " obj2 . __defineSetter__ ( ' x ' , function ( ) { setter_called = true ; } ) ; " <nl> - " obj2 . x = 42 ; " <nl> - " setter_called " ) ; <nl> - CHECK ( ! value - > BooleanValue ( ) ) ; <nl> - } <nl> - <nl> - <nl> - template < int C > <nl> - static v8 : : Handle < Value > HandleAllocatingGetter ( Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - for ( int i = 0 ; i < C ; i + + ) <nl> - v8 : : String : : New ( " foo " ) ; <nl> - return v8 : : String : : New ( " foo " ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( HandleScopePop ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " one " ) , HandleAllocatingGetter < 1 > ) ; <nl> - obj - > SetAccessor ( v8_str ( " many " ) , HandleAllocatingGetter < 1024 > ) ; <nl> - LocalContext context ; <nl> - v8 : : Handle < v8 : : Object > inst = obj - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8 : : String : : New ( " obj " ) , inst ) ; <nl> - int count_before = i : : HandleScope : : NumberOfHandles ( ) ; <nl> - { <nl> - v8 : : HandleScope scope ; <nl> - CompileRun ( <nl> - " for ( var i = 0 ; i < 1000 ; i + + ) { " <nl> - " obj . one ; " <nl> - " obj . many ; " <nl> - " } " ) ; <nl> - } <nl> - int count_after = i : : HandleScope : : NumberOfHandles ( ) ; <nl> - CHECK_EQ ( count_before , count_after ) ; <nl> - } <nl> - <nl> - static v8 : : Handle < Value > CheckAccessorArgsCorrect ( Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - CHECK ( info . This ( ) = = info . Holder ( ) ) ; <nl> - CHECK ( info . Data ( ) - > Equals ( v8 : : String : : New ( " data " ) ) ) ; <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - CHECK ( info . This ( ) = = info . Holder ( ) ) ; <nl> - CHECK ( info . Data ( ) - > Equals ( v8 : : String : : New ( " data " ) ) ) ; <nl> - i : : Heap : : CollectAllGarbage ( true ) ; <nl> - CHECK ( info . This ( ) = = info . Holder ( ) ) ; <nl> - CHECK ( info . Data ( ) - > Equals ( v8 : : String : : New ( " data " ) ) ) ; <nl> - return v8 : : Integer : : New ( 17 ) ; <nl> - } <nl> - <nl> - THREADED_TEST ( DirectCall ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " xxx " ) , <nl> - CheckAccessorArgsCorrect , <nl> - NULL , <nl> - v8 : : String : : New ( " data " ) ) ; <nl> - LocalContext context ; <nl> - v8 : : Handle < v8 : : Object > inst = obj - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8 : : String : : New ( " obj " ) , inst ) ; <nl> - Local < Script > scr = v8 : : Script : : Compile ( v8 : : String : : New ( " obj . xxx " ) ) ; <nl> - for ( int i = 0 ; i < 10 ; i + + ) { <nl> - Local < Value > result = scr - > Run ( ) ; <nl> - CHECK ( ! result . IsEmpty ( ) ) ; <nl> - CHECK_EQ ( 17 , result - > Int32Value ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - static v8 : : Handle < Value > EmptyGetter ( Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - CheckAccessorArgsCorrect ( name , info ) ; <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - CheckAccessorArgsCorrect ( name , info ) ; <nl> - return v8 : : Handle < v8 : : Value > ( ) ; <nl> - } <nl> - <nl> - THREADED_TEST ( EmptyResult ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " xxx " ) , EmptyGetter , NULL , v8 : : String : : New ( " data " ) ) ; <nl> - LocalContext context ; <nl> - v8 : : Handle < v8 : : Object > inst = obj - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8 : : String : : New ( " obj " ) , inst ) ; <nl> - Local < Script > scr = v8 : : Script : : Compile ( v8 : : String : : New ( " obj . xxx " ) ) ; <nl> - for ( int i = 0 ; i < 10 ; i + + ) { <nl> - Local < Value > result = scr - > Run ( ) ; <nl> - CHECK ( result = = v8 : : Undefined ( ) ) ; <nl> - } <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( NoReuseRegress ) { <nl> - / / Check that the IC generated for the one test doesn ' t get reused <nl> - / / for the other . <nl> - v8 : : HandleScope scope ; <nl> - { <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " xxx " ) , EmptyGetter , NULL , v8 : : String : : New ( " data " ) ) ; <nl> - LocalContext context ; <nl> - v8 : : Handle < v8 : : Object > inst = obj - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8 : : String : : New ( " obj " ) , inst ) ; <nl> - Local < Script > scr = v8 : : Script : : Compile ( v8 : : String : : New ( " obj . xxx " ) ) ; <nl> - for ( int i = 0 ; i < 2 ; i + + ) { <nl> - Local < Value > result = scr - > Run ( ) ; <nl> - CHECK ( result = = v8 : : Undefined ( ) ) ; <nl> - } <nl> - } <nl> - { <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " xxx " ) , <nl> - CheckAccessorArgsCorrect , <nl> - NULL , <nl> - v8 : : String : : New ( " data " ) ) ; <nl> - LocalContext context ; <nl> - v8 : : Handle < v8 : : Object > inst = obj - > NewInstance ( ) ; <nl> - context - > Global ( ) - > Set ( v8 : : String : : New ( " obj " ) , inst ) ; <nl> - Local < Script > scr = v8 : : Script : : Compile ( v8 : : String : : New ( " obj . xxx " ) ) ; <nl> - for ( int i = 0 ; i < 10 ; i + + ) { <nl> - Local < Value > result = scr - > Run ( ) ; <nl> - CHECK ( ! result . IsEmpty ( ) ) ; <nl> - CHECK_EQ ( 17 , result - > Int32Value ( ) ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - static v8 : : Handle < Value > ThrowingGetAccessor ( Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - return v8 : : ThrowException ( v8_str ( " g " ) ) ; <nl> - } <nl> - <nl> - <nl> - static void ThrowingSetAccessor ( Local < String > name , <nl> - Local < Value > value , <nl> - const AccessorInfo & info ) { <nl> - v8 : : ThrowException ( value ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( Regress1054726 ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " x " ) , <nl> - ThrowingGetAccessor , <nl> - ThrowingSetAccessor , <nl> - Local < Value > ( ) ) ; <nl> - <nl> - LocalContext env ; <nl> - env - > Global ( ) - > Set ( v8_str ( " obj " ) , obj - > NewInstance ( ) ) ; <nl> - <nl> - / / Use the throwing property setter / getter in a loop to force <nl> - / / the accessor ICs to be initialized . <nl> - v8 : : Handle < Value > result ; <nl> - result = Script : : Compile ( v8_str ( <nl> - " var result = ' ' ; " <nl> - " for ( var i = 0 ; i < 5 ; i + + ) { " <nl> - " try { obj . x ; } catch ( e ) { result + = e ; } " <nl> - " } ; result " ) ) - > Run ( ) ; <nl> - CHECK_EQ ( v8_str ( " ggggg " ) , result ) ; <nl> - <nl> - result = Script : : Compile ( String : : New ( <nl> - " var result = ' ' ; " <nl> - " for ( var i = 0 ; i < 5 ; i + + ) { " <nl> - " try { obj . x = i ; } catch ( e ) { result + = e ; } " <nl> - " } ; result " ) ) - > Run ( ) ; <nl> - CHECK_EQ ( v8_str ( " 01234 " ) , result ) ; <nl> - } <nl> - <nl> - <nl> - static v8 : : Handle < Value > AllocGetter ( Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - ApiTestFuzzer : : Fuzz ( ) ; <nl> - return v8 : : Array : : New ( 1000 ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( Gc ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " xxx " ) , AllocGetter ) ; <nl> - LocalContext env ; <nl> - env - > Global ( ) - > Set ( v8_str ( " obj " ) , obj - > NewInstance ( ) ) ; <nl> - Script : : Compile ( String : : New ( <nl> - " var last = [ ] ; " <nl> - " for ( var i = 0 ; i < 2048 ; i + + ) { " <nl> - " var result = obj . xxx ; " <nl> - " result [ 0 ] = last ; " <nl> - " last = result ; " <nl> - " } " ) ) - > Run ( ) ; <nl> - } <nl> - <nl> - <nl> - static v8 : : Handle < Value > StackCheck ( Local < String > name , <nl> - const AccessorInfo & info ) { <nl> - i : : StackFrameIterator iter ; <nl> - for ( int i = 0 ; ! iter . done ( ) ; i + + ) { <nl> - i : : StackFrame * frame = iter . frame ( ) ; <nl> - CHECK ( i ! = 0 | | ( frame - > type ( ) = = i : : StackFrame : : EXIT ) ) ; <nl> - CHECK ( frame - > code ( ) - > IsCode ( ) ) ; <nl> - i : : Address pc = frame - > pc ( ) ; <nl> - i : : Code * code = frame - > code ( ) ; <nl> - CHECK ( code - > contains ( pc ) ) ; <nl> - iter . Advance ( ) ; <nl> - } <nl> - return v8 : : Undefined ( ) ; <nl> - } <nl> - <nl> - <nl> - THREADED_TEST ( StackIteration ) { <nl> - v8 : : HandleScope scope ; <nl> - v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> - i : : StringStream : : ClearMentionedObjectCache ( ) ; <nl> - obj - > SetAccessor ( v8_str ( " xxx " ) , StackCheck ) ; <nl> - LocalContext env ; <nl> - env - > Global ( ) - > Set ( v8_str ( " obj " ) , obj - > NewInstance ( ) ) ; <nl> - Script : : Compile ( String : : New ( <nl> - " function foo ( ) { " <nl> - " return obj . xxx ; " <nl> - " } " <nl> - " for ( var i = 0 ; i < 100 ; i + + ) { " <nl> - " foo ( ) ; " <nl> - " } " ) ) - > Run ( ) ; <nl> - } <nl> mmm a / test / cctest / test - api . cc <nl> ppp b / test / cctest / test - api . cc <nl> <nl> # include " utils . h " <nl> # include " cctest . h " <nl> <nl> - static const bool kLogThreading = false ; <nl> - <nl> static bool IsNaN ( double x ) { <nl> # ifdef WIN32 <nl> return _isnan ( x ) ; <nl> using : : v8 : : Extension ; <nl> <nl> namespace i = : : v8 : : internal ; <nl> <nl> + static Local < Value > v8_num ( double x ) { <nl> + return v8 : : Number : : New ( x ) ; <nl> + } <nl> + <nl> + <nl> + static Local < String > v8_str ( const char * x ) { <nl> + return String : : New ( x ) ; <nl> + } <nl> + <nl> + <nl> + static Local < Script > v8_compile ( const char * x ) { <nl> + return Script : : Compile ( v8_str ( x ) ) ; <nl> + } <nl> + <nl> + <nl> + / / A LocalContext holds a reference to a v8 : : Context . <nl> + class LocalContext { <nl> + public : <nl> + LocalContext ( v8 : : ExtensionConfiguration * extensions = 0 , <nl> + v8 : : Handle < ObjectTemplate > global_template = <nl> + v8 : : Handle < ObjectTemplate > ( ) , <nl> + v8 : : Handle < Value > global_object = v8 : : Handle < Value > ( ) ) <nl> + : context_ ( Context : : New ( extensions , global_template , global_object ) ) { <nl> + context_ - > Enter ( ) ; <nl> + } <nl> + <nl> + virtual ~ LocalContext ( ) { <nl> + context_ - > Exit ( ) ; <nl> + context_ . Dispose ( ) ; <nl> + } <nl> + <nl> + Context * operator - > ( ) { return * context_ ; } <nl> + Context * operator * ( ) { return * context_ ; } <nl> + Local < Context > local ( ) { return Local < Context > : : New ( context_ ) ; } <nl> + bool IsReady ( ) { return ! context_ . IsEmpty ( ) ; } <nl> + <nl> + private : <nl> + v8 : : Persistent < Context > context_ ; <nl> + } ; <nl> + <nl> + <nl> + / / Switches between all the Api tests using the threading support . <nl> + / / In order to get a surprising but repeatable pattern of thread <nl> + / / switching it has extra semaphores to control the order in which <nl> + / / the tests alternate , not relying solely on the big V8 lock . <nl> + / / <nl> + / / A test is augmented with calls to ApiTestFuzzer : : Fuzz ( ) in its <nl> + / / callbacks . This will have no effect when we are not running the <nl> + / / thread fuzzing test . In the thread fuzzing test it will <nl> + / / pseudorandomly select a successor thread and switch execution <nl> + / / to that thread , suspending the current test . <nl> + class ApiTestFuzzer : public v8 : : internal : : Thread { <nl> + public : <nl> + void CallTest ( ) ; <nl> + explicit ApiTestFuzzer ( int num ) <nl> + : test_number_ ( num ) , <nl> + gate_ ( v8 : : internal : : OS : : CreateSemaphore ( 0 ) ) , <nl> + active_ ( true ) { <nl> + } <nl> + ~ ApiTestFuzzer ( ) { delete gate_ ; } <nl> + <nl> + / / The ApiTestFuzzer is also a Thread , so it has a Run method . <nl> + virtual void Run ( ) ; <nl> + <nl> + enum PartOfTest { FIRST_PART , SECOND_PART } ; <nl> + <nl> + static void Setup ( PartOfTest part ) ; <nl> + static void RunAllTests ( ) ; <nl> + static void TearDown ( ) ; <nl> + / / This method switches threads if we are running the Threading test . <nl> + / / Otherwise it does nothing . <nl> + static void Fuzz ( ) ; <nl> + private : <nl> + static bool fuzzing_ ; <nl> + static int tests_being_run_ ; <nl> + static int current_ ; <nl> + static int active_tests_ ; <nl> + static bool NextThread ( ) ; <nl> + int test_number_ ; <nl> + v8 : : internal : : Semaphore * gate_ ; <nl> + bool active_ ; <nl> + void ContextSwitch ( ) ; <nl> + static int GetNextTestNumber ( ) ; <nl> + static v8 : : internal : : Semaphore * all_tests_done_ ; <nl> + } ; <nl> + <nl> + <nl> + # define THREADED_TEST ( Name ) \ <nl> + static void Test # # Name ( ) ; \ <nl> + RegisterThreadedTest register_ # # Name ( Test # # Name ) ; \ <nl> + / * * / TEST ( Name ) <nl> + <nl> + <nl> + class RegisterThreadedTest { <nl> + public : <nl> + explicit RegisterThreadedTest ( CcTest : : TestFunction * callback ) <nl> + : fuzzer_ ( NULL ) , callback_ ( callback ) { <nl> + prev_ = first_ ; <nl> + first_ = this ; <nl> + count_ + + ; <nl> + } <nl> + static int count ( ) { return count_ ; } <nl> + static RegisterThreadedTest * nth ( int i ) { <nl> + CHECK ( i < count ( ) ) ; <nl> + RegisterThreadedTest * current = first_ ; <nl> + while ( i > 0 ) { <nl> + i - - ; <nl> + current = current - > prev_ ; <nl> + } <nl> + return current ; <nl> + } <nl> + CcTest : : TestFunction * callback ( ) { return callback_ ; } <nl> + ApiTestFuzzer * fuzzer_ ; <nl> + <nl> + private : <nl> + static RegisterThreadedTest * first_ ; <nl> + static int count_ ; <nl> + CcTest : : TestFunction * callback_ ; <nl> + RegisterThreadedTest * prev_ ; <nl> + } ; <nl> + <nl> + <nl> + RegisterThreadedTest * RegisterThreadedTest : : first_ = NULL ; <nl> + int RegisterThreadedTest : : count_ = 0 ; <nl> + <nl> <nl> static int signature_callback_count ; <nl> static v8 : : Handle < Value > IncrementingSignatureCallback ( <nl> THREADED_TEST ( Handles ) { <nl> } <nl> <nl> <nl> + / / Helper function that compiles and runs the source . <nl> + static Local < Value > CompileRun ( const char * source ) { <nl> + return Script : : Compile ( String : : New ( source ) ) - > Run ( ) ; <nl> + } <nl> + <nl> THREADED_TEST ( ReceiverSignature ) { <nl> v8 : : HandleScope scope ; <nl> LocalContext env ; <nl> THREADED_TEST ( FindInstanceInPrototypeChain ) { <nl> } <nl> <nl> <nl> + static v8 : : Handle < Value > handle_property ( Local < String > name , <nl> + const AccessorInfo & ) { <nl> + ApiTestFuzzer : : Fuzz ( ) ; <nl> + return v8_num ( 900 ) ; <nl> + } <nl> + <nl> + <nl> + THREADED_TEST ( PropertyHandler ) { <nl> + v8 : : HandleScope scope ; <nl> + Local < v8 : : FunctionTemplate > fun_templ = v8 : : FunctionTemplate : : New ( ) ; <nl> + fun_templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " foo " ) , handle_property ) ; <nl> + LocalContext env ; <nl> + Local < Function > fun = fun_templ - > GetFunction ( ) ; <nl> + env - > Global ( ) - > Set ( v8_str ( " Fun " ) , fun ) ; <nl> + Local < Script > getter = v8_compile ( " var obj = new Fun ( ) ; obj . foo ; " ) ; <nl> + CHECK_EQ ( 900 , getter - > Run ( ) - > Int32Value ( ) ) ; <nl> + Local < Script > setter = v8_compile ( " obj . foo = 901 ; " ) ; <nl> + CHECK_EQ ( 901 , setter - > Run ( ) - > Int32Value ( ) ) ; <nl> + } <nl> + <nl> + <nl> THREADED_TEST ( TinyInteger ) { <nl> v8 : : HandleScope scope ; <nl> LocalContext env ; <nl> THREADED_TEST ( GlobalPrototype ) { <nl> } <nl> <nl> <nl> + static v8 : : Handle < Value > GetIntValue ( Local < String > property , <nl> + const AccessorInfo & info ) { <nl> + ApiTestFuzzer : : Fuzz ( ) ; <nl> + int * value = <nl> + static_cast < int * > ( v8 : : Handle < v8 : : External > : : Cast ( info . Data ( ) ) - > Value ( ) ) ; <nl> + return v8_num ( * value ) ; <nl> + } <nl> + <nl> + static void SetIntValue ( Local < String > property , <nl> + Local < Value > value , <nl> + const AccessorInfo & info ) { <nl> + int * field = <nl> + static_cast < int * > ( v8 : : Handle < v8 : : External > : : Cast ( info . Data ( ) ) - > Value ( ) ) ; <nl> + * field = value - > Int32Value ( ) ; <nl> + } <nl> + <nl> + int foo , bar , baz ; <nl> + <nl> + THREADED_TEST ( GlobalVariableAccess ) { <nl> + foo = 0 ; <nl> + bar = - 4 ; <nl> + baz = 10 ; <nl> + v8 : : HandleScope scope ; <nl> + v8 : : Handle < v8 : : FunctionTemplate > templ = v8 : : FunctionTemplate : : New ( ) ; <nl> + templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " foo " ) , <nl> + GetIntValue , <nl> + SetIntValue , <nl> + v8 : : External : : New ( & foo ) ) ; <nl> + templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " bar " ) , <nl> + GetIntValue , <nl> + SetIntValue , <nl> + v8 : : External : : New ( & bar ) ) ; <nl> + templ - > InstanceTemplate ( ) - > SetAccessor ( v8_str ( " baz " ) , <nl> + GetIntValue , <nl> + SetIntValue , <nl> + v8 : : External : : New ( & baz ) ) ; <nl> + LocalContext env ( 0 , templ - > InstanceTemplate ( ) ) ; <nl> + v8_compile ( " foo = ( + + bar ) + baz " ) - > Run ( ) ; <nl> + CHECK_EQ ( bar , - 3 ) ; <nl> + CHECK_EQ ( foo , 7 ) ; <nl> + } <nl> + <nl> + <nl> THREADED_TEST ( ObjectTemplate ) { <nl> v8 : : HandleScope scope ; <nl> Local < ObjectTemplate > templ1 = ObjectTemplate : : New ( ) ; <nl> THREADED_TEST ( CallbackExceptionRegression ) { <nl> } <nl> <nl> <nl> + static v8 : : Handle < Value > ThrowingGetAccessor ( Local < String > name , <nl> + const AccessorInfo & info ) { <nl> + ApiTestFuzzer : : Fuzz ( ) ; <nl> + return v8 : : ThrowException ( v8_str ( " g " ) ) ; <nl> + } <nl> + <nl> + <nl> + static void ThrowingSetAccessor ( Local < String > name , <nl> + Local < Value > value , <nl> + const AccessorInfo & info ) { <nl> + v8 : : ThrowException ( value ) ; <nl> + } <nl> + <nl> + <nl> + THREADED_TEST ( Regress1054726 ) { <nl> + v8 : : HandleScope scope ; <nl> + v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> + obj - > SetAccessor ( v8_str ( " x " ) , <nl> + ThrowingGetAccessor , <nl> + ThrowingSetAccessor , <nl> + Local < Value > ( ) ) ; <nl> + <nl> + LocalContext env ; <nl> + env - > Global ( ) - > Set ( v8_str ( " obj " ) , obj - > NewInstance ( ) ) ; <nl> + <nl> + / / Use the throwing property setter / getter in a loop to force <nl> + / / the accessor ICs to be initialized . <nl> + v8 : : Handle < Value > result ; <nl> + result = Script : : Compile ( v8_str ( <nl> + " var result = ' ' ; " <nl> + " for ( var i = 0 ; i < 5 ; i + + ) { " <nl> + " try { obj . x ; } catch ( e ) { result + = e ; } " <nl> + " } ; result " ) ) - > Run ( ) ; <nl> + CHECK_EQ ( v8_str ( " ggggg " ) , result ) ; <nl> + <nl> + result = Script : : Compile ( String : : New ( <nl> + " var result = ' ' ; " <nl> + " for ( var i = 0 ; i < 5 ; i + + ) { " <nl> + " try { obj . x = i ; } catch ( e ) { result + = e ; } " <nl> + " } ; result " ) ) - > Run ( ) ; <nl> + CHECK_EQ ( v8_str ( " 01234 " ) , result ) ; <nl> + } <nl> + <nl> + <nl> THREADED_TEST ( FunctionPrototype ) { <nl> v8 : : HandleScope scope ; <nl> Local < v8 : : FunctionTemplate > Foo = v8 : : FunctionTemplate : : New ( ) ; <nl> THREADED_TEST ( Arguments ) { <nl> } <nl> <nl> <nl> + static int x_register = 0 ; <nl> + static v8 : : Handle < v8 : : Object > x_receiver ; <nl> + static v8 : : Handle < v8 : : Object > x_holder ; <nl> + <nl> + <nl> + static v8 : : Handle < Value > XGetter ( Local < String > name , const AccessorInfo & info ) { <nl> + ApiTestFuzzer : : Fuzz ( ) ; <nl> + CHECK_EQ ( x_receiver , info . This ( ) ) ; <nl> + CHECK_EQ ( x_holder , info . Holder ( ) ) ; <nl> + return v8_num ( x_register ) ; <nl> + } <nl> + <nl> + <nl> + static void XSetter ( Local < String > name , <nl> + Local < Value > value , <nl> + const AccessorInfo & info ) { <nl> + CHECK_EQ ( x_holder , info . This ( ) ) ; <nl> + CHECK_EQ ( x_holder , info . Holder ( ) ) ; <nl> + x_register = value - > Int32Value ( ) ; <nl> + } <nl> + <nl> + <nl> + THREADED_TEST ( AccessorIC ) { <nl> + v8 : : HandleScope scope ; <nl> + v8 : : Handle < v8 : : ObjectTemplate > obj = ObjectTemplate : : New ( ) ; <nl> + obj - > SetAccessor ( v8_str ( " x " ) , XGetter , XSetter ) ; <nl> + LocalContext context ; <nl> + x_holder = obj - > NewInstance ( ) ; <nl> + context - > Global ( ) - > Set ( v8_str ( " holder " ) , x_holder ) ; <nl> + x_receiver = v8 : : Object : : New ( ) ; <nl> + context - > Global ( ) - > Set ( v8_str ( " obj " ) , x_receiver ) ; <nl> + v8 : : Handle < v8 : : Array > array = v8 : : Handle < v8 : : Array > : : Cast ( CompileRun ( <nl> + " obj . __proto__ = holder ; " <nl> + " var result = [ ] ; " <nl> + " for ( var i = 0 ; i < 10 ; i + + ) { " <nl> + " holder . x = i ; " <nl> + " result . push ( obj . x ) ; " <nl> + " } " <nl> + " result " ) ) ; <nl> + CHECK_EQ ( 10 , array - > Length ( ) ) ; <nl> + for ( int i = 0 ; i < 10 ; i + + ) { <nl> + v8 : : Handle < Value > entry = array - > Get ( v8 : : Integer : : New ( i ) ) ; <nl> + CHECK_EQ ( v8 : : Integer : : New ( i ) , entry ) ; <nl> + } <nl> + } <nl> + <nl> + <nl> static v8 : : Handle < Value > NoBlockGetterX ( Local < String > name , <nl> const AccessorInfo & ) { <nl> return v8 : : Handle < Value > ( ) ; <nl> void ApiTestFuzzer : : Fuzz ( ) { <nl> / / not start immediately . <nl> bool ApiTestFuzzer : : NextThread ( ) { <nl> int test_position = GetNextTestNumber ( ) ; <nl> - const char * test_name = RegisterThreadedTest : : nth ( current_ ) - > name ( ) ; <nl> + int test_number = RegisterThreadedTest : : nth ( current_ ) - > fuzzer_ - > test_number_ ; <nl> if ( test_position = = current_ ) { <nl> - if ( kLogThreading ) <nl> - printf ( " Stay with % s \ n " , test_name ) ; <nl> + printf ( " Stay with % d \ n " , test_number ) ; <nl> return false ; <nl> } <nl> - if ( kLogThreading ) { <nl> - printf ( " Switch from % s to % s \ n " , <nl> - test_name , <nl> - RegisterThreadedTest : : nth ( test_position ) - > name ( ) ) ; <nl> - } <nl> + printf ( " Switch from % d to % d \ n " , <nl> + current_ < 0 ? 0 : test_number , test_position < 0 ? 0 : test_number ) ; <nl> current_ = test_position ; <nl> RegisterThreadedTest : : nth ( current_ ) - > fuzzer_ - > gate_ - > Signal ( ) ; <nl> return true ; <nl> TEST ( Threading2 ) { <nl> <nl> <nl> void ApiTestFuzzer : : CallTest ( ) { <nl> - if ( kLogThreading ) <nl> - printf ( " Start test % d \ n " , test_number_ ) ; <nl> + printf ( " Start test % d \ n " , test_number_ ) ; <nl> CallTestNumber ( test_number_ ) ; <nl> - if ( kLogThreading ) <nl> - printf ( " End test % d \ n " , test_number_ ) ; <nl> + printf ( " End test % d \ n " , test_number_ ) ; <nl> } <nl> <nl> <nl> THREADED_TEST ( PropertyEnumeration ) { <nl> } <nl> <nl> <nl> + static v8 : : Handle < Value > AccessorProhibitsOverwritingGetter ( <nl> + Local < String > name , <nl> + const AccessorInfo & info ) { <nl> + ApiTestFuzzer : : Fuzz ( ) ; <nl> + return v8 : : True ( ) ; <nl> + } <nl> + <nl> + <nl> + THREADED_TEST ( AccessorProhibitsOverwriting ) { <nl> + v8 : : HandleScope scope ; <nl> + LocalContext context ; <nl> + Local < ObjectTemplate > templ = ObjectTemplate : : New ( ) ; <nl> + templ - > SetAccessor ( v8_str ( " x " ) , <nl> + AccessorProhibitsOverwritingGetter , <nl> + 0 , <nl> + v8 : : Handle < Value > ( ) , <nl> + v8 : : PROHIBITS_OVERWRITING , <nl> + v8 : : ReadOnly ) ; <nl> + Local < v8 : : Object > instance = templ - > NewInstance ( ) ; <nl> + context - > Global ( ) - > Set ( v8_str ( " obj " ) , instance ) ; <nl> + Local < Value > value = CompileRun ( <nl> + " obj . __defineGetter__ ( ' x ' , function ( ) { return false ; } ) ; " <nl> + " obj . x " ) ; <nl> + CHECK ( value - > BooleanValue ( ) ) ; <nl> + value = CompileRun ( <nl> + " var setter_called = false ; " <nl> + " obj . __defineSetter__ ( ' x ' , function ( ) { setter_called = true ; } ) ; " <nl> + " obj . x = 42 ; " <nl> + " setter_called " ) ; <nl> + CHECK ( ! value - > BooleanValue ( ) ) ; <nl> + value = CompileRun ( <nl> + " obj2 = { } ; " <nl> + " obj2 . __proto__ = obj ; " <nl> + " obj2 . __defineGetter__ ( ' x ' , function ( ) { return false ; } ) ; " <nl> + " obj2 . x " ) ; <nl> + CHECK ( value - > BooleanValue ( ) ) ; <nl> + value = CompileRun ( <nl> + " var setter_called = false ; " <nl> + " obj2 = { } ; " <nl> + " obj2 . __proto__ = obj ; " <nl> + " obj2 . __defineSetter__ ( ' x ' , function ( ) { setter_called = true ; } ) ; " <nl> + " obj2 . x = 42 ; " <nl> + " setter_called " ) ; <nl> + CHECK ( ! value - > BooleanValue ( ) ) ; <nl> + } <nl> + <nl> + <nl> static bool NamedSetAccessBlocker ( Local < v8 : : Object > obj , <nl> Local < Value > name , <nl> v8 : : AccessType type , <nl> mmm a / test / cctest / test - debug . cc <nl> ppp b / test / cctest / test - debug . cc <nl> static v8 : : Local < v8 : : Function > CompileFunction ( const char * source , <nl> } <nl> <nl> <nl> + / / Helper function that compiles and runs the source . <nl> + static v8 : : Local < v8 : : Value > CompileRun ( const char * source ) { <nl> + return v8 : : Script : : Compile ( v8 : : String : : New ( source ) ) - > Run ( ) ; <nl> + } <nl> + <nl> + <nl> / / Is there any debug info for the function ? <nl> static bool HasDebugInfo ( v8 : : Handle < v8 : : Function > fun ) { <nl> Handle < v8 : : internal : : JSFunction > f = v8 : : Utils : : OpenHandle ( * fun ) ; <nl> mmm a / test / cctest / test - log - stack - tracer . cc <nl> ppp b / test / cctest / test - log - stack - tracer . cc <nl> v8 : : Handle < v8 : : Value > TraceExtension : : JSEntrySP ( const v8 : : Arguments & args ) { <nl> } <nl> <nl> <nl> + static void CompileRun ( const char * source ) { <nl> + Script : : Compile ( String : : New ( source ) ) - > Run ( ) ; <nl> + } <nl> + <nl> + <nl> v8 : : Handle < v8 : : Value > TraceExtension : : JSEntrySPLevel2 ( <nl> const v8 : : Arguments & args ) { <nl> v8 : : HandleScope scope ; <nl> mmm a / test / mjsunit / fuzz - natives . js <nl> ppp b / test / mjsunit / fuzz - natives . js <nl> var knownProblems = { <nl> " Log " : true , <nl> " DeclareGlobals " : true , <nl> <nl> - " CollectStackTrace " : true , <nl> - " PromoteScheduledException " : true , <nl> - " DeleteHandleScopeExtensions " : true <nl> + " CollectStackTrace " : true <nl> } ; <nl> <nl> var currentlyUncallable = { <nl>
|
Reverted 3130 - 3131 since they don ' t work on mac .
|
v8/v8
|
2880be71eaf05f0fe0a7e5a6d95f6de3909bc01b
|
2009-10-26T15:16:42Z
|
mmm a / tests / integration / test_s3_with_proxy / test . py <nl> ppp b / tests / integration / test_s3_with_proxy / test . py <nl> def cluster ( ) : <nl> def check_proxy_logs ( cluster , proxy_instance , http_methods = { " POST " , " PUT " , " GET " , " DELETE " } ) : <nl> for i in range ( 10 ) : <nl> logs = cluster . get_container_logs ( proxy_instance ) <nl> - # Check that all possible interactions with Minio are present <nl> + # Check with retry that all possible interactions with Minio are present <nl> for http_method in http_methods : <nl> if logs . find ( http_method + " http : / / minio1 " ) > = 0 : <nl> return <nl>
|
Update test . py
|
ClickHouse/ClickHouse
|
d1bb6b655553d429dd47dbc2079f8de26a4a238c
|
2020-09-26T08:47:26Z
|
mmm a / modules / mono / utils / thread_local . cpp <nl> ppp b / modules / mono / utils / thread_local . cpp <nl> struct ThreadLocalStorage : : Impl { <nl> # endif <nl> } <nl> <nl> - Impl ( void ( * p_destr_callback_func ) ( void * ) ) { <nl> + # ifdef WINDOWS_ENABLED <nl> + # define _CALLBACK_FUNC_ __stdcall <nl> + # else <nl> + # define _CALLBACK_FUNC_ <nl> + # endif <nl> + <nl> + Impl ( void _CALLBACK_FUNC_ ( * p_destr_callback_func ) ( void * ) ) { <nl> # ifdef WINDOWS_ENABLED <nl> dwFlsIndex = FlsAlloc ( p_destr_callback_func ) ; <nl> ERR_FAIL_COND ( dwFlsIndex = = FLS_OUT_OF_INDEXES ) ; <nl> void ThreadLocalStorage : : set_value ( void * p_value ) const { <nl> pimpl - > set_value ( p_value ) ; <nl> } <nl> <nl> - void ThreadLocalStorage : : alloc ( void ( * p_destr_callback ) ( void * ) ) { <nl> + void ThreadLocalStorage : : alloc ( void _CALLBACK_FUNC_ ( * p_destr_callback ) ( void * ) ) { <nl> pimpl = memnew ( ThreadLocalStorage : : Impl ( p_destr_callback ) ) ; <nl> } <nl> <nl> + # undef _CALLBACK_FUNC_ <nl> + <nl> void ThreadLocalStorage : : free ( ) { <nl> memdelete ( pimpl ) ; <nl> pimpl = NULL ; <nl> mmm a / modules / mono / utils / thread_local . h <nl> ppp b / modules / mono / utils / thread_local . h <nl> <nl> <nl> # include " core / typedefs . h " <nl> <nl> + # ifdef WINDOWS_ENABLED <nl> + # define _CALLBACK_FUNC_ __stdcall <nl> + # else <nl> + # define _CALLBACK_FUNC_ <nl> + # endif <nl> + <nl> struct ThreadLocalStorage { <nl> <nl> void * get_value ( ) const ; <nl> void set_value ( void * p_value ) const ; <nl> <nl> - void alloc ( void ( * p_dest_callback ) ( void * ) ) ; <nl> + void alloc ( void _CALLBACK_FUNC_ ( * p_dest_callback ) ( void * ) ) ; <nl> void free ( ) ; <nl> <nl> private : <nl> class ThreadLocal { <nl> <nl> T init_val ; <nl> <nl> - # ifdef WINDOWS_ENABLED <nl> - # define _CALLBACK_FUNC_ __stdcall <nl> - # else <nl> - # define _CALLBACK_FUNC_ <nl> - # endif <nl> - <nl> static void _CALLBACK_FUNC_ destr_callback ( void * tls_data ) { <nl> memdelete ( static_cast < T * > ( tls_data ) ) ; <nl> } <nl> <nl> - # undef _CALLBACK_FUNC_ <nl> <nl> T * _tls_get_value ( ) const { <nl> void * tls_data = storage . get_value ( ) ; <nl> struct FlagScopeGuard { <nl> bool & flag ; <nl> } ; <nl> <nl> + # undef _CALLBACK_FUNC_ <nl> + <nl> # define _TLS_RECURSION_GUARD_V_ ( m_ret ) \ <nl> static _THREAD_LOCAL_ ( bool ) _recursion_flag_ = false ; \ <nl> if ( _recursion_flag_ ) \ <nl>
|
Merge pull request from hpvb / fix - mono - mingw
|
godotengine/godot
|
b3919dcb44988c72a46e3b97beb41fba68219d4c
|
2018-07-29T20:36:44Z
|
mmm a / docs / howto / how_to_run_apollo_2 . 5_with_ubuntu16 . md <nl> ppp b / docs / howto / how_to_run_apollo_2 . 5_with_ubuntu16 . md <nl> With this , the ` perception_lowcost_vis ` should work on your machine without a se <nl> The issue comes from a behavior changes in the latest nvidia driver and a glfw bug . You can find information about the bug [ here ] ( http : / / www . glfw . org / docs / latest / window_guide . html # window_hints_ctx ) . To summarize the behaviour , <nl> <nl> ` ` ` <nl> - “ On some Linux systems , creating contexts via both the native and EGL APIs in a single process will cause the application to segfault . Stick to one API or the other on Linux for now . ” <nl> + “ On some Linux systems , creating contexts via both the native and EGL APIs in a single process will cause <nl> + the application to segfault . Stick to one API or the other on Linux for now . ” <nl> ` ` ` <nl> <nl> So , with the driver ( on Ubuntu 16 ) , glfw_fusion_viewer needs to be set up to use EGL_CONTEXT_API instead of the default NATIVE_CONTEXT_API to evade the segfault . <nl>
|
update
|
ApolloAuto/apollo
|
866f5b9ea6bb5b76ac6265751873a7345914128f
|
2018-06-20T20:12:22Z
|
mmm a / Documentation / Examples / system1 <nl> ppp b / Documentation / Examples / system1 <nl> <nl> arango > require ( " internal " ) . processStat ( ) ; <nl> - { minorPageFaults : 2683 , <nl> + { <nl> + minorPageFaults : 2683 , <nl> majorPageFaults : 0 , <nl> userTime : 26 , <nl> systemTime : 7 , <nl> - numberThreads : 4 , <nl> + numberOfThreads : 4 , <nl> residentSize : 2288 , <nl> - virtualSize : 55861248 } <nl> + virtualSize : 55861248 <nl> + } <nl>
|
issue : example bug in docs
|
arangodb/arangodb
|
95b44f588b4585e36772da38ac74a8b1c0cc2862
|
2013-05-13T06:49:15Z
|
mmm a / utils / build - script - impl <nl> ppp b / utils / build - script - impl <nl> for host in " $ { ALL_HOSTS [ @ ] } " ; do <nl> # from this file as possible and just have a single call to lldb - dotest . <nl> if [ [ " $ using_xcodebuild " = = " FALSE " ] ] ; then <nl> with_pushd $ { lldb_build_dir } \ <nl> - call $ { NINJA_BIN } unittests / LLDBUnitTests <nl> + call $ { NINJA_BIN } unittests / LLDBUnitTests <nl> with_pushd $ { lldb_build_dir } \ <nl> - call $ { NINJA_BIN } lldb - test - depends <nl> + call $ { NINJA_BIN } lldb - test - deps <nl> with_pushd $ { results_dir } \ <nl> - call " $ { llvm_build_dir } / bin / llvm - lit " \ <nl> - " $ { lldb_build_dir } / lit " \ <nl> - $ { LLVM_LIT_ARGS } \ <nl> - - - xunit - xml - output = $ { results_dir } / results . xml \ <nl> - - - param dotest - args = " - - build - dir $ { lldb_build_dir } / lldb - test - build . noindex $ { LLDB_TEST_SUBDIR_CLAUSE } $ { LLDB_TEST_CATEGORIES } - t - E \ " $ { DOTEST_EXTRA } \ " " <nl> + call " $ { llvm_build_dir } / bin / llvm - lit " \ <nl> + " $ { lldb_build_dir } / lit " \ <nl> + $ { LLVM_LIT_ARGS } \ <nl> + - - xunit - xml - output = $ { results_dir } / results . xml \ <nl> + - - param dotest - args = " - - build - dir $ { lldb_build_dir } / lldb - test - build . noindex $ { LLDB_TEST_SUBDIR_CLAUSE } $ { LLDB_TEST_CATEGORIES } - t - E \ " $ { DOTEST_EXTRA } \ " " <nl> if [ [ - x " $ { LLDB_TEST_SWIFT_COMPATIBILITY } " ] ] ; then <nl> echo " Running LLDB swift compatibility tests against " \ <nl> " $ { LLDB_TEST_SWIFT_COMPATIBILITY } " <nl>
|
Rename lldb - test - depends - > lldb - test - deps
|
apple/swift
|
5b1d826e9e310297d5fc2fc1a4683ba589059e1b
|
2019-02-14T01:33:05Z
|
mmm a / Makefile <nl> ppp b / Makefile <nl> <nl> - source = parse . cpp parserstate . cpp parser . cpp templates . cpp terminal . cpp termemu . cpp parseraction . cpp terminalfunctions . cpp swrite . cpp terminalframebuffer . cpp terminaldispatcher . cpp terminaluserinput . cpp terminaldisplay . cpp network . cpp ntester . cpp ocb . cpp base64 . cpp encrypt . cpp decrypt . cpp crypto . cpp networktransport . cpp <nl> - objects = parserstate . o parser . o templates . o terminal . o parseraction . o terminalfunctions . o swrite . o terminalframebuffer . o terminaldispatcher . o terminaluserinput . o terminaldisplay . o network . o ocb . o base64 . o crypto . o networktransport . o <nl> + source = parse . cpp parserstate . cpp parser . cpp templates . cpp terminal . cpp termemu . cpp parseraction . cpp terminalfunctions . cpp swrite . cpp terminalframebuffer . cpp terminaldispatcher . cpp terminaluserinput . cpp terminaldisplay . cpp network . cpp ntester . cpp ocb . cpp base64 . cpp encrypt . cpp decrypt . cpp crypto . cpp networktransport . cpp networkinstruction . cpp keystroke . cpp <nl> + objects = parserstate . o parser . o templates . o terminal . o parseraction . o terminalfunctions . o swrite . o terminalframebuffer . o terminaldispatcher . o terminaluserinput . o terminaldisplay . o network . o ocb . o base64 . o crypto . o networktransport . o networkinstruction . o keystroke . o <nl> repos = templates . rpo <nl> executables = parse termemu ntester encrypt decrypt <nl> <nl> CXX = g + + <nl> - CXXFLAGS = - g - - std = c + + 0x - pedantic - Werror - Wall - Wextra - Weffc + + - fno - implicit - templates - fno - default - inline - pipe - D_FILE_OFFSET_BITS = 64 - D_XOPEN_SOURCE = 500 - D_GNU_SOURCE <nl> + CXXFLAGS = - g - - std = c + + 0x - pedantic - Werror - Wall - Wextra - Weffc + + - fno - implicit - templates - fno - default - inline - pipe - D_FILE_OFFSET_BITS = 64 - D_XOPEN_SOURCE = 500 - D_GNU_SOURCE - D_BSD_SOURCE <nl> LIBS = - lutil - lssl - lrt <nl> <nl> all : $ ( executables ) <nl> new file mode 100644 <nl> index 00000000 . . 8d5b1291 <nl> mmm / dev / null <nl> ppp b / keystroke . cpp <nl> <nl> + # include < assert . h > <nl> + <nl> + # include " keystroke . hpp " <nl> + <nl> + void KeyStroke : : subtract ( KeyStroke * const prefix ) <nl> + { <nl> + for ( deque < char > : : iterator i = prefix - > user_bytes . begin ( ) ; <nl> + i ! = prefix - > user_bytes . end ( ) ; <nl> + i + + ) { <nl> + assert ( * i = = user_bytes . front ( ) ) ; <nl> + user_bytes . pop_front ( ) ; <nl> + } <nl> + } <nl> + <nl> + string KeyStroke : : diff_from ( KeyStroke const & existing , int length_limit ) <nl> + { <nl> + string ret ; <nl> + <nl> + deque < char > : : iterator my_it = user_bytes . begin ( ) ; <nl> + <nl> + for ( deque < char > : : const_iterator i = existing . user_bytes . begin ( ) ; <nl> + i ! = existing . user_bytes . end ( ) ; <nl> + i + + ) { <nl> + assert ( * i = = * my_it ) ; <nl> + my_it + + ; <nl> + } <nl> + <nl> + while ( ( my_it ! = user_bytes . end ( ) ) <nl> + & & ( ( length_limit < 0 ) ? true : ( int ( ret . size ( ) ) < length_limit ) ) ) { <nl> + ret + = string ( & ( * my_it ) , 1 ) ; <nl> + my_it + + ; <nl> + } <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + void KeyStroke : : apply_string ( string diff ) <nl> + { <nl> + for ( string : : iterator i = diff . begin ( ) ; <nl> + i ! = diff . end ( ) ; <nl> + i + + ) { <nl> + user_bytes . push_back ( * i ) ; <nl> + } <nl> + } <nl> mmm a / keystroke . hpp <nl> ppp b / keystroke . hpp <nl> <nl> # ifndef KEYSTROKE_HPP <nl> # define KEYSTROKE_HPP <nl> <nl> + # include < deque > <nl> # include < string > <nl> # include < assert . h > <nl> <nl> using namespace std ; <nl> class KeyStroke <nl> { <nl> public : <nl> - void subtract ( KeyStroke * const ) { } <nl> - string diff_from ( KeyStroke const & , int ) { return " " ; } <nl> - void apply_string ( string ) { } <nl> - bool operator = = ( KeyStroke const & ) const { return true ; } <nl> + deque < char > user_bytes ; <nl> + <nl> + KeyStroke ( ) : user_bytes ( ) { } <nl> + <nl> + void key_hit ( char x ) { user_bytes . push_back ( x ) ; } <nl> + <nl> + / * interface for Network : : Transport * / <nl> + void subtract ( KeyStroke * const prefix ) ; <nl> + string diff_from ( KeyStroke const & existing , int length_limit ) ; <nl> + void apply_string ( string diff ) ; <nl> + bool operator = = ( KeyStroke const & x ) const { return user_bytes = = x . user_bytes ; } <nl> } ; <nl> <nl> # endif <nl> mmm a / network . cpp <nl> ppp b / network . cpp <nl> string Packet : : tostring ( Session * session ) <nl> { <nl> uint64_t direction_seq = ( uint64_t ( direction = = TO_CLIENT ) < < 63 ) | ( seq & 0x7FFFFFFFFFFFFFFF ) ; <nl> <nl> - return session - > encrypt ( Message ( direction_seq , payload ) ) ; <nl> + return session - > encrypt ( Message ( Nonce ( direction_seq ) , payload ) ) ; <nl> } <nl> <nl> Packet Connection : : new_packet ( string & s_payload ) <nl> mmm a / network . hpp <nl> ppp b / network . hpp <nl> namespace Network { <nl> void send ( string & s ) ; <nl> string recv ( void ) ; <nl> int fd ( void ) { return sock ; } <nl> - int port ( void ) ; <nl> int get_MTU ( void ) { return MTU ; } <nl> + <nl> + int port ( void ) ; <nl> string get_key ( void ) { return key . printable_key ( ) ; } <nl> } ; <nl> } <nl> new file mode 100644 <nl> index 00000000 . . 906488b3 <nl> mmm / dev / null <nl> ppp b / networkinstruction . cpp <nl> <nl> + # include < endian . h > <nl> + <nl> + # include " networktransport . hpp " <nl> + <nl> + using namespace Network ; <nl> + <nl> + static string network_order_string ( uint64_t host_order ) <nl> + { <nl> + uint64_t net_int = htobe64 ( host_order ) ; <nl> + return string ( ( char * ) & net_int , sizeof ( net_int ) ) ; <nl> + } <nl> + <nl> + string Instruction : : tostring ( void ) <nl> + { <nl> + string ret ; <nl> + <nl> + ret + = network_order_string ( old_num ) ; <nl> + ret + = network_order_string ( new_num ) ; <nl> + ret + = network_order_string ( ack_num ) ; <nl> + ret + = diff ; <nl> + <nl> + return ret ; <nl> + } <nl> mmm a / networktransport . cpp <nl> ppp b / networktransport . cpp <nl> <nl> # include < assert . h > <nl> + # include < iostream > <nl> <nl> # include " networktransport . hpp " <nl> <nl> Transport < MyState , RemoteState > : : Transport ( MyState & initial_state , <nl> / * client * / <nl> } <nl> <nl> - template < class MyState , class RemoteState > <nl> - void Transport < MyState , RemoteState > : : new_state ( MyState & s ) <nl> - { <nl> - current_state = s ; <nl> - <nl> - tick ( ) ; <nl> - } <nl> - <nl> template < class MyState , class RemoteState > <nl> void Transport < MyState , RemoteState > : : tick ( void ) <nl> { <nl> / * Update assumed receiver state * / <nl> update_assumed_receiver_state ( ) ; <nl> <nl> + fprintf ( stderr , " Assumed receiver state : % d / % d \ r \ n " , <nl> + int ( assumed_receiver_state - > num ) , <nl> + int ( sent_states . back ( ) . num ) ) ; <nl> + <nl> / * Cut out common prefix of all states * / <nl> rationalize_states ( ) ; <nl> <nl> void Transport < MyState , RemoteState > : : tick ( void ) <nl> template < class MyState , class RemoteState > <nl> void Transport < MyState , RemoteState > : : send_to_receiver ( void ) <nl> { <nl> - if ( assumed_receiver_state - > state = = sent_states . back ( ) . state ) { <nl> - / * send empty ack * / <nl> - Instruction inst ( assumed_receiver_state - > num , <nl> - assumed_receiver_state - > num , <nl> - " " , <nl> - highest_state_received ) ; <nl> - string s = inst . tostring ( ) ; <nl> - connection . send ( s ) ; <nl> - sent_states . back ( ) . timestamp = timestamp ( ) ; <nl> - return ; <nl> - } <nl> - <nl> - / * Otherwise , send sequence of diffs between assumed receiver state and current state * / <nl> - <nl> / * We don ' t want to assume that this sequence of diffs will <nl> necessarily bring the receiver to the _actual_ current <nl> state . That requires perfect round - trip stability of the diff <nl> void Transport < MyState , RemoteState > : : send_to_receiver ( void ) <nl> MyState target_receiver_state ( assumed_receiver_state - > state ) ; <nl> target_receiver_state . apply_string ( current_state . diff_from ( target_receiver_state , - 1 ) ) ; <nl> <nl> + if ( assumed_receiver_state - > state = = target_receiver_state ) { <nl> + / * send empty ack * / <nl> + Instruction inst ( assumed_receiver_state - > num , <nl> + assumed_receiver_state - > num , <nl> + highest_state_received , <nl> + " " ) ; <nl> + string s = inst . tostring ( ) ; <nl> + connection . send ( s ) ; <nl> + assumed_receiver_state - > timestamp = timestamp ( ) ; <nl> + <nl> + fprintf ( stderr , " Empty ack . \ r \ n " ) ; <nl> + <nl> + return ; <nl> + } <nl> + <nl> + int tries = 0 ; <nl> while ( ! ( assumed_receiver_state - > state = = target_receiver_state ) ) { <nl> - Instruction inst ( assumed_receiver_state - > num , - 1 , <nl> + if ( tries + + > 1024 ) { <nl> + fprintf ( stderr , " BUG : Convergence limit exceeded . \ n " ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + <nl> + Instruction inst ( assumed_receiver_state - > num , - 1 , highest_state_received , <nl> current_state . diff_from ( assumed_receiver_state - > state , <nl> - connection . get_MTU ( ) - HEADER_LEN ) , <nl> - highest_state_received ) ; <nl> + connection . get_MTU ( ) - HEADER_LEN ) ) ; <nl> MyState new_state = assumed_receiver_state - > state ; <nl> new_state . apply_string ( inst . diff ) ; <nl> <nl> void Transport < MyState , RemoteState > : : send_to_receiver ( void ) <nl> string s = inst . tostring ( ) ; <nl> <nl> try { <nl> + fprintf ( stderr , " Sending : " ) ; <nl> + for ( size_t i = 0 ; i < s . size ( ) ; i + + ) { <nl> + fprintf ( stderr , " % c " , s [ i ] ) ; <nl> + } <nl> + fprintf ( stderr , " \ r \ n " ) ; <nl> connection . send ( s ) ; <nl> } catch ( MTUException m ) { <nl> continue ; <nl> void Transport < MyState , RemoteState > : : rationalize_states ( void ) <nl> i + + ) { <nl> i - > state . subtract ( known_receiver_state ) ; <nl> } <nl> + <nl> + current_state . subtract ( known_receiver_state ) ; <nl> } <nl> mmm a / networktransport . hpp <nl> ppp b / networktransport . hpp <nl> namespace Network { <nl> { <nl> public : <nl> uint64_t old_num , new_num ; <nl> - string diff ; <nl> - <nl> uint64_t ack_num ; <nl> <nl> - Instruction ( uint64_t s_old_num , uint64_t s_new_num , string s_diff , uint64_t s_ack_num ) <nl> - : old_num ( s_old_num ) , new_num ( s_new_num ) , diff ( s_diff ) , ack_num ( s_ack_num ) <nl> + string diff ; <nl> + <nl> + Instruction ( uint64_t s_old_num , uint64_t s_new_num , uint64_t s_ack_num , string s_diff ) <nl> + : old_num ( s_old_num ) , new_num ( s_new_num ) , ack_num ( s_ack_num ) , diff ( s_diff ) <nl> { } <nl> <nl> - string tostring ( void ) { return " " ; } <nl> + string tostring ( void ) ; <nl> } ; <nl> <nl> template < class State > <nl> namespace Network { <nl> Transport ( MyState & initial_state ) ; <nl> Transport ( MyState & initial_state , const char * key_str , const char * ip , int port ) ; <nl> <nl> - void new_state ( MyState & s ) ; <nl> void tick ( void ) ; <nl> + <nl> + int port ( void ) { return connection . port ( ) ; } <nl> + string get_key ( void ) { return connection . get_key ( ) ; } <nl> + <nl> + MyState & get_current_state ( void ) { return current_state ; } <nl> } ; <nl> } <nl> <nl> mmm a / ntester . cpp <nl> ppp b / ntester . cpp <nl> <nl> # include < termios . h > <nl> # include < unistd . h > <nl> <nl> - # include " network . hpp " <nl> # include " keystroke . hpp " <nl> + # include " networktransport . hpp " <nl> <nl> int main ( int argc , char * argv [ ] ) <nl> { <nl> int main ( int argc , char * argv [ ] ) <nl> char * ip ; <nl> int port ; <nl> <nl> - Network : : Connection * n ; <nl> + KeyStroke user ; <nl> + <nl> + Network : : Transport < KeyStroke , KeyStroke > * n ; <nl> <nl> try { <nl> if ( argc > 1 ) { <nl> int main ( int argc , char * argv [ ] ) <nl> ip = argv [ 2 ] ; <nl> port = atoi ( argv [ 3 ] ) ; <nl> <nl> - n = new Network : : Connection ( key , ip , port ) ; <nl> + n = new Network : : Transport < KeyStroke , KeyStroke > ( user , key , ip , port ) ; <nl> } else { <nl> - n = new Network : : Connection ( ) ; <nl> + n = new Network : : Transport < KeyStroke , KeyStroke > ( user ) ; <nl> } <nl> } catch ( CryptoException e ) { <nl> fprintf ( stderr , " Fatal error : % s \ n " , e . text . c_str ( ) ) ; <nl> int main ( int argc , char * argv [ ] ) <nl> fprintf ( stderr , " Port bound is % d , key is % s \ n " , n - > port ( ) , n - > get_key ( ) . c_str ( ) ) ; <nl> <nl> if ( server ) { <nl> + / * <nl> while ( true ) { <nl> try { <nl> string s = n - > recv ( ) ; <nl> int main ( int argc , char * argv [ ] ) <nl> fprintf ( stderr , " Cryptographic error : % s \ n " , e . text . c_str ( ) ) ; <nl> } <nl> } <nl> + * / <nl> + sleep ( 6000 ) ; <nl> } else { <nl> struct termios saved_termios ; <nl> struct termios the_termios ; <nl> int main ( int argc , char * argv [ ] ) <nl> while ( true ) { <nl> char x = getchar ( ) ; <nl> <nl> - string prefix = " Key ( " + string ( & x , 1 ) + " ) " ; <nl> + n - > get_current_state ( ) . key_hit ( x ) ; <nl> <nl> try { <nl> - n - > send ( prefix ) ; <nl> + n - > tick ( ) ; <nl> } catch ( Network : : NetworkException e ) { <nl> fprintf ( stderr , " % s : % s \ r \ n " , e . function . c_str ( ) , strerror ( e . the_errno ) ) ; <nl> break ; <nl> mmm a / templates . cpp <nl> ppp b / templates . cpp <nl> template class vector < wchar_t > ; <nl> template class vector < int > ; <nl> template class map < string , Function > ; <nl> template class vector < bool > ; <nl> + template class deque < char > ; <nl> <nl> template class Network : : Transport < KeyStroke , KeyStroke > ; <nl>
|
Clean out some bugs in sender
|
mobile-shell/mosh
|
188c44f5befff39e499dee471385895b9485d119
|
2011-08-09T06:34:20Z
|
mmm a / src / base58 . cpp <nl> ppp b / src / base58 . cpp <nl> bool CBitcoinAddress : : Set ( const CTxDestination & dest ) { <nl> } <nl> <nl> bool CBitcoinAddress : : IsValid ( ) const { <nl> + return IsValid ( Params ( ) ) ; <nl> + } <nl> + <nl> + bool CBitcoinAddress : : IsValid ( const CChainParams & params ) const { <nl> bool fCorrectSize = vchData . size ( ) = = 20 ; <nl> - bool fKnownVersion = vchVersion = = Params ( ) . Base58Prefix ( CChainParams : : PUBKEY_ADDRESS ) | | <nl> - vchVersion = = Params ( ) . Base58Prefix ( CChainParams : : SCRIPT_ADDRESS ) ; <nl> + bool fKnownVersion = vchVersion = = params . Base58Prefix ( CChainParams : : PUBKEY_ADDRESS ) | | <nl> + vchVersion = = params . Base58Prefix ( CChainParams : : SCRIPT_ADDRESS ) ; <nl> return fCorrectSize & & fKnownVersion ; <nl> } <nl> <nl> mmm a / src / base58 . h <nl> ppp b / src / base58 . h <nl> class CBitcoinAddress : public CBase58Data { <nl> bool Set ( const CScriptID & id ) ; <nl> bool Set ( const CTxDestination & dest ) ; <nl> bool IsValid ( ) const ; <nl> + bool IsValid ( const CChainParams & params ) const ; <nl> <nl> CBitcoinAddress ( ) { } <nl> CBitcoinAddress ( const CTxDestination & dest ) { Set ( dest ) ; } <nl> mmm a / src / chainparams . cpp <nl> ppp b / src / chainparams . cpp <nl> const CChainParams & Params ( ) { <nl> return * pCurrentParams ; <nl> } <nl> <nl> - void SelectParams ( CBaseChainParams : : Network network ) { <nl> - SelectBaseParams ( network ) ; <nl> + CChainParams & Params ( CBaseChainParams : : Network network ) { <nl> switch ( network ) { <nl> case CBaseChainParams : : MAIN : <nl> - pCurrentParams = & mainParams ; <nl> - break ; <nl> + return mainParams ; <nl> case CBaseChainParams : : TESTNET : <nl> - pCurrentParams = & testNetParams ; <nl> - break ; <nl> + return testNetParams ; <nl> case CBaseChainParams : : REGTEST : <nl> - pCurrentParams = & regTestParams ; <nl> - break ; <nl> + return regTestParams ; <nl> default : <nl> assert ( false & & " Unimplemented network " ) ; <nl> - return ; <nl> + return mainParams ; <nl> } <nl> } <nl> <nl> + void SelectParams ( CBaseChainParams : : Network network ) { <nl> + SelectBaseParams ( network ) ; <nl> + pCurrentParams = & Params ( network ) ; <nl> + } <nl> + <nl> bool SelectParamsFromCommandLine ( ) { <nl> if ( ! SelectBaseParamsFromCommandLine ( ) ) <nl> return false ; <nl> mmm a / src / chainparams . h <nl> ppp b / src / chainparams . h <nl> class CChainParams <nl> * / <nl> const CChainParams & Params ( ) ; <nl> <nl> + / * * Return parameters for the given network . * / <nl> + CChainParams & Params ( CBaseChainParams : : Network network ) ; <nl> + <nl> / * * Sets the params returned by Params ( ) to those for the given network . * / <nl> void SelectParams ( CBaseChainParams : : Network network ) ; <nl> <nl> mmm a / src / qt / paymentserver . cpp <nl> ppp b / src / qt / paymentserver . cpp <nl> <nl> # include " optionsmodel . h " <nl> <nl> # include " base58 . h " <nl> + # include " chainparams . h " <nl> # include " ui_interface . h " <nl> # include " util . h " <nl> # include " wallet . h " <nl> bool PaymentServer : : ipcParseCommandLine ( int argc , char * argv [ ] ) <nl> { <nl> CBitcoinAddress address ( r . address . toStdString ( ) ) ; <nl> <nl> - SelectParams ( CBaseChainParams : : MAIN ) ; <nl> - if ( ! address . IsValid ( ) ) <nl> + if ( address . IsValid ( Params ( CBaseChainParams : : MAIN ) ) ) <nl> + { <nl> + SelectParams ( CBaseChainParams : : MAIN ) ; <nl> + } <nl> + else if ( address . IsValid ( Params ( CBaseChainParams : : TESTNET ) ) ) <nl> { <nl> SelectParams ( CBaseChainParams : : TESTNET ) ; <nl> } <nl>
|
Merge pull request
|
bitcoin/bitcoin
|
f23869e14bf7710f05f128544f2778dde28a01b7
|
2014-09-10T13:07:58Z
|
mmm a / Examples / Image / Classification / GoogLeNet / BN - Inception / README . md <nl> ppp b / Examples / Image / Classification / GoogLeNet / BN - Inception / README . md <nl> <nl> # # Running the example <nl> <nl> # # # Getting the data <nl> - We use the ILSVRC2012 datasets to demonstrate how to train a BN - Inception network . BN - Inception was initially published by Researchers at Google Inc . , and it is fine - tuned to have excellent classification accuracy and low computation cost . It won first place in the [ ILSVRC ] ( http : / / www . image - net . org / challenges / LSVRC / ) 2014 detection challenge . <nl> + We use the ILSVRC2012 datasets to demonstrate how to train a BN - Inception network . BN - Inception was initially published by Researchers at Google Inc . , and it is firstly described in the Batch Normalization paper ( https : / / arxiv . org / abs / 1502 . 03167 ) to demonstrate the power of Batch Normalization with minor changes on the original GoogLeNet . It has been proved that it could increase the training speed and achieve better accuracy , compared with the GoogLeNet v1 which have been well known for winning first place in the [ ILSVRC ] ( http : / / www . image - net . org / challenges / LSVRC / ) 2014 detection challenge . <nl> <nl> <nl> ILSVRC2012 datasets are not included in the CNTK distribution . You may obtain it through http : / / image - net . org . <nl> mmm a / Examples / Image / Classification / GoogLeNet / InceptionV3 / README . md <nl> ppp b / Examples / Image / Classification / GoogLeNet / InceptionV3 / README . md <nl> <nl> # # Running the example <nl> <nl> # # # Getting the data <nl> - We use the ILSVRC2012 datasets to demonstrate how to train an Inception V3 network . Inception V3 was initially published by Researchers at Google Inc . , and it is fine - tuned to have excellent classification accuracy and low computation cost . It won first place in the [ ILSVRC ] ( http : / / www . image - net . org / challenges / LSVRC / ) 2014 detection challenge . <nl> + We use the ILSVRC2012 datasets to demonstrate how to train an Inception V3 network . Inception V3 was initially published by Researchers at Google Inc . , and it is fine - tuned to have excellent classification accuracy and low computation cost . Its original version , GoogLeNet , won first place in the [ ILSVRC ] ( http : / / www . image - net . org / challenges / LSVRC / ) 2014 detection challenge . <nl> <nl> <nl> ILSVRC2012 datasets are not included in the CNTK distribution . You may obtain it through http : / / image - net . org . <nl>
|
Updates the README . md in Inception example
|
microsoft/CNTK
|
b70a716c2a43df22d22d82efaf85c9b562421282
|
2017-01-18T08:29:53Z
|
mmm a / googlemock / test / gmock - nice - strict_test . cc <nl> ppp b / googlemock / test / gmock - nice - strict_test . cc <nl> using testing : : internal : : CaptureStdout ; <nl> using testing : : internal : : GetCapturedStdout ; <nl> # endif <nl> <nl> + / / Dummy class without default constructor . <nl> + class Dummy { <nl> + public : <nl> + Dummy ( int ) { } <nl> + } ; <nl> + <nl> / / Defines some mock classes needed by the tests . <nl> <nl> class Foo { <nl> class MockFoo : public Foo { <nl> <nl> MOCK_METHOD0 ( DoThis , void ( ) ) ; <nl> MOCK_METHOD1 ( DoThat , int ( bool flag ) ) ; <nl> - MOCK_METHOD0 ( ReturnSomething , Mock ( ) ) ; <nl> + MOCK_METHOD0 ( ReturnSomething , Dummy ( ) ) ; <nl> <nl> private : <nl> GTEST_DISALLOW_COPY_AND_ASSIGN_ ( MockFoo ) ; <nl>
|
Switch return type to class without default constructor
|
google/googletest
|
36777251c07788549eaa72a9be0cf482ab322c46
|
2017-08-18T10:28:50Z
|
mmm a / main / main . cpp <nl> ppp b / main / main . cpp <nl> static int init_screen = - 1 ; <nl> static bool use_vsync = true ; <nl> static bool editor = false ; <nl> static bool show_help = false ; <nl> + static bool disable_render_loop = false ; <nl> + static int fixed_fps = - 1 ; <nl> <nl> static OS : : ProcessID allow_focus_steal_pid = 0 ; <nl> <nl> void Main : : print_help ( const char * p_binary ) { <nl> # endif <nl> OS : : get_singleton ( ) - > print ( " - - frame - delay < ms > Simulate high CPU load ( delay each frame by < ms > milliseconds ) . \ n " ) ; <nl> OS : : get_singleton ( ) - > print ( " - - time - scale < scale > Force time scale ( higher values are faster , 1 . 0 is normal speed ) . \ n " ) ; <nl> + OS : : get_singleton ( ) - > print ( " - - disable - render - loop Disable render loop so rendering only occurs when called explicitly from script . \ n " ) ; <nl> + OS : : get_singleton ( ) - > print ( " - - fixed - fps < fps > Forces a fixed ratio between process and fixed_process timing , for use when precision is required , or when rendering to video files . Setting this will disable real - time syncronization , so that run speed is only capped by performance \ n " ) ; <nl> OS : : get_singleton ( ) - > print ( " \ n " ) ; <nl> <nl> OS : : get_singleton ( ) - > print ( " Standalone tools : \ n " ) ; <nl> Error Main : : setup ( const char * execpath , int argc , char * argv [ ] , bool p_second_ph <nl> OS : : get_singleton ( ) - > print ( " Missing editor PID argument , aborting . \ n " ) ; <nl> goto error ; <nl> } <nl> + } else if ( I - > get ( ) = = " - - disable - render - loop " ) { <nl> + disable_render_loop = true ; <nl> + } else if ( I - > get ( ) = = " - - fixed - fps " ) { <nl> + if ( I - > next ( ) ) { <nl> + fixed_fps = I - > next ( ) - > get ( ) . to_int ( ) ; <nl> + N = I - > next ( ) - > next ( ) ; <nl> + } else { <nl> + OS : : get_singleton ( ) - > print ( " Missing fixed - fps argument , aborting . \ n " ) ; <nl> + goto error ; <nl> + } <nl> } else { <nl> <nl> / / test for game path <nl> bool Main : : iteration ( ) { <nl> uint64_t ticks_elapsed = ticks - last_ticks ; <nl> <nl> double step = ( double ) ticks_elapsed / 1000000 . 0 ; <nl> + if ( fixed_fps ! = - 1 ) <nl> + step = 1 . 0 / fixed_fps ; <nl> + <nl> float frame_slice = 1 . 0 / Engine : : get_singleton ( ) - > get_iterations_per_second ( ) ; <nl> <nl> Engine : : get_singleton ( ) - > _frame_step = step ; <nl> bool Main : : iteration ( ) { <nl> <nl> last_ticks = ticks ; <nl> <nl> - if ( step > frame_slice * 8 ) <nl> + if ( fixed_fps = = - 1 & & step > frame_slice * 8 ) <nl> step = frame_slice * 8 ; <nl> <nl> time_accum + = step ; <nl> bool Main : : iteration ( ) { <nl> <nl> VisualServer : : get_singleton ( ) - > sync ( ) ; / / sync if still drawing from previous frames . <nl> <nl> - if ( OS : : get_singleton ( ) - > can_draw ( ) ) { <nl> + if ( OS : : get_singleton ( ) - > can_draw ( ) & & ! disable_render_loop ) { <nl> <nl> if ( ( ! force_redraw_requested ) & & OS : : get_singleton ( ) - > is_in_low_processor_usage_mode ( ) ) { <nl> if ( VisualServer : : get_singleton ( ) - > has_changed ( ) ) { <nl> bool Main : : iteration ( ) { <nl> frames = 0 ; <nl> } <nl> <nl> + if ( fixed_fps ! = - 1 ) <nl> + return exit ; <nl> + <nl> if ( OS : : get_singleton ( ) - > is_in_low_processor_usage_mode ( ) | | ! OS : : get_singleton ( ) - > can_draw ( ) ) <nl> OS : : get_singleton ( ) - > delay_usec ( 16600 ) ; / / apply some delay to force idle time ( results in about 60 FPS max ) <nl> else { <nl> mmm a / servers / visual_server . cpp <nl> ppp b / servers / visual_server . cpp <nl> Array VisualServer : : mesh_surface_get_arrays ( RID p_mesh , int p_surface ) const { <nl> <nl> void VisualServer : : _bind_methods ( ) { <nl> <nl> + ClassDB : : bind_method ( D_METHOD ( " force_draw " ) , & VisualServer : : draw ) ; <nl> ClassDB : : bind_method ( D_METHOD ( " texture_create " ) , & VisualServer : : texture_create ) ; <nl> ClassDB : : bind_method ( D_METHOD ( " texture_create_from_image " , " image " , " flags " ) , & VisualServer : : texture_create_from_image , DEFVAL ( TEXTURE_FLAGS_DEFAULT ) ) ; <nl> / / ClassDB : : bind_method ( D_METHOD ( " texture_allocate " ) , & VisualServer : : texture_allocate , DEFVAL ( TEXTURE_FLAGS_DEFAULT ) ) ; <nl>
|
Merge pull request from Tugsav / simulator_renderer
|
godotengine/godot
|
3b0b0a1d99e2eb8e6d2ca05c74b9ce5b0c556fce
|
2017-08-31T09:52:06Z
|
mmm a / project / VS2010Express / XBMC . vcxproj <nl> ppp b / project / VS2010Express / XBMC . vcxproj <nl> <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ ssrc . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ Stopwatch . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ StreamDetails . cpp " / > <nl> + < ClCompile Include = " . . \ . . \ xbmc \ utils \ StreamUtils . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ StringUtils . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ SystemInfo . cpp " / > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ TimeUtils . cpp " / > <nl> <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ StdString . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ Stopwatch . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ StreamDetails . h " / > <nl> + < ClInclude Include = " . . \ . . \ xbmc \ utils \ StreamUtils . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ StringUtils . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ SystemInfo . h " / > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ TimeUtils . h " / > <nl> mmm a / project / VS2010Express / XBMC . vcxproj . filters <nl> ppp b / project / VS2010Express / XBMC . vcxproj . filters <nl> <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ StreamDetails . cpp " > <nl> < Filter > utils < / Filter > <nl> < / ClCompile > <nl> + < ClCompile Include = " . . \ . . \ xbmc \ utils \ StreamUtils . cpp " > <nl> + < Filter > utils < / Filter > <nl> + < / ClCompile > <nl> < ClCompile Include = " . . \ . . \ xbmc \ utils \ StringUtils . cpp " > <nl> < Filter > utils < / Filter > <nl> < / ClCompile > <nl> <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ StreamDetails . h " > <nl> < Filter > utils < / Filter > <nl> < / ClInclude > <nl> + < ClInclude Include = " . . \ . . \ xbmc \ utils \ StreamUtils . h " > <nl> + < Filter > utils < / Filter > <nl> + < / ClInclude > <nl> < ClInclude Include = " . . \ . . \ xbmc \ utils \ StringUtils . h " > <nl> < Filter > utils < / Filter > <nl> < / ClInclude > <nl> mmm a / xbmc / cores / dvdplayer / DVDPlayer . cpp <nl> ppp b / xbmc / cores / dvdplayer / DVDPlayer . cpp <nl> <nl> # include " utils / log . h " <nl> # include " utils / TimeUtils . h " <nl> # include " utils / StreamDetails . h " <nl> + # include " utils / StreamUtils . h " <nl> # include " storage / MediaManager . h " <nl> # include " dialogs / GUIDialogBusy . h " <nl> # include " dialogs / GUIDialogKaiToast . h " <nl> void CSelectionStreams : : Update ( CDVDInputStream * input , CDVDDemux * demuxer ) <nl> s . name = nav - > GetAudioStreamLanguage ( i ) ; <nl> s . flags = CDemuxStream : : FLAG_NONE ; <nl> s . filename = filename ; <nl> + s . channels = 0 ; <nl> Update ( s ) ; <nl> } <nl> <nl> void CSelectionStreams : : Update ( CDVDInputStream * input , CDVDDemux * demuxer ) <nl> s . name = nav - > GetSubtitleStreamLanguage ( i ) ; <nl> s . flags = CDemuxStream : : FLAG_NONE ; <nl> s . filename = filename ; <nl> + s . channels = 0 ; <nl> Update ( s ) ; <nl> } <nl> } <nl> void CSelectionStreams : : Update ( CDVDInputStream * input , CDVDDemux * demuxer ) <nl> s . flags = stream - > flags ; <nl> s . filename = demuxer - > GetFileName ( ) ; <nl> stream - > GetStreamName ( s . name ) ; <nl> + CStdString codec ; <nl> + demuxer - > GetStreamCodecName ( stream - > iId , codec ) ; <nl> + s . codec = codec ; <nl> + s . channels = 0 ; / / Default to 0 . Overwrite if STREAM_AUDIO below . <nl> if ( stream - > type = = STREAM_AUDIO ) <nl> { <nl> std : : string type ; <nl> void CSelectionStreams : : Update ( CDVDInputStream * input , CDVDDemux * demuxer ) <nl> s . name + = " - " ; <nl> s . name + = type ; <nl> } <nl> + s . channels = ( ( CDemuxStreamAudio * ) stream ) - > iChannels ; <nl> } <nl> Update ( s ) ; <nl> } <nl> void CDVDPlayer : : OpenDefaultStreams ( ) <nl> CLog : : Log ( LOGWARNING , " % s - failed to open default stream ( % d ) " , __FUNCTION__ , st . id ) ; <nl> } <nl> <nl> + if ( ! valid <nl> + & & count > 1 ) <nl> + { <nl> + / * <nl> + * If there is more than one audio stream and a valid one is not chosen yet , select the one <nl> + * with the maximum number of channels or the best codec if the same number of channels . <nl> + * / <nl> + int max_channels = - 1 ; <nl> + int max_codec_priority = - 1 ; <nl> + CStdString max_codec ; <nl> + int max_stream_id = - 1 ; <nl> + for ( int i = 0 ; i < count ; i + + ) <nl> + { <nl> + SelectionStream & s = m_SelectionStreams . Get ( STREAM_AUDIO , i ) ; <nl> + if ( s . source = = STREAM_SOURCE_DEMUX ) / / Only demux streams <nl> + { <nl> + int codec_priority = StreamUtils : : GetCodecPriority ( s . codec ) ; <nl> + if ( s . channels > max_channels <nl> + | | ( s . channels = = max_channels & & codec_priority > max_codec_priority ) ) <nl> + { <nl> + max_channels = s . channels ; <nl> + max_codec_priority = codec_priority ; <nl> + max_codec = s . codec ; <nl> + max_stream_id = i ; <nl> + } <nl> + } <nl> + } <nl> + if ( max_stream_id > = 0 ) <nl> + { <nl> + SelectionStream & s = m_SelectionStreams . Get ( STREAM_AUDIO , max_stream_id ) ; <nl> + if ( OpenAudioStream ( s . id , s . source ) ) <nl> + { <nl> + valid = true ; <nl> + CLog : : Log ( LOGDEBUG , " % s - using automatically selected audio stream ( % d ) based on codec ' % s ' and maximum number of channels ' % d ' " , <nl> + __FUNCTION__ , s . id , max_codec . c_str ( ) , max_channels ) ; <nl> + } <nl> + else <nl> + CLog : : Log ( LOGWARNING , " % s - failed to open automatically selected audio stream ( % d ) " , __FUNCTION__ , s . id ) ; <nl> + } <nl> + } <nl> + <nl> for ( int i = 0 ; i < count & & ! valid ; i + + ) <nl> { <nl> SelectionStream & s = m_SelectionStreams . Get ( STREAM_AUDIO , i ) ; <nl> mmm a / xbmc / cores / dvdplayer / DVDPlayer . h <nl> ppp b / xbmc / cores / dvdplayer / DVDPlayer . h <nl> typedef struct <nl> CDemuxStream : : EFlags flags ; <nl> int source ; <nl> int id ; <nl> + std : : string codec ; <nl> + int channels ; <nl> } SelectionStream ; <nl> <nl> class CSelectionStreams <nl> mmm a / xbmc / utils / Makefile <nl> ppp b / xbmc / utils / Makefile <nl> SRCS = AlarmClock . cpp \ <nl> ssrc . cpp \ <nl> Stopwatch . cpp \ <nl> StreamDetails . cpp \ <nl> + StreamUtils . cpp \ <nl> StringUtils . cpp \ <nl> SystemInfo . cpp \ <nl> TimeUtils . cpp \ <nl> mmm a / xbmc / utils / StreamDetails . cpp <nl> ppp b / xbmc / utils / StreamDetails . cpp <nl> <nl> <nl> # include < math . h > <nl> # include " StreamDetails . h " <nl> + # include " StreamUtils . h " <nl> # include " Variant . h " <nl> <nl> void CStreamDetail : : Archive ( CArchive & ar ) <nl> void CStreamDetailAudio : : Serialize ( CVariant & value ) <nl> value [ " channels " ] = m_iChannels ; <nl> } <nl> <nl> - int CStreamDetailAudio : : GetCodecPriority ( ) const <nl> - { <nl> - / / technically , truehd , dtshd_ma , and flac are equivalently good ( they ' re all lossless ) <nl> - / / however , ffmpeg can ' t decode dtshd_ma losslessy yet <nl> - if ( m_strCodec = = " flac " ) <nl> - return 7 ; <nl> - if ( m_strCodec = = " truehd " ) <nl> - return 6 ; <nl> - if ( m_strCodec = = " dtshd_ma " ) <nl> - return 5 ; <nl> - if ( m_strCodec = = " dtshd_hra " ) <nl> - return 4 ; <nl> - if ( m_strCodec = = " eac3 " ) <nl> - return 3 ; <nl> - if ( m_strCodec = = " dca " ) <nl> - return 2 ; <nl> - if ( m_strCodec = = " ac3 " ) <nl> - return 1 ; <nl> - return 0 ; <nl> - } <nl> - <nl> bool CStreamDetailAudio : : IsWorseThan ( CStreamDetail * that ) <nl> { <nl> if ( that - > m_eType ! = CStreamDetail : : AUDIO ) <nl> bool CStreamDetailAudio : : IsWorseThan ( CStreamDetail * that ) <nl> if ( m_iChannels > sda - > m_iChannels ) <nl> return false ; <nl> <nl> - / / In case of a tie , flac > eac3 > dts > ac3 > all else . <nl> - return sda - > GetCodecPriority ( ) > GetCodecPriority ( ) ; <nl> + / / In case of a tie , revert to codec priority <nl> + return StreamUtils : : GetCodecPriority ( sda - > m_strCodec ) > StreamUtils : : GetCodecPriority ( m_strCodec ) ; <nl> } <nl> <nl> CStreamDetailSubtitle : : CStreamDetailSubtitle ( ) : <nl> mmm a / xbmc / utils / StreamDetails . h <nl> ppp b / xbmc / utils / StreamDetails . h <nl> class CStreamDetailAudio : public CStreamDetail <nl> int m_iChannels ; <nl> CStdString m_strCodec ; <nl> CStdString m_strLanguage ; <nl> - private : <nl> - int GetCodecPriority ( ) const ; <nl> } ; <nl> <nl> class CStreamDetailSubtitle : public CStreamDetail <nl> new file mode 100644 <nl> index 000000000000 . . 8e613d2a2c5d <nl> mmm / dev / null <nl> ppp b / xbmc / utils / StreamUtils . cpp <nl> <nl> + / * <nl> + * Copyright ( C ) 2005 - 2011 Team XBMC <nl> + * http : / / www . xbmc . org <nl> + * <nl> + * This Program is free software ; you can redistribute it and / or modify <nl> + * it under the terms of the GNU General Public License as published by <nl> + * the Free Software Foundation ; either version 2 , or ( at your option ) <nl> + * any later version . <nl> + * <nl> + * This Program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU General Public License <nl> + * along with XBMC ; see the file COPYING . If not , write to <nl> + * the Free Software Foundation , 675 Mass Ave , Cambridge , MA 02139 , USA . <nl> + * http : / / www . gnu . org / copyleft / gpl . html <nl> + * <nl> + * / <nl> + <nl> + # include " StreamUtils . h " <nl> + <nl> + int StreamUtils : : GetCodecPriority ( const CStdString & codec ) <nl> + { <nl> + / * <nl> + * Technically flac , truehd , and dtshd_ma are equivalently good as they ' re all lossless . However , <nl> + * ffmpeg can ' t decode dtshd_ma losslessy yet . <nl> + * / <nl> + if ( codec = = " flac " ) / / Lossless FLAC <nl> + return 7 ; <nl> + if ( codec = = " truehd " ) / / Dolby TrueHD <nl> + return 6 ; <nl> + if ( codec = = " dtshd_ma " ) / / DTS - HD Master Audio ( previously known as DTS + + ) <nl> + return 5 ; <nl> + if ( codec = = " dtshd_hra " ) / / DTS - HD High Resolution Audio <nl> + return 4 ; <nl> + if ( codec = = " eac3 " ) / / Dolby Digital Plus <nl> + return 3 ; <nl> + if ( codec = = " dca " ) / / DTS <nl> + return 2 ; <nl> + if ( codec = = " ac3 " ) / / Dolby Digital <nl> + return 1 ; <nl> + return 0 ; <nl> + } <nl> new file mode 100644 <nl> index 000000000000 . . 4be3b8526890 <nl> mmm / dev / null <nl> ppp b / xbmc / utils / StreamUtils . h <nl> <nl> + # pragma once <nl> + / * <nl> + * Copyright ( C ) 2005 - 2011 Team XBMC <nl> + * http : / / www . xbmc . org <nl> + * <nl> + * This Program is free software ; you can redistribute it and / or modify <nl> + * it under the terms of the GNU General Public License as published by <nl> + * the Free Software Foundation ; either version 2 , or ( at your option ) <nl> + * any later version . <nl> + * <nl> + * This Program is distributed in the hope that it will be useful , <nl> + * but WITHOUT ANY WARRANTY ; without even the implied warranty of <nl> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the <nl> + * GNU General Public License for more details . <nl> + * <nl> + * You should have received a copy of the GNU General Public License <nl> + * along with XBMC ; see the file COPYING . If not , write to <nl> + * the Free Software Foundation , 675 Mass Ave , Cambridge , MA 02139 , USA . <nl> + * http : / / www . gnu . org / copyleft / gpl . html <nl> + * <nl> + * / <nl> + <nl> + # include " StreamUtils . h " <nl> + <nl> + # include " StdString . h " <nl> + <nl> + class StreamUtils <nl> + { <nl> + public : <nl> + static int GetCodecPriority ( const CStdString & codec ) ; <nl> + } ; <nl>
|
Ticket : Added functionality to automatically choose the best audio stream based on the codec and the number of channels as long as a default stream isn ' t specified .
|
xbmc/xbmc
|
07580aaa058b9c86205b8639ad3c4bd7cf3d34fa
|
2011-07-12T09:49:22Z
|
new file mode 100644 <nl> index 0000000000 . . 8b2eab8188 <nl> mmm / dev / null <nl> ppp b / change / react - native - windows - 2020 - 07 - 02 - 04 - 21 - 28 - more - cleanup . json <nl> <nl> + { <nl> + " type " : " prerelease " , <nl> + " comment " : " Replace Custom Generator Prompt With Inquirer " , <nl> + " packageName " : " react - native - windows " , <nl> + " email " : " ngerlem @ microsoft . com " , <nl> + " dependentChangeType " : " patch " , <nl> + " date " : " 2020 - 07 - 02T11 : 21 : 28 . 919Z " <nl> + } <nl> new file mode 100644 <nl> index 0000000000 . . 3b70437f7b <nl> mmm / dev / null <nl> ppp b / change / react - native - windows - init - 2020 - 07 - 02 - 04 - 21 - 28 - more - cleanup . json <nl> <nl> + { <nl> + " type " : " patch " , <nl> + " comment " : " Replace Custom Generator Prompt With Inquirer " , <nl> + " packageName " : " react - native - windows - init " , <nl> + " email " : " ngerlem @ microsoft . com " , <nl> + " dependentChangeType " : " patch " , <nl> + " date " : " 2020 - 07 - 02T11 : 21 : 23 . 930Z " <nl> + } <nl> mmm a / packages / react - native - windows - init / src / Cli . ts <nl> ppp b / packages / react - native - windows - init / src / Cli . ts <nl> import * as chalk from ' chalk ' ; <nl> / / @ ts - ignore <nl> import * as Registry from ' npm - registry ' ; <nl> <nl> - import GenerateWindows from ' . / GenerateWindowsType ' ; <nl> + import requireGenerateWindows from ' . / requireGenerateWindows ' ; <nl> <nl> const npmConfReg = execSync ( ' npm config get registry ' ) <nl> . toString ( ) <nl> const EXITCODE_NO_LATEST_RNW = 8 ; <nl> const EXITCODE_NO_AUTO_MATCHING_RNW = 9 ; <nl> const EXITCODE_INCOMPATIBLE_OPTIONS = 10 ; <nl> <nl> - function requireGenerateWindows ( ) : GenerateWindows { <nl> - try { <nl> - / / Try the path for 0 . 63 + <nl> - return require ( require . resolve ( <nl> - ' react - native - windows / local - cli / lib - commonjs / generate - windows ' , <nl> - { paths : [ process . cwd ( ) ] } , <nl> - ) ) . generateWindows ; <nl> - } catch { <nl> - / / Fall back to trying the older path <nl> - return require ( require . resolve ( <nl> - ' react - native - windows / local - cli / generate - windows ' , <nl> - { paths : [ process . cwd ( ) ] } , <nl> - ) ) ; <nl> - } <nl> - } <nl> - <nl> function getReactNativeAppName ( ) : string { <nl> console . log ( ' Reading application name from package . json . . . ' ) ; <nl> const cwd = process . cwd ( ) ; <nl> You can either downgrade your version of $ { chalk . green ( <nl> installReactNativeWindows ( version , useDevMode ) ; <nl> <nl> const generateWindows = requireGenerateWindows ( ) ; <nl> - generateWindows ( process . cwd ( ) , name , ns , { <nl> + await generateWindows ( process . cwd ( ) , name , ns , { <nl> language : argv . language as ' cs ' | ' cpp ' , <nl> overwrite : argv . overwrite , <nl> verbose : argv . verbose , <nl> mmm a / packages / react - native - windows - init / src / GenerateWindowsType . ts <nl> ppp b / packages / react - native - windows - init / src / GenerateWindowsType . ts <nl> <nl> / / import to just this file and blacklist the file to get around it . Note that <nl> / / we cannot import the real module because it may be in a different location <nl> / / for older versions of RNW . <nl> - import type { generateWindows } from ' react - native - windows / local - cli / lib - commonjs / generate - windows ' ; <nl> + import type { generateWindows , GenerateOptions } from ' react - native - windows / local - cli / lib - commonjs / generate - windows ' ; <nl> <nl> - type GenerateWindows = typeof generateWindows ; <nl> - export default GenerateWindows ; <nl> \ No newline at end of file <nl> + / / Current version <nl> + export type GenerateWindows = typeof generateWindows ; <nl> + <nl> + / / Older versions of GenerateWindows were synchronous <nl> + export type GenerateWindows62 = ( projectDir : string , name : string , ns : string , options : GenerateOptions ) = > void ; <nl> new file mode 100644 <nl> index 0000000000 . . d2ecae11b4 <nl> mmm / dev / null <nl> ppp b / packages / react - native - windows - init / src / requireGenerateWindows . ts <nl> <nl> + / * * <nl> + * Copyright ( c ) Microsoft Corporation . <nl> + * Licensed under the MIT License . <nl> + * <nl> + * @ format <nl> + * / <nl> + <nl> + import { GenerateWindows , GenerateWindows62 } from ' . / GenerateWindowsType ' ; <nl> + <nl> + / * * <nl> + * Returns the Windows template generator function , normalizing the function <nl> + * to any differences across RN versions . <nl> + * / <nl> + export default function requireGenerateWindows ( ) : GenerateWindows { <nl> + try { <nl> + / / Try the path for 0 . 63 + <nl> + const requirePath = require . resolve ( <nl> + ' react - native - windows / local - cli / lib - commonjs / generate - windows ' , <nl> + { paths : [ process . cwd ( ) ] } , <nl> + ) ; <nl> + <nl> + return require ( requirePath ) . generateWindows ; <nl> + } catch { <nl> + / / Fall back to trying the older path <nl> + const requirePath = require . resolve ( <nl> + ' react - native - windows / local - cli / generate - windows ' , <nl> + { paths : [ process . cwd ( ) ] } , <nl> + ) ; <nl> + <nl> + const generate62 : GenerateWindows62 = require ( requirePath ) ; <nl> + return async ( . . . args ) = > generate62 ( . . . args ) ; <nl> + } <nl> + } <nl> mmm a / vnext / local - cli / src / generate - windows . ts <nl> ppp b / vnext / local - cli / src / generate - windows . ts <nl> export interface GenerateOptions { <nl> * @ param ns namespace for the project <nl> * @ param options command line options container <nl> * / <nl> - export function generateWindows ( <nl> + export async function generateWindows ( <nl> projectDir : string , <nl> name : string , <nl> ns : string , <nl> export function generateWindows ( <nl> <nl> installDependencies ( options ) ; <nl> <nl> - copyProjectTemplateAndReplace ( <nl> + await copyProjectTemplateAndReplace ( <nl> path . join ( __dirname , ' . . ' , ' templates ' ) , <nl> projectDir , <nl> name , <nl> const assertStableInterface : typeof generateWindows extends ( <nl> name : string , <nl> ns : string , <nl> options : GenerateOptions , <nl> - ) = > void <nl> + ) = > Promise < void > <nl> ? true <nl> : never = true ; <nl> assertStableInterface ; <nl> mmm a / vnext / local - cli / src / generator - common / index . ts <nl> ppp b / vnext / local - cli / src / generator - common / index . ts <nl> <nl> <nl> import * as fs from ' fs ' ; <nl> import * as chalk from ' chalk ' ; <nl> + import * as inquirer from ' inquirer ' ; <nl> import * as path from ' path ' ; <nl> import * as mustache from ' mustache ' ; <nl> <nl> export type Replacements = { <nl> [ key : string ] : any ; <nl> } ; <nl> <nl> - interface PromptOptions { <nl> - echo ? : string ; <nl> - ask ? : string ; <nl> - value ? : string ; <nl> - autocomplete ? : string [ ] | Function ; <nl> - } <nl> - <nl> - const term = 13 ; / / carriage return <nl> - <nl> - function prompt ( <nl> - ask ? : string | PromptOptions , <nl> - value ? : string | PromptOptions , <nl> - opts ? : PromptOptions , <nl> - ) : string { <nl> - let insert = 0 ; <nl> - opts = opts | | { } ; <nl> - <nl> - if ( typeof ask = = = ' object ' ) { <nl> - opts = ask ; <nl> - ask = opts . ask ; <nl> - } else if ( typeof value = = = ' object ' ) { <nl> - opts = value ; <nl> - value = opts . value ; <nl> - } <nl> - ask = ask | | ' ' ; <nl> - const echo = opts . echo ; <nl> - const masked = ' echo ' in opts ; <nl> - <nl> - let fd ; <nl> - if ( process . platform = = = ' win32 ' ) { <nl> - / / @ ts - ignore <nl> - fd = process . stdin . fd ; <nl> - } else { <nl> - fd = fs . openSync ( ' / dev / tty ' , ' rs ' ) ; <nl> - } <nl> - <nl> - const wasRaw = process . stdin . isRaw ; <nl> - if ( ! wasRaw & & process . stdin . setRawMode ) { <nl> - process . stdin . setRawMode ( true ) ; <nl> - } <nl> - <nl> - / / eslint - disable - next - line no - undef <nl> - let buf = Buffer . alloc ( 3 ) ; <nl> - let str = ' ' ; <nl> - <nl> - let character ; <nl> - <nl> - let read ; <nl> - <nl> - if ( ask ) { <nl> - process . stdout . write ( ask ) ; <nl> - } <nl> - <nl> - while ( true ) { <nl> - read = fs . readSync ( fd , buf , 0 , 3 , null ) ; <nl> - if ( read > 1 ) { <nl> - / / received a control sequence <nl> - if ( buf . toString ( ) ) { <nl> - str + = buf . toString ( ) ; <nl> - str = str . replace ( / \ 0 / g , ' ' ) ; <nl> - insert = str . length ; <nl> - process . stdout . write ( ` \ u001b [ 2K \ u001b [ 0G $ { ask } $ { str } ` ) ; <nl> - process . stdout . write ( ` \ u001b [ $ { insert + ask . length + 1 } G ` ) ; <nl> - / / eslint - disable - next - line no - undef <nl> - buf = Buffer . alloc ( 3 ) ; <nl> - } <nl> - continue ; / / any other 3 character sequence is ignored <nl> - } <nl> - <nl> - / / if it is not a control character seq , assume only one character is read <nl> - character = buf [ read - 1 ] ; <nl> - <nl> - / / catch a ^ C and return null <nl> - if ( character = = = 3 ) { <nl> - process . stdout . write ( ' ^ C \ n ' ) ; <nl> - fs . closeSync ( fd ) ; <nl> - process . exit ( 130 ) ; <nl> - } <nl> - <nl> - / / catch the terminating character <nl> - if ( character = = = term ) { <nl> - fs . closeSync ( fd ) ; <nl> - break ; <nl> - } <nl> - <nl> - if ( <nl> - character = = = 127 | | <nl> - ( process . platform = = = ' win32 ' & & character = = = 8 ) <nl> - ) { <nl> - / / backspace <nl> - if ( ! insert ) { <nl> - continue ; <nl> - } <nl> - str = str . slice ( 0 , insert - 1 ) + str . slice ( insert ) ; <nl> - insert - - ; <nl> - process . stdout . write ( ' \ u001b [ 2D ' ) ; <nl> - } else { <nl> - if ( character < 32 | | character > 126 ) { <nl> - continue ; <nl> - } <nl> - str = <nl> - str . slice ( 0 , insert ) + <nl> - String . fromCharCode ( character ) + <nl> - str . slice ( insert ) ; <nl> - insert + + ; <nl> - } <nl> - <nl> - if ( masked ) { <nl> - process . stdout . write ( <nl> - ` \ u001b [ 2K \ u001b [ 0G $ { ask } $ { Array ( str . length + 1 ) . join ( echo ) } ` , <nl> - ) ; <nl> - } else { <nl> - process . stdout . write ( ' \ u001b [ s ' ) ; <nl> - if ( insert = = = str . length ) { <nl> - process . stdout . write ( ` \ u001b [ 2K \ u001b [ 0G $ { ask } $ { str } ` ) ; <nl> - } else if ( ask ) { <nl> - process . stdout . write ( ` \ u001b [ 2K \ u001b [ 0G $ { ask } $ { str } ` ) ; <nl> - } else { <nl> - process . stdout . write ( <nl> - ` \ u001b [ 2K \ u001b [ 0G $ { str } \ u001b [ $ { str . length - insert } D ` , <nl> - ) ; <nl> - } <nl> - process . stdout . write ( ' \ u001b [ u ' ) ; <nl> - process . stdout . write ( ' \ u001b [ 1C ' ) ; <nl> - } <nl> - } <nl> - <nl> - process . stdout . write ( ' \ n ' ) ; <nl> - <nl> - if ( process . stdin . setRawMode ) { <nl> - process . stdin . setRawMode ( ! ! wasRaw ) ; <nl> - } <nl> - <nl> - return str | | ( value as string ) | | ' ' ; <nl> - } <nl> - <nl> function walk ( current : string ) : string [ ] { <nl> if ( ! fs . lstatSync ( current ) . isDirectory ( ) ) { <nl> return [ current ] ; <nl> function walk ( current : string ) : string [ ] { <nl> / * * <nl> * Get a source file and replace parts of its contents . <nl> * @ param srcPath Path to the source file . <nl> - * @ param { object } replacements e . g . { ' TextToBeReplaced ' : ' Replacement ' } <nl> + * @ param replacements e . g . { ' TextToBeReplaced ' : ' Replacement ' } <nl> * @ return The contents of the file with the replacements applied . <nl> * / <nl> export function resolveContents ( <nl> type ContentChangedCallbackOption = ' identical ' | ' changed ' | ' new ' | null ; <nl> type ContentChangedCallback = ( <nl> path : string , <nl> option : ContentChangedCallbackOption , <nl> - ) = > ' keep ' | ' overwrite ' ; <nl> + ) = > Promise < ' keep ' | ' overwrite ' > ; <nl> <nl> / * * <nl> * Copy a file to given destination , replacing parts of its contents . <nl> type ContentChangedCallback = ( <nl> * If null , files will be overwritten . <nl> * Function ( path , ' identical ' | ' changed ' | ' new ' ) = > ' keep ' | ' overwrite ' <nl> * / <nl> - function copyAndReplace ( <nl> + async function copyAndReplace ( <nl> srcPath : string , <nl> destPath : string , <nl> replacements : Replacements , <nl> function copyAndReplace ( <nl> throw err ; <nl> } <nl> } <nl> - shouldOverwrite = contentChangedCallback ( destPath , contentChanged ) ; <nl> + shouldOverwrite = await contentChangedCallback ( destPath , contentChanged ) ; <nl> } <nl> if ( shouldOverwrite = = = ' overwrite ' ) { <nl> copyBinaryFile ( srcPath , destPath , err = > { <nl> function copyAndReplace ( <nl> throw err ; <nl> } <nl> } <nl> - shouldOverwrite = contentChangedCallback ( destPath , contentChanged ) ; <nl> + shouldOverwrite = await contentChangedCallback ( destPath , contentChanged ) ; <nl> } <nl> if ( shouldOverwrite = = = ' overwrite ' ) { <nl> fs . writeFileSync ( destPath , content , { <nl> export function createDir ( destPath : string ) { <nl> } <nl> } <nl> <nl> - export function copyAndReplaceWithChangedCallback ( <nl> + export async function copyAndReplaceWithChangedCallback ( <nl> srcPath : string , <nl> destRoot : string , <nl> relativeDestPath : string , <nl> export function copyAndReplaceWithChangedCallback ( <nl> contentChanged , <nl> ) ; <nl> <nl> - copyAndReplace ( <nl> + await copyAndReplace ( <nl> srcPath , <nl> path . join ( destRoot , relativeDestPath ) , <nl> replacements , <nl> export function copyAndReplaceWithChangedCallback ( <nl> ) ; <nl> } <nl> <nl> - export function copyAndReplaceAll ( <nl> + export async function copyAndReplaceAll ( <nl> srcPath : string , <nl> destPath : string , <nl> relativeDestDir : string , <nl> replacements : Replacements , <nl> alwaysOverwrite : boolean , <nl> ) { <nl> - walk ( srcPath ) . forEach ( absoluteSrcFilePath = > { <nl> + for ( const absoluteSrcFilePath of walk ( srcPath ) ) { <nl> const filename = path . relative ( srcPath , absoluteSrcFilePath ) ; <nl> const relativeDestPath = path . join ( relativeDestDir , filename ) ; <nl> - copyAndReplaceWithChangedCallback ( <nl> + await copyAndReplaceWithChangedCallback ( <nl> absoluteSrcFilePath , <nl> destPath , <nl> relativeDestPath , <nl> replacements , <nl> alwaysOverwrite , <nl> ) ; <nl> - } ) ; <nl> + } <nl> } <nl> <nl> - function alwaysOverwriteContentChangedCallback ( <nl> + async function alwaysOverwriteContentChangedCallback ( <nl> absoluteSrcFilePath : string , <nl> relativeDestPath : string , <nl> contentChanged : ContentChangedCallbackOption , <nl> - ) { <nl> + ) : Promise < ' keep ' | ' overwrite ' > { <nl> if ( contentChanged = = = ' new ' ) { <nl> console . log ( ` $ { chalk . bold ( ' new ' ) } $ { relativeDestPath } ` ) ; <nl> return ' overwrite ' ; <nl> function alwaysOverwriteContentChangedCallback ( <nl> ) ; <nl> } <nl> <nl> - function upgradeFileContentChangedCallback ( <nl> + async function upgradeFileContentChangedCallback ( <nl> absoluteSrcFilePath : string , <nl> relativeDestPath : string , <nl> contentChanged : ContentChangedCallbackOption , <nl> - ) { <nl> + ) : Promise < ' keep ' | ' overwrite ' > { <nl> if ( contentChanged = = = ' new ' ) { <nl> console . log ( ` $ { chalk . bold ( ' new ' ) } $ { relativeDestPath } ` ) ; <nl> return ' overwrite ' ; <nl> function upgradeFileContentChangedCallback ( <nl> ` $ { chalk . bold ( relativeDestPath ) } ` + <nl> ` has changed in the new version . \ nDo you want to keep your $ { relativeDestPath } or replace it with the ` + <nl> ' latest version ? \ nMake sure you have any changes you made to this file saved somewhere . \ n ' + <nl> - ` You can see the new version here : $ { absoluteSrcFilePath } \ n ` + <nl> - ` Do you want to replace $ { relativeDestPath } ? ` + <nl> - ' Answer y to replace , n to keep your version : ' , <nl> + ` You can see the new version here : $ { absoluteSrcFilePath } ` , <nl> ) ; <nl> - let answer ; <nl> - while ( ! answer ) { <nl> - answer = prompt ( ) ; <nl> - } <nl> <nl> - if ( answer . toLowerCase ( ) = = = ' y ' | | answer . toLowerCase ( ) = = = ' yes ' ) { <nl> - console . log ( ` Replacing $ { relativeDestPath } ` ) ; <nl> - return ' overwrite ' ; <nl> - } <nl> - console . log ( ` Keeping your $ { relativeDestPath } ` ) ; <nl> - return ' keep ' ; <nl> + const { shoudReplace } = await inquirer . prompt ( [ <nl> + { <nl> + name : ' shouldReplace ' , <nl> + type : ' confirm ' , <nl> + message : ` Do you want to replace $ { relativeDestPath } ? ` , <nl> + default : false , <nl> + } , <nl> + ] ) ; <nl> + <nl> + return shoudReplace ? ' overwrite ' : ' keep ' ; <nl> } <nl> if ( contentChanged = = = ' identical ' ) { <nl> return ' keep ' ; <nl> mmm a / vnext / local - cli / src / generator - windows / index . ts <nl> ppp b / vnext / local - cli / src / generator - windows / index . ts <nl> import { GenerateOptions } from ' . . / generate - windows ' ; <nl> const windowsDir = ' windows ' ; <nl> const bundleDir = ' Bundle ' ; <nl> <nl> - function generateCertificate ( <nl> + async function generateCertificate ( <nl> srcPath : string , <nl> destPath : string , <nl> newProjectName : string , <nl> currentUser : string , <nl> - ) : string | null { <nl> + ) : Promise < string | null > { <nl> console . log ( ' Generating self - signed certificate . . . ' ) ; <nl> let toCopyTempKey = false ; <nl> if ( os . platform ( ) = = = ' win32 ' ) { <nl> function generateCertificate ( <nl> toCopyTempKey = true ; <nl> } <nl> if ( toCopyTempKey ) { <nl> - copyAndReplaceWithChangedCallback ( <nl> + await copyAndReplaceWithChangedCallback ( <nl> path . join ( srcPath , ' keys ' , ' MyApp_TemporaryKey . pfx ' ) , <nl> destPath , <nl> path . join ( <nl> function generateCertificate ( <nl> return null ; <nl> } <nl> <nl> - export function copyProjectTemplateAndReplace ( <nl> + export async function copyProjectTemplateAndReplace ( <nl> srcRootPath : string , <nl> destPath : string , <nl> newProjectName : string , <nl> export function copyProjectTemplateAndReplace ( <nl> const rnwVersion = require ( ' react - native - windows / package . json ' ) . version ; <nl> const packageGuid = uuid . v4 ( ) ; <nl> const currentUser = username . sync ( ) ! ; / / Gets the current username depending on the platform . <nl> - const certificateThumbprint = generateCertificate ( <nl> + const certificateThumbprint = await generateCertificate ( <nl> srcPath , <nl> destPath , <nl> newProjectName , <nl> export function copyProjectTemplateAndReplace ( <nl> ' \ n UNREFERENCED_PARAMETER ( packageProviders ) ; ' , / / CODESYNC : vnext \ local - cli \ runWindows \ utils \ autolink . js <nl> } ; <nl> <nl> - [ <nl> + const commonMappings = [ <nl> { from : path . join ( srcRootPath , ' metro . config . js ' ) , to : ' metro . config . js ' } , <nl> { <nl> from : path . join ( srcRootPath , ' _gitignore ' ) , <nl> export function copyProjectTemplateAndReplace ( <nl> from : path . join ( srcPath , projDir , ' MyApp . sln ' ) , <nl> to : path . join ( windowsDir , newProjectName + ' . sln ' ) , <nl> } , <nl> - ] . forEach ( mapping = > <nl> - copyAndReplaceWithChangedCallback ( <nl> + ] ; <nl> + <nl> + for ( const mapping of commonMappings ) { <nl> + await copyAndReplaceWithChangedCallback ( <nl> mapping . from , <nl> destPath , <nl> mapping . to , <nl> templateVars , <nl> options . overwrite , <nl> - ) , <nl> - ) ; <nl> + ) ; <nl> + } <nl> <nl> if ( language = = = ' cs ' ) { <nl> - [ <nl> + const csMappings = [ <nl> { <nl> from : path . join ( srcPath , projDir , ' MyApp . csproj ' ) , <nl> to : path . join ( windowsDir , newProjectName , newProjectName + ' . csproj ' ) , <nl> } , <nl> - ] . forEach ( mapping = > <nl> - copyAndReplaceWithChangedCallback ( <nl> + ] ; <nl> + <nl> + for ( const mapping of csMappings ) { <nl> + await copyAndReplaceWithChangedCallback ( <nl> mapping . from , <nl> destPath , <nl> mapping . to , <nl> templateVars , <nl> options . overwrite , <nl> - ) , <nl> - ) ; <nl> + ) ; <nl> + } <nl> } else { <nl> - [ <nl> + const cppMappings = [ <nl> { <nl> from : path . join ( srcPath , projDir , ' MyApp . vcxproj ' ) , <nl> to : path . join ( windowsDir , newProjectName , newProjectName + ' . vcxproj ' ) , <nl> export function copyProjectTemplateAndReplace ( <nl> from : path . join ( srcPath , projDir , ' packages . config ' ) , <nl> to : path . join ( windowsDir , newProjectName , ' packages . config ' ) , <nl> } , <nl> - ] . forEach ( mapping = > <nl> - copyAndReplaceWithChangedCallback ( <nl> + ] ; <nl> + <nl> + for ( const mapping of cppMappings ) { <nl> + await copyAndReplaceWithChangedCallback ( <nl> mapping . from , <nl> destPath , <nl> mapping . to , <nl> templateVars , <nl> options . overwrite , <nl> - ) , <nl> - ) ; <nl> + ) ; <nl> + } <nl> <nl> / / Once we are publishing to nuget . org , this shouldn ' t be needed anymore <nl> if ( options . experimentalNuGetDependency ) { <nl> - [ <nl> - { <nl> - from : path . join ( srcPath , projDir , ' NuGet . Config ' ) , <nl> - to : path . join ( windowsDir , ' NuGet . Config ' ) , <nl> - } , <nl> - ] . forEach ( mapping = > <nl> - copyAndReplaceWithChangedCallback ( <nl> - mapping . from , <nl> - destPath , <nl> - mapping . to , <nl> - templateVars , <nl> - options . overwrite , <nl> - ) , <nl> + await copyAndReplaceWithChangedCallback ( <nl> + path . join ( srcPath , projDir , ' NuGet . Config ' ) , <nl> + destPath , <nl> + path . join ( windowsDir , ' NuGet . Config ' ) , <nl> + templateVars , <nl> + options . overwrite , <nl> ) ; <nl> } <nl> } <nl> <nl> - copyAndReplaceAll ( <nl> + await copyAndReplaceAll ( <nl> path . join ( srcPath , ' assets ' ) , <nl> destPath , <nl> path . join ( windowsDir , newProjectName , ' Assets ' ) , <nl> templateVars , <nl> options . overwrite , <nl> ) ; <nl> - copyAndReplaceAll ( <nl> + await copyAndReplaceAll ( <nl> path . join ( srcPath , ' src ' ) , <nl> destPath , <nl> path . join ( windowsDir , newProjectName ) , <nl> mmm a / vnext / package . json <nl> ppp b / vnext / package . json <nl> <nl> " envinfo " : " ^ 7 . 5 . 0 " , <nl> " fbjs " : " ^ 1 . 0 . 0 " , <nl> " glob " : " ^ 7 . 1 . 1 " , <nl> + " inquirer " : " ^ 3 . 0 . 6 " , <nl> " mustache " : " ^ 4 . 0 . 1 " , <nl> " ora " : " ^ 3 . 4 . 0 " , <nl> " prop - types " : " ^ 15 . 7 . 2 " , <nl> <nl> " @ react - native - community / cli - types " : " ^ 4 . 10 . 1 " , <nl> " @ react - native - community / eslint - config " : " ^ 1 . 1 . 0 " , <nl> " @ types / chalk " : " ^ 2 . 2 . 0 " , <nl> + " @ types / inquirer " : " ^ 6 . 5 . 0 " , <nl> " @ types / mustache " : " ^ 4 . 0 . 1 " , <nl> " @ types / ora " : " ^ 3 . 2 . 0 " , <nl> " @ types / react " : " 16 . 9 . 0 " , <nl>
|
Replace Custom Generator Prompt With Inquirer ( )
|
microsoft/react-native-windows
|
a25a8294ff602cc457e34dfd38cae10650092810
|
2020-07-02T18:47:51Z
|
mmm a / atom / browser / net / atom_url_request . cc <nl> ppp b / atom / browser / net / atom_url_request . cc <nl> void AtomURLRequest : : DoCancel ( ) { <nl> void AtomURLRequest : : DoFollowRedirect ( ) { <nl> DCHECK_CURRENTLY_ON ( content : : BrowserThread : : IO ) ; <nl> if ( request_ & & request_ - > is_redirecting ( ) & & redirect_policy_ = = " manual " ) { <nl> - request_ - > FollowDeferredRedirect ( <nl> - base : : nullopt / * modified_request_headers * / ) ; <nl> + request_ - > FollowDeferredRedirect ( base : : nullopt / * removed_headers * / , <nl> + base : : nullopt / * modified_headers * / ) ; <nl> } <nl> } <nl> <nl>
|
Increase scope of URLLoader : : FollowRedirect ( ) API implementation .
|
electron/electron
|
3898a44e884505e2ba2d5bd521ff7e2e7f5676e4
|
2019-02-14T18:29:23Z
|
mmm a / drivers / ogg / bitwise . c <nl> ppp b / drivers / ogg / bitwise . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2010 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2014 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : packing variable sized words into an octet stream <nl> - last mod : $ Id : bitwise . c 17287 2010 - 06 - 10 13 : 42 : 06Z tterribe $ <nl> + last mod : $ Id : bitwise . c 19149 2014 - 05 - 27 16 : 26 : 23Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> void oggpack_write ( oggpack_buffer * b , unsigned long value , int bits ) { <nl> b - > ptr = b - > buffer + b - > endbyte ; <nl> } <nl> <nl> - value & = mask [ bits ] ; <nl> + value & = mask [ bits ] ; <nl> bits + = b - > endbit ; <nl> <nl> - b - > ptr [ 0 ] | = value < < b - > endbit ; <nl> - <nl> + b - > ptr [ 0 ] | = value < < b - > endbit ; <nl> + <nl> if ( bits > = 8 ) { <nl> b - > ptr [ 1 ] = ( unsigned char ) ( value > > ( 8 - b - > endbit ) ) ; <nl> if ( bits > = 16 ) { <nl> void oggpackB_write ( oggpack_buffer * b , unsigned long value , int bits ) { <nl> b - > ptr = b - > buffer + b - > endbyte ; <nl> } <nl> <nl> - value = ( value & mask [ bits ] ) < < ( 32 - bits ) ; <nl> + value = ( value & mask [ bits ] ) < < ( 32 - bits ) ; <nl> bits + = b - > endbit ; <nl> <nl> - b - > ptr [ 0 ] | = value > > ( 24 + b - > endbit ) ; <nl> - <nl> + b - > ptr [ 0 ] | = value > > ( 24 + b - > endbit ) ; <nl> + <nl> if ( bits > = 8 ) { <nl> b - > ptr [ 1 ] = ( unsigned char ) ( value > > ( 16 + b - > endbit ) ) ; <nl> if ( bits > = 16 ) { <nl> static void oggpack_writecopy_helper ( oggpack_buffer * b , <nl> unsigned char * ptr = ( unsigned char * ) source ; <nl> <nl> long bytes = bits / 8 ; <nl> + long pbytes = ( b - > endbit + bits ) / 8 ; <nl> bits - = bytes * 8 ; <nl> <nl> + / * expand storage up - front * / <nl> + if ( b - > endbyte + pbytes > = b - > storage ) { <nl> + void * ret ; <nl> + if ( ! b - > ptr ) goto err ; <nl> + if ( b - > storage > b - > endbyte + pbytes + BUFFER_INCREMENT ) goto err ; <nl> + b - > storage = b - > endbyte + pbytes + BUFFER_INCREMENT ; <nl> + ret = _ogg_realloc ( b - > buffer , b - > storage ) ; <nl> + if ( ! ret ) goto err ; <nl> + b - > buffer = ret ; <nl> + b - > ptr = b - > buffer + b - > endbyte ; <nl> + } <nl> + <nl> + / * copy whole octets * / <nl> if ( b - > endbit ) { <nl> int i ; <nl> / * unaligned copy . Do it the hard way . * / <nl> for ( i = 0 ; i < bytes ; i + + ) <nl> - w ( b , ( unsigned long ) ( ptr [ i ] ) , 8 ) ; <nl> + w ( b , ( unsigned long ) ( ptr [ i ] ) , 8 ) ; <nl> } else { <nl> / * aligned block copy * / <nl> - if ( b - > endbyte + bytes + 1 > = b - > storage ) { <nl> - void * ret ; <nl> - if ( ! b - > ptr ) goto err ; <nl> - if ( b - > endbyte + bytes + BUFFER_INCREMENT > b - > storage ) goto err ; <nl> - b - > storage = b - > endbyte + bytes + BUFFER_INCREMENT ; <nl> - ret = _ogg_realloc ( b - > buffer , b - > storage ) ; <nl> - if ( ! ret ) goto err ; <nl> - b - > buffer = ret ; <nl> - b - > ptr = b - > buffer + b - > endbyte ; <nl> - } <nl> - <nl> memmove ( b - > ptr , source , bytes ) ; <nl> b - > ptr + = bytes ; <nl> b - > endbyte + = bytes ; <nl> * b - > ptr = 0 ; <nl> - <nl> } <nl> + <nl> + / * copy trailing bits * / <nl> if ( bits ) { <nl> if ( msb ) <nl> - w ( b , ( unsigned long ) ( ptr [ bytes ] > > ( 8 - bits ) ) , bits ) ; <nl> + w ( b , ( unsigned long ) ( ptr [ bytes ] > > ( 8 - bits ) ) , bits ) ; <nl> else <nl> - w ( b , ( unsigned long ) ( ptr [ bytes ] ) , bits ) ; <nl> + w ( b , ( unsigned long ) ( ptr [ bytes ] ) , bits ) ; <nl> } <nl> return ; <nl> err : <nl> long oggpack_look ( oggpack_buffer * b , int bits ) { <nl> <nl> ret = b - > ptr [ 0 ] > > b - > endbit ; <nl> if ( bits > 8 ) { <nl> - ret | = b - > ptr [ 1 ] < < ( 8 - b - > endbit ) ; <nl> + ret | = b - > ptr [ 1 ] < < ( 8 - b - > endbit ) ; <nl> if ( bits > 16 ) { <nl> - ret | = b - > ptr [ 2 ] < < ( 16 - b - > endbit ) ; <nl> + ret | = b - > ptr [ 2 ] < < ( 16 - b - > endbit ) ; <nl> if ( bits > 24 ) { <nl> - ret | = b - > ptr [ 3 ] < < ( 24 - b - > endbit ) ; <nl> + ret | = b - > ptr [ 3 ] < < ( 24 - b - > endbit ) ; <nl> if ( bits > 32 & & b - > endbit ) <nl> ret | = b - > ptr [ 4 ] < < ( 32 - b - > endbit ) ; <nl> } <nl> long oggpackB_look ( oggpack_buffer * b , int bits ) { <nl> <nl> ret = b - > ptr [ 0 ] < < ( 24 + b - > endbit ) ; <nl> if ( bits > 8 ) { <nl> - ret | = b - > ptr [ 1 ] < < ( 16 + b - > endbit ) ; <nl> + ret | = b - > ptr [ 1 ] < < ( 16 + b - > endbit ) ; <nl> if ( bits > 16 ) { <nl> - ret | = b - > ptr [ 2 ] < < ( 8 + b - > endbit ) ; <nl> + ret | = b - > ptr [ 2 ] < < ( 8 + b - > endbit ) ; <nl> if ( bits > 24 ) { <nl> - ret | = b - > ptr [ 3 ] < < ( b - > endbit ) ; <nl> + ret | = b - > ptr [ 3 ] < < ( b - > endbit ) ; <nl> if ( bits > 32 & & b - > endbit ) <nl> ret | = b - > ptr [ 4 ] > > ( 8 - b - > endbit ) ; <nl> } <nl> long oggpack_read ( oggpack_buffer * b , int bits ) { <nl> <nl> ret = b - > ptr [ 0 ] > > b - > endbit ; <nl> if ( bits > 8 ) { <nl> - ret | = b - > ptr [ 1 ] < < ( 8 - b - > endbit ) ; <nl> + ret | = b - > ptr [ 1 ] < < ( 8 - b - > endbit ) ; <nl> if ( bits > 16 ) { <nl> - ret | = b - > ptr [ 2 ] < < ( 16 - b - > endbit ) ; <nl> + ret | = b - > ptr [ 2 ] < < ( 16 - b - > endbit ) ; <nl> if ( bits > 24 ) { <nl> - ret | = b - > ptr [ 3 ] < < ( 24 - b - > endbit ) ; <nl> + ret | = b - > ptr [ 3 ] < < ( 24 - b - > endbit ) ; <nl> if ( bits > 32 & & b - > endbit ) { <nl> ret | = b - > ptr [ 4 ] < < ( 32 - b - > endbit ) ; <nl> } <nl> long oggpackB_read ( oggpack_buffer * b , int bits ) { <nl> <nl> ret = b - > ptr [ 0 ] < < ( 24 + b - > endbit ) ; <nl> if ( bits > 8 ) { <nl> - ret | = b - > ptr [ 1 ] < < ( 16 + b - > endbit ) ; <nl> + ret | = b - > ptr [ 1 ] < < ( 16 + b - > endbit ) ; <nl> if ( bits > 16 ) { <nl> - ret | = b - > ptr [ 2 ] < < ( 8 + b - > endbit ) ; <nl> + ret | = b - > ptr [ 2 ] < < ( 8 + b - > endbit ) ; <nl> if ( bits > 24 ) { <nl> - ret | = b - > ptr [ 3 ] < < ( b - > endbit ) ; <nl> + ret | = b - > ptr [ 3 ] < < ( b - > endbit ) ; <nl> if ( bits > 32 & & b - > endbit ) <nl> ret | = b - > ptr [ 4 ] > > ( 8 - b - > endbit ) ; <nl> } <nl> long oggpackB_bytes ( oggpack_buffer * b ) { <nl> long oggpackB_bits ( oggpack_buffer * b ) { <nl> return oggpack_bits ( b ) ; <nl> } <nl> - <nl> + <nl> unsigned char * oggpack_get_buffer ( oggpack_buffer * b ) { <nl> return ( b - > buffer ) ; <nl> } <nl> static int ilog ( unsigned int v ) { <nl> } <nl> return ( ret ) ; <nl> } <nl> - <nl> + <nl> oggpack_buffer o ; <nl> oggpack_buffer r ; <nl> <nl> void cliptest ( unsigned long * b , int vals , int bits , int * comp , int compsize ) { <nl> void cliptestB ( unsigned long * b , int vals , int bits , int * comp , int compsize ) { <nl> long bytes , i ; <nl> unsigned char * buffer ; <nl> - <nl> + <nl> oggpackB_reset ( & o ) ; <nl> for ( i = 0 ; i < vals ; i + + ) <nl> oggpackB_write ( & o , b [ i ] , bits ? bits : ilog ( b [ i ] ) ) ; <nl> void cliptestB ( unsigned long * b , int vals , int bits , int * comp , int compsize ) { <nl> if ( oggpackB_bytes ( & r ) ! = bytes ) report ( " leftover bytes after read ! \ n " ) ; <nl> } <nl> <nl> + void copytest ( int prefill , int copy ) { <nl> + oggpack_buffer source_write ; <nl> + oggpack_buffer dest_write ; <nl> + oggpack_buffer source_read ; <nl> + oggpack_buffer dest_read ; <nl> + unsigned char * source ; <nl> + unsigned char * dest ; <nl> + long source_bytes , dest_bytes ; <nl> + int i ; <nl> + <nl> + oggpack_writeinit ( & source_write ) ; <nl> + oggpack_writeinit ( & dest_write ) ; <nl> + <nl> + for ( i = 0 ; i < ( prefill + copy + 7 ) / 8 ; i + + ) <nl> + oggpack_write ( & source_write , ( i ^ 0x5a ) & 0xff , 8 ) ; <nl> + source = oggpack_get_buffer ( & source_write ) ; <nl> + source_bytes = oggpack_bytes ( & source_write ) ; <nl> + <nl> + / * prefill * / <nl> + oggpack_writecopy ( & dest_write , source , prefill ) ; <nl> + <nl> + / * check buffers ; verify end byte masking * / <nl> + dest = oggpack_get_buffer ( & dest_write ) ; <nl> + dest_bytes = oggpack_bytes ( & dest_write ) ; <nl> + if ( dest_bytes ! = ( prefill + 7 ) / 8 ) { <nl> + fprintf ( stderr , " wrong number of bytes after prefill ! % ld ! = % d \ n " , dest_bytes , ( prefill + 7 ) / 8 ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + oggpack_readinit ( & source_read , source , source_bytes ) ; <nl> + oggpack_readinit ( & dest_read , dest , dest_bytes ) ; <nl> + <nl> + for ( i = 0 ; i < prefill ; i + = 8 ) { <nl> + int s = oggpack_read ( & source_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + int d = oggpack_read ( & dest_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + if ( s ! = d ) { <nl> + fprintf ( stderr , " prefill = % d mismatch ! byte % d , % x ! = % x \ n " , prefill , i / 8 , s , d ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + if ( prefill < dest_bytes ) { <nl> + if ( oggpack_read ( & dest_read , dest_bytes - prefill ) ! = 0 ) { <nl> + fprintf ( stderr , " prefill = % d mismatch ! trailing bits not zero \ n " , prefill ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + / * second copy * / <nl> + oggpack_writecopy ( & dest_write , source , copy ) ; <nl> + <nl> + / * check buffers ; verify end byte masking * / <nl> + dest = oggpack_get_buffer ( & dest_write ) ; <nl> + dest_bytes = oggpack_bytes ( & dest_write ) ; <nl> + if ( dest_bytes ! = ( copy + prefill + 7 ) / 8 ) { <nl> + fprintf ( stderr , " wrong number of bytes after prefill + copy ! % ld ! = % d \ n " , dest_bytes , ( copy + prefill + 7 ) / 8 ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + oggpack_readinit ( & source_read , source , source_bytes ) ; <nl> + oggpack_readinit ( & dest_read , dest , dest_bytes ) ; <nl> + <nl> + for ( i = 0 ; i < prefill ; i + = 8 ) { <nl> + int s = oggpack_read ( & source_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + int d = oggpack_read ( & dest_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + if ( s ! = d ) { <nl> + fprintf ( stderr , " prefill = % d mismatch ! byte % d , % x ! = % x \ n " , prefill , i / 8 , s , d ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + oggpack_readinit ( & source_read , source , source_bytes ) ; <nl> + for ( i = 0 ; i < copy ; i + = 8 ) { <nl> + int s = oggpack_read ( & source_read , copy - i < 8 ? copy - i : 8 ) ; <nl> + int d = oggpack_read ( & dest_read , copy - i < 8 ? copy - i : 8 ) ; <nl> + if ( s ! = d ) { <nl> + fprintf ( stderr , " prefill = % d copy = % d mismatch ! byte % d , % x ! = % x \ n " , prefill , copy , i / 8 , s , d ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + if ( copy + prefill < dest_bytes ) { <nl> + if ( oggpack_read ( & dest_read , dest_bytes - copy - prefill ) ! = 0 ) { <nl> + fprintf ( stderr , " prefill = % d copy = % d mismatch ! trailing bits not zero \ n " , prefill , copy ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + oggpack_writeclear ( & source_write ) ; <nl> + oggpack_writeclear ( & dest_write ) ; <nl> + <nl> + <nl> + } <nl> + <nl> + void copytestB ( int prefill , int copy ) { <nl> + oggpack_buffer source_write ; <nl> + oggpack_buffer dest_write ; <nl> + oggpack_buffer source_read ; <nl> + oggpack_buffer dest_read ; <nl> + unsigned char * source ; <nl> + unsigned char * dest ; <nl> + long source_bytes , dest_bytes ; <nl> + int i ; <nl> + <nl> + oggpackB_writeinit ( & source_write ) ; <nl> + oggpackB_writeinit ( & dest_write ) ; <nl> + <nl> + for ( i = 0 ; i < ( prefill + copy + 7 ) / 8 ; i + + ) <nl> + oggpackB_write ( & source_write , ( i ^ 0x5a ) & 0xff , 8 ) ; <nl> + source = oggpackB_get_buffer ( & source_write ) ; <nl> + source_bytes = oggpackB_bytes ( & source_write ) ; <nl> + <nl> + / * prefill * / <nl> + oggpackB_writecopy ( & dest_write , source , prefill ) ; <nl> + <nl> + / * check buffers ; verify end byte masking * / <nl> + dest = oggpackB_get_buffer ( & dest_write ) ; <nl> + dest_bytes = oggpackB_bytes ( & dest_write ) ; <nl> + if ( dest_bytes ! = ( prefill + 7 ) / 8 ) { <nl> + fprintf ( stderr , " wrong number of bytes after prefill ! % ld ! = % d \ n " , dest_bytes , ( prefill + 7 ) / 8 ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + oggpackB_readinit ( & source_read , source , source_bytes ) ; <nl> + oggpackB_readinit ( & dest_read , dest , dest_bytes ) ; <nl> + <nl> + for ( i = 0 ; i < prefill ; i + = 8 ) { <nl> + int s = oggpackB_read ( & source_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + int d = oggpackB_read ( & dest_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + if ( s ! = d ) { <nl> + fprintf ( stderr , " prefill = % d mismatch ! byte % d , % x ! = % x \ n " , prefill , i / 8 , s , d ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + if ( prefill < dest_bytes ) { <nl> + if ( oggpackB_read ( & dest_read , dest_bytes - prefill ) ! = 0 ) { <nl> + fprintf ( stderr , " prefill = % d mismatch ! trailing bits not zero \ n " , prefill ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + / * second copy * / <nl> + oggpackB_writecopy ( & dest_write , source , copy ) ; <nl> + <nl> + / * check buffers ; verify end byte masking * / <nl> + dest = oggpackB_get_buffer ( & dest_write ) ; <nl> + dest_bytes = oggpackB_bytes ( & dest_write ) ; <nl> + if ( dest_bytes ! = ( copy + prefill + 7 ) / 8 ) { <nl> + fprintf ( stderr , " wrong number of bytes after prefill + copy ! % ld ! = % d \ n " , dest_bytes , ( copy + prefill + 7 ) / 8 ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + oggpackB_readinit ( & source_read , source , source_bytes ) ; <nl> + oggpackB_readinit ( & dest_read , dest , dest_bytes ) ; <nl> + <nl> + for ( i = 0 ; i < prefill ; i + = 8 ) { <nl> + int s = oggpackB_read ( & source_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + int d = oggpackB_read ( & dest_read , prefill - i < 8 ? prefill - i : 8 ) ; <nl> + if ( s ! = d ) { <nl> + fprintf ( stderr , " prefill = % d mismatch ! byte % d , % x ! = % x \ n " , prefill , i / 8 , s , d ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + oggpackB_readinit ( & source_read , source , source_bytes ) ; <nl> + for ( i = 0 ; i < copy ; i + = 8 ) { <nl> + int s = oggpackB_read ( & source_read , copy - i < 8 ? copy - i : 8 ) ; <nl> + int d = oggpackB_read ( & dest_read , copy - i < 8 ? copy - i : 8 ) ; <nl> + if ( s ! = d ) { <nl> + fprintf ( stderr , " prefill = % d copy = % d mismatch ! byte % d , % x ! = % x \ n " , prefill , copy , i / 8 , s , d ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + if ( copy + prefill < dest_bytes ) { <nl> + if ( oggpackB_read ( & dest_read , dest_bytes - copy - prefill ) ! = 0 ) { <nl> + fprintf ( stderr , " prefill = % d copy = % d mismatch ! trailing bits not zero \ n " , prefill , copy ) ; <nl> + exit ( 1 ) ; <nl> + } <nl> + } <nl> + <nl> + oggpackB_writeclear ( & source_write ) ; <nl> + oggpackB_writeclear ( & dest_write ) ; <nl> + <nl> + } <nl> + <nl> int main ( void ) { <nl> unsigned char * buffer ; <nl> - long bytes , i ; <nl> + long bytes , i , j ; <nl> static unsigned long testbuffer1 [ ] = <nl> { 18 , 12 , 103948 , 4325 , 543 , 76 , 432 , 52 , 3 , 65 , 4 , 56 , 32 , 42 , 34 , 21 , 1 , 23 , 32 , 546 , 456 , 7 , <nl> 567 , 56 , 8 , 8 , 55 , 3 , 52 , 342 , 341 , 4 , 265 , 7 , 67 , 86 , 2199 , 21 , 7 , 1 , 5 , 1 , 4 } ; <nl> int main ( void ) { <nl> exit ( 1 ) ; <nl> } <nl> oggpack_writeclear ( & o ) ; <nl> - fprintf ( stderr , " ok . \ n " ) ; <nl> + fprintf ( stderr , " ok . " ) ; <nl> + <nl> + / * this is partly glassbox ; we ' re mostly concerned about the allocation boundaries * / <nl> + <nl> + fprintf ( stderr , " \ nTesting aligned writecopies ( LSb ) : " ) ; <nl> + for ( i = 0 ; i < 71 ; i + + ) <nl> + for ( j = 0 ; j < 5 ; j + + ) <nl> + copytest ( j * 8 , i ) ; <nl> + for ( i = BUFFER_INCREMENT * 8 - 71 ; i < BUFFER_INCREMENT * 8 + 71 ; i + + ) <nl> + for ( j = 0 ; j < 5 ; j + + ) <nl> + copytest ( j * 8 , i ) ; <nl> + fprintf ( stderr , " ok . " ) ; <nl> + <nl> + fprintf ( stderr , " \ nTesting unaligned writecopies ( LSb ) : " ) ; <nl> + for ( i = 0 ; i < 71 ; i + + ) <nl> + for ( j = 1 ; j < 40 ; j + + ) <nl> + if ( j & 0x7 ) <nl> + copytest ( j , i ) ; <nl> + for ( i = BUFFER_INCREMENT * 8 - 71 ; i < BUFFER_INCREMENT * 8 + 71 ; i + + ) <nl> + for ( j = 1 ; j < 40 ; j + + ) <nl> + if ( j & 0x7 ) <nl> + copytest ( j , i ) ; <nl> + <nl> + fprintf ( stderr , " ok . \ n " ) ; <nl> + <nl> <nl> / * * * * * * * * * * lazy , cut - n - paste retest with MSb packing * * * * * * * * * * * / <nl> <nl> int main ( void ) { <nl> fprintf ( stderr , " failed ; read past end without - 1 . \ n " ) ; <nl> exit ( 1 ) ; <nl> } <nl> + fprintf ( stderr , " ok . " ) ; <nl> oggpackB_writeclear ( & o ) ; <nl> - fprintf ( stderr , " ok . \ n \ n " ) ; <nl> <nl> + / * this is partly glassbox ; we ' re mostly concerned about the allocation boundaries * / <nl> + <nl> + fprintf ( stderr , " \ nTesting aligned writecopies ( MSb ) : " ) ; <nl> + for ( i = 0 ; i < 71 ; i + + ) <nl> + for ( j = 0 ; j < 5 ; j + + ) <nl> + copytestB ( j * 8 , i ) ; <nl> + for ( i = BUFFER_INCREMENT * 8 - 71 ; i < BUFFER_INCREMENT * 8 + 71 ; i + + ) <nl> + for ( j = 0 ; j < 5 ; j + + ) <nl> + copytestB ( j * 8 , i ) ; <nl> + fprintf ( stderr , " ok . " ) ; <nl> + <nl> + fprintf ( stderr , " \ nTesting unaligned writecopies ( MSb ) : " ) ; <nl> + for ( i = 0 ; i < 71 ; i + + ) <nl> + for ( j = 1 ; j < 40 ; j + + ) <nl> + if ( j & 0x7 ) <nl> + copytestB ( j , i ) ; <nl> + for ( i = BUFFER_INCREMENT * 8 - 71 ; i < BUFFER_INCREMENT * 8 + 71 ; i + + ) <nl> + for ( j = 1 ; j < 40 ; j + + ) <nl> + if ( j & 0x7 ) <nl> + copytestB ( j , i ) ; <nl> + <nl> + fprintf ( stderr , " ok . \ n \ n " ) ; <nl> <nl> return ( 0 ) ; <nl> - } <nl> + } <nl> # endif / * _V_SELFTEST * / <nl> <nl> # undef BUFFER_INCREMENT <nl> mmm a / drivers / ogg / framing . c <nl> ppp b / drivers / ogg / framing . c <nl> <nl> <nl> function : code raw packets into framed OggSquish stream and <nl> decode Ogg streams back into raw packets <nl> - last mod : $ Id : framing . c 17592 2010 - 11 - 01 20 : 27 : 54Z xiphmont $ <nl> + last mod : $ Id : framing . c 18758 2013 - 01 - 08 16 : 29 : 56Z tterribe $ <nl> <nl> note : The CRC code is directly derived from public domain code by <nl> Ross Williams ( ross @ guest . adelaide . edu . au ) . See docs / framing . html <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> # include < stdlib . h > <nl> + # include < limits . h > <nl> # include < string . h > <nl> # include < ogg / ogg . h > <nl> <nl> int ogg_page_serialno ( const ogg_page * og ) { <nl> ( og - > header [ 16 ] < < 16 ) | <nl> ( og - > header [ 17 ] < < 24 ) ) ; <nl> } <nl> - <nl> + <nl> long ogg_page_pageno ( const ogg_page * og ) { <nl> return ( og - > header [ 18 ] | <nl> ( og - > header [ 19 ] < < 8 ) | <nl> long ogg_page_pageno ( const ogg_page * og ) { <nl> page , it ' s counted * / <nl> <nl> / * NOTE : <nl> - If a page consists of a packet begun on a previous page , and a new <nl> - packet begun ( but not completed ) on this page , the return will be : <nl> - ogg_page_packets ( page ) = = 1 , <nl> - ogg_page_continued ( page ) ! = 0 <nl> - <nl> - If a page happens to be a single packet that was begun on a <nl> - previous page , and spans to the next page ( in the case of a three or <nl> - more page packet ) , the return will be : <nl> - ogg_page_packets ( page ) = = 0 , <nl> - ogg_page_continued ( page ) ! = 0 <nl> + If a page consists of a packet begun on a previous page , and a new <nl> + packet begun ( but not completed ) on this page , the return will be : <nl> + ogg_page_packets ( page ) = = 1 , <nl> + ogg_page_continued ( page ) ! = 0 <nl> + <nl> + If a page happens to be a single packet that was begun on a <nl> + previous page , and spans to the next page ( in the case of a three or <nl> + more page packet ) , the return will be : <nl> + ogg_page_packets ( page ) = = 0 , <nl> + ogg_page_continued ( page ) ! = 0 <nl> * / <nl> <nl> int ogg_page_packets ( const ogg_page * og ) { <nl> int ogg_stream_init ( ogg_stream_state * os , int serialno ) { <nl> return ( 0 ) ; <nl> } <nl> return ( - 1 ) ; <nl> - } <nl> + } <nl> <nl> / * async / delayed error detection for the ogg_stream_state * / <nl> int ogg_stream_check ( ogg_stream_state * os ) { <nl> int ogg_stream_clear ( ogg_stream_state * os ) { <nl> if ( os - > lacing_vals ) _ogg_free ( os - > lacing_vals ) ; <nl> if ( os - > granule_vals ) _ogg_free ( os - > granule_vals ) ; <nl> <nl> - memset ( os , 0 , sizeof ( * os ) ) ; <nl> + memset ( os , 0 , sizeof ( * os ) ) ; <nl> } <nl> return ( 0 ) ; <nl> - } <nl> + } <nl> <nl> int ogg_stream_destroy ( ogg_stream_state * os ) { <nl> if ( os ) { <nl> int ogg_stream_destroy ( ogg_stream_state * os ) { <nl> _ogg_free ( os ) ; <nl> } <nl> return ( 0 ) ; <nl> - } <nl> + } <nl> <nl> / * Helpers for ogg_stream_encode ; this keeps the structure and <nl> what ' s happening fairly clear * / <nl> <nl> - static int _os_body_expand ( ogg_stream_state * os , int needed ) { <nl> - if ( os - > body_storage < = os - > body_fill + needed ) { <nl> + static int _os_body_expand ( ogg_stream_state * os , long needed ) { <nl> + if ( os - > body_storage - needed < = os - > body_fill ) { <nl> + long body_storage ; <nl> void * ret ; <nl> - ret = _ogg_realloc ( os - > body_data , ( os - > body_storage + needed + 1024 ) * <nl> - sizeof ( * os - > body_data ) ) ; <nl> + if ( os - > body_storage > LONG_MAX - needed ) { <nl> + ogg_stream_clear ( os ) ; <nl> + return - 1 ; <nl> + } <nl> + body_storage = os - > body_storage + needed ; <nl> + if ( body_storage < LONG_MAX - 1024 ) body_storage + = 1024 ; <nl> + ret = _ogg_realloc ( os - > body_data , body_storage * sizeof ( * os - > body_data ) ) ; <nl> if ( ! ret ) { <nl> ogg_stream_clear ( os ) ; <nl> return - 1 ; <nl> } <nl> - os - > body_storage + = ( needed + 1024 ) ; <nl> + os - > body_storage = body_storage ; <nl> os - > body_data = ret ; <nl> } <nl> return 0 ; <nl> } <nl> <nl> - static int _os_lacing_expand ( ogg_stream_state * os , int needed ) { <nl> - if ( os - > lacing_storage < = os - > lacing_fill + needed ) { <nl> + static int _os_lacing_expand ( ogg_stream_state * os , long needed ) { <nl> + if ( os - > lacing_storage - needed < = os - > lacing_fill ) { <nl> + long lacing_storage ; <nl> void * ret ; <nl> - ret = _ogg_realloc ( os - > lacing_vals , ( os - > lacing_storage + needed + 32 ) * <nl> - sizeof ( * os - > lacing_vals ) ) ; <nl> + if ( os - > lacing_storage > LONG_MAX - needed ) { <nl> + ogg_stream_clear ( os ) ; <nl> + return - 1 ; <nl> + } <nl> + lacing_storage = os - > lacing_storage + needed ; <nl> + if ( lacing_storage < LONG_MAX - 32 ) lacing_storage + = 32 ; <nl> + ret = _ogg_realloc ( os - > lacing_vals , lacing_storage * sizeof ( * os - > lacing_vals ) ) ; <nl> if ( ! ret ) { <nl> ogg_stream_clear ( os ) ; <nl> return - 1 ; <nl> } <nl> os - > lacing_vals = ret ; <nl> - ret = _ogg_realloc ( os - > granule_vals , ( os - > lacing_storage + needed + 32 ) * <nl> + ret = _ogg_realloc ( os - > granule_vals , lacing_storage * <nl> sizeof ( * os - > granule_vals ) ) ; <nl> if ( ! ret ) { <nl> ogg_stream_clear ( os ) ; <nl> return - 1 ; <nl> } <nl> os - > granule_vals = ret ; <nl> - os - > lacing_storage + = ( needed + 32 ) ; <nl> + os - > lacing_storage = lacing_storage ; <nl> } <nl> return 0 ; <nl> } <nl> void ogg_page_checksum_set ( ogg_page * og ) { <nl> og - > header [ 23 ] = 0 ; <nl> og - > header [ 24 ] = 0 ; <nl> og - > header [ 25 ] = 0 ; <nl> - <nl> + <nl> for ( i = 0 ; i < og - > header_len ; i + + ) <nl> crc_reg = ( crc_reg < < 8 ) ^ crc_lookup [ ( ( crc_reg > > 24 ) & 0xff ) ^ og - > header [ i ] ] ; <nl> for ( i = 0 ; i < og - > body_len ; i + + ) <nl> crc_reg = ( crc_reg < < 8 ) ^ crc_lookup [ ( ( crc_reg > > 24 ) & 0xff ) ^ og - > body [ i ] ] ; <nl> - <nl> + <nl> og - > header [ 22 ] = ( unsigned char ) ( crc_reg & 0xff ) ; <nl> og - > header [ 23 ] = ( unsigned char ) ( ( crc_reg > > 8 ) & 0xff ) ; <nl> og - > header [ 24 ] = ( unsigned char ) ( ( crc_reg > > 16 ) & 0xff ) ; <nl> void ogg_page_checksum_set ( ogg_page * og ) { <nl> int ogg_stream_iovecin ( ogg_stream_state * os , ogg_iovec_t * iov , int count , <nl> long e_o_s , ogg_int64_t granulepos ) { <nl> <nl> - int bytes = 0 , lacing_vals , i ; <nl> + long bytes = 0 , lacing_vals ; <nl> + int i ; <nl> <nl> if ( ogg_stream_check ( os ) ) return - 1 ; <nl> if ( ! iov ) return 0 ; <nl> - <nl> - for ( i = 0 ; i < count ; + + i ) bytes + = ( int ) iov [ i ] . iov_len ; <nl> + <nl> + for ( i = 0 ; i < count ; + + i ) { <nl> + if ( iov [ i ] . iov_len > LONG_MAX ) return - 1 ; <nl> + if ( bytes > LONG_MAX - ( long ) iov [ i ] . iov_len ) return - 1 ; <nl> + bytes + = ( long ) iov [ i ] . iov_len ; <nl> + } <nl> lacing_vals = bytes / 255 + 1 ; <nl> <nl> if ( os - > body_returned ) { <nl> / * advance packet data according to the body_returned pointer . We <nl> had to keep it around to return a pointer into the buffer last <nl> call * / <nl> - <nl> + <nl> os - > body_fill - = os - > body_returned ; <nl> if ( os - > body_fill ) <nl> memmove ( os - > body_data , os - > body_data + os - > body_returned , <nl> os - > body_fill ) ; <nl> os - > body_returned = 0 ; <nl> } <nl> - <nl> + <nl> / * make sure we have the buffer storage * / <nl> if ( _os_body_expand ( os , bytes ) | | _os_lacing_expand ( os , lacing_vals ) ) <nl> return - 1 ; <nl> static int ogg_stream_flush_i ( ogg_stream_state * os , ogg_page * og , int force , int <nl> pageno > > = 8 ; <nl> } <nl> } <nl> - <nl> + <nl> / * zero for computation ; filled in later * / <nl> os - > header [ 22 ] = 0 ; <nl> os - > header [ 23 ] = 0 ; <nl> os - > header [ 24 ] = 0 ; <nl> os - > header [ 25 ] = 0 ; <nl> - <nl> + <nl> / * segment table * / <nl> os - > header [ 26 ] = ( unsigned char ) ( vals & 0xff ) ; <nl> for ( i = 0 ; i < vals ; i + + ) <nl> bytes + = os - > header [ i + 27 ] = ( unsigned char ) ( os - > lacing_vals [ i ] & 0xff ) ; <nl> - <nl> + <nl> / * set pointers in the ogg_page struct * / <nl> og - > header = os - > header ; <nl> og - > header_len = os - > header_fill = vals + 27 ; <nl> og - > body = os - > body_data + os - > body_returned ; <nl> og - > body_len = bytes ; <nl> - <nl> + <nl> / * advance the lacing data and set the body_returned pointer * / <nl> - <nl> + <nl> os - > lacing_fill - = vals ; <nl> memmove ( os - > lacing_vals , os - > lacing_vals + vals , os - > lacing_fill * sizeof ( * os - > lacing_vals ) ) ; <nl> memmove ( os - > granule_vals , os - > granule_vals + vals , os - > lacing_fill * sizeof ( * os - > granule_vals ) ) ; <nl> os - > body_returned + = bytes ; <nl> - <nl> + <nl> / * calculate the checksum * / <nl> - <nl> + <nl> ogg_page_checksum_set ( og ) ; <nl> <nl> / * done * / <nl> static int ogg_stream_flush_i ( ogg_stream_state * os , ogg_page * og , int force , int <nl> since ogg_stream_flush will flush the last page in a stream even if <nl> it ' s undersized , you almost certainly want to use ogg_stream_pageout <nl> ( and * not * ogg_stream_flush ) unless you specifically need to flush <nl> - an page regardless of size in the middle of a stream . * / <nl> + a page regardless of size in the middle of a stream . * / <nl> <nl> int ogg_stream_flush ( ogg_stream_state * os , ogg_page * og ) { <nl> return ogg_stream_flush_i ( os , og , 1 , 4096 ) ; <nl> } <nl> <nl> + / * Like the above , but an argument is provided to adjust the nominal <nl> + page size for applications which are smart enough to provide their <nl> + own delay based flushing * / <nl> + <nl> + int ogg_stream_flush_fill ( ogg_stream_state * os , ogg_page * og , int nfill ) { <nl> + return ogg_stream_flush_i ( os , og , 1 , nfill ) ; <nl> + } <nl> + <nl> / * This constructs pages from buffered packet segments . The pointers <nl> returned are to static buffers ; do not free . The returned buffers are <nl> good only until the next call ( using the same ogg_stream_state ) * / <nl> int ogg_stream_pageout ( ogg_stream_state * os , ogg_page * og ) { <nl> return ( ogg_stream_flush_i ( os , og , force , 4096 ) ) ; <nl> } <nl> <nl> - / * Like the above , but an argument is provided to adjust the nominal <nl> + / * Like the above , but an argument is provided to adjust the nominal <nl> page size for applications which are smart enough to provide their <nl> own delay based flushing * / <nl> - <nl> + <nl> int ogg_stream_pageout_fill ( ogg_stream_state * os , ogg_page * og , int nfill ) { <nl> int force = 0 ; <nl> if ( ogg_stream_check ( os ) ) return 0 ; <nl> int ogg_sync_wrote ( ogg_sync_state * oy , long bytes ) { <nl> - n ) skipped n bytes <nl> 0 ) page not ready ; more data ( no bytes skipped ) <nl> n ) page synced at current location ; page length n bytes <nl> - <nl> + <nl> * / <nl> <nl> long ogg_sync_pageseek ( ogg_sync_state * oy , ogg_page * og ) { <nl> long ogg_sync_pageseek ( ogg_sync_state * oy , ogg_page * og ) { <nl> long bytes = oy - > fill - oy - > returned ; <nl> <nl> if ( ogg_sync_check ( oy ) ) return 0 ; <nl> - <nl> + <nl> if ( oy - > headerbytes = = 0 ) { <nl> int headerbytes , i ; <nl> if ( bytes < 27 ) return ( 0 ) ; / * not enough for a header * / <nl> - <nl> + <nl> / * verify capture pattern * / <nl> if ( memcmp ( page , " OggS " , 4 ) ) goto sync_fail ; <nl> - <nl> + <nl> headerbytes = page [ 26 ] + 27 ; <nl> if ( bytes < headerbytes ) return ( 0 ) ; / * not enough for header + seg table * / <nl> - <nl> + <nl> / * count up body length in the segment table * / <nl> - <nl> + <nl> for ( i = 0 ; i < page [ 26 ] ; i + + ) <nl> oy - > bodybytes + = page [ 27 + i ] ; <nl> oy - > headerbytes = headerbytes ; <nl> } <nl> - <nl> + <nl> if ( oy - > bodybytes + oy - > headerbytes > bytes ) return ( 0 ) ; <nl> - <nl> + <nl> / * The whole test page is buffered . Verify the checksum * / <nl> { <nl> / * Grab the checksum bytes , set the header field to zero * / <nl> char chksum [ 4 ] ; <nl> ogg_page log ; <nl> - <nl> + <nl> memcpy ( chksum , page + 22 , 4 ) ; <nl> memset ( page + 22 , 0 , 4 ) ; <nl> - <nl> + <nl> / * set up a temp page struct and recompute the checksum * / <nl> log . header = page ; <nl> log . header_len = oy - > headerbytes ; <nl> log . body = page + oy - > headerbytes ; <nl> log . body_len = oy - > bodybytes ; <nl> ogg_page_checksum_set ( & log ) ; <nl> - <nl> + <nl> / * Compare * / <nl> if ( memcmp ( chksum , page + 22 , 4 ) ) { <nl> / * D ' oh . Mismatch ! Corrupt page ( or miscapture and not a page <nl> at all ) * / <nl> / * replace the computed checksum with the one actually read in * / <nl> memcpy ( page + 22 , chksum , 4 ) ; <nl> - <nl> + <nl> / * Bad checksum . Lose sync * / <nl> goto sync_fail ; <nl> } <nl> } <nl> - <nl> + <nl> / * yes , have a whole page all ready to go * / <nl> { <nl> unsigned char * page = oy - > data + oy - > returned ; <nl> long ogg_sync_pageseek ( ogg_sync_state * oy , ogg_page * og ) { <nl> oy - > bodybytes = 0 ; <nl> return ( bytes ) ; <nl> } <nl> - <nl> + <nl> sync_fail : <nl> - <nl> + <nl> oy - > headerbytes = 0 ; <nl> oy - > bodybytes = 0 ; <nl> - <nl> + <nl> / * search for possible capture * / <nl> next = memchr ( page + 1 , ' O ' , bytes - 1 ) ; <nl> if ( ! next ) <nl> int ogg_sync_pageout ( ogg_sync_state * oy , ogg_page * og ) { <nl> / * need more data * / <nl> return ( 0 ) ; <nl> } <nl> - <nl> + <nl> / * head did not start a synced page . . . skipped some bytes * / <nl> if ( ! oy - > unsynced ) { <nl> oy - > unsynced = 1 ; <nl> int ogg_stream_pagein ( ogg_stream_state * os , ogg_page * og ) { <nl> int serialno = ogg_page_serialno ( og ) ; <nl> long pageno = ogg_page_pageno ( og ) ; <nl> int segments = header [ 26 ] ; <nl> - <nl> + <nl> if ( ogg_stream_check ( os ) ) return - 1 ; <nl> <nl> / * clean up ' returned data ' * / <nl> int ogg_stream_pagein ( ogg_stream_state * os , ogg_page * og ) { <nl> / * are we a ' continued packet ' page ? If so , we may need to skip <nl> some segments * / <nl> if ( continued ) { <nl> - if ( os - > lacing_fill < 1 | | <nl> + if ( os - > lacing_fill < 1 | | <nl> os - > lacing_vals [ os - > lacing_fill - 1 ] = = 0x400 ) { <nl> bos = 0 ; <nl> for ( ; segptr < segments ; segptr + + ) { <nl> int ogg_stream_pagein ( ogg_stream_state * os , ogg_page * og ) { <nl> } <nl> } <nl> } <nl> - <nl> + <nl> if ( bodysize ) { <nl> if ( _os_body_expand ( os , bodysize ) ) return - 1 ; <nl> memcpy ( os - > body_data + os - > body_fill , body , bodysize ) ; <nl> int ogg_stream_pagein ( ogg_stream_state * os , ogg_page * og ) { <nl> int val = header [ 27 + segptr ] ; <nl> os - > lacing_vals [ os - > lacing_fill ] = val ; <nl> os - > granule_vals [ os - > lacing_fill ] = - 1 ; <nl> - <nl> + <nl> if ( bos ) { <nl> os - > lacing_vals [ os - > lacing_fill ] | = 0x100 ; <nl> bos = 0 ; <nl> } <nl> - <nl> + <nl> if ( val < 255 ) saved = os - > lacing_fill ; <nl> - <nl> + <nl> os - > lacing_fill + + ; <nl> segptr + + ; <nl> - <nl> + <nl> if ( val < 255 ) os - > lacing_packet = os - > lacing_fill ; <nl> } <nl> - <nl> + <nl> / * set the granulepos on the last granuleval of the last full packet * / <nl> if ( saved ! = - 1 ) { <nl> os - > granule_vals [ saved ] = granulepos ; <nl> void test_pack ( const int * pl , const int * * headers , int byteskip , <nl> / * construct a test packet * / <nl> ogg_packet op ; <nl> int len = pl [ i ] ; <nl> - <nl> + <nl> op . packet = data + inptr ; <nl> op . bytes = len ; <nl> op . e_o_s = ( pl [ i + 1 ] < 0 ? 1 : 0 ) ; <nl> void test_pack ( const int * pl , const int * * headers , int byteskip , <nl> / * retrieve any finished pages * / <nl> { <nl> ogg_page og ; <nl> - <nl> + <nl> while ( ogg_stream_pageout ( & os_en , & og ) ) { <nl> / * We have a page . Check it carefully * / <nl> <nl> void test_pack ( const int * pl , const int * * headers , int byteskip , <nl> if ( ret = = 0 ) break ; <nl> if ( ret < 0 ) continue ; <nl> / * got a page . Happy happy . Verify that it ' s good . * / <nl> - <nl> + <nl> fprintf ( stderr , " ( % d ) , " , pageout ) ; <nl> <nl> check_page ( data + deptr , headers [ pageout ] , & og_de ) ; <nl> void test_pack ( const int * pl , const int * * headers , int byteskip , <nl> while ( ogg_stream_packetpeek ( & os_de , & op_de2 ) > 0 ) { <nl> ogg_stream_packetpeek ( & os_de , NULL ) ; <nl> ogg_stream_packetout ( & os_de , & op_de ) ; / * just catching them all * / <nl> - <nl> + <nl> / * verify peek and out match * / <nl> if ( memcmp ( & op_de , & op_de2 , sizeof ( op_de ) ) ) { <nl> fprintf ( stderr , " packetout ! = packetpeek ! pos = % ld \ n " , <nl> void test_pack ( const int * pl , const int * * headers , int byteskip , <nl> } <nl> bosflag = 1 ; <nl> depacket + = op_de . bytes ; <nl> - <nl> + <nl> / * check eos flag * / <nl> if ( eosflag ) { <nl> fprintf ( stderr , " Multiple decoded packets with eos flag ! \ n " ) ; <nl> int main ( void ) { <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 50 , - 1 } ; <nl> const int * headret [ ] = { head1_5 , head2_5 , head3_5 , NULL } ; <nl> - <nl> + <nl> fprintf ( stderr , " testing max packet segments . . . " ) ; <nl> test_pack ( packets , headret , 0 , 0 , 0 ) ; <nl> } <nl> int main ( void ) { <nl> / * packet that overspans over an entire page * / <nl> const int packets [ ] = { 0 , 100 , 130049 , 259 , 255 , - 1 } ; <nl> const int * headret [ ] = { head1_6 , head2_6 , head3_6 , head4_6 , NULL } ; <nl> - <nl> + <nl> fprintf ( stderr , " testing very large packets . . . " ) ; <nl> test_pack ( packets , headret , 0 , 0 , 0 ) ; <nl> } <nl> int main ( void ) { <nl> found by Josh Coalson ) * / <nl> const int packets [ ] = { 0 , 100 , 130049 , 259 , 255 , - 1 } ; <nl> const int * headret [ ] = { head1_6 , head2_6 , head3_6 , head4_6 , NULL } ; <nl> - <nl> + <nl> fprintf ( stderr , " testing continuation resync in very large packets . . . " ) ; <nl> test_pack ( packets , headret , 100 , 2 , 3 ) ; <nl> } <nl> int main ( void ) { <nl> / * term only page . why not ? * / <nl> const int packets [ ] = { 0 , 100 , 64770 , - 1 } ; <nl> const int * headret [ ] = { head1_7 , head2_7 , head3_7 , NULL } ; <nl> - <nl> + <nl> fprintf ( stderr , " testing zero data page ( 1 nil packet ) . . . " ) ; <nl> test_pack ( packets , headret , 0 , 0 , 0 ) ; <nl> } <nl> int main ( void ) { <nl> int pl [ ] = { 0 , 1 , 1 , 98 , 4079 , 1 , 1 , 2954 , 2057 , 76 , 34 , 912 , 0 , 234 , 1000 , 1000 , 1000 , 300 , - 1 } ; <nl> int inptr = 0 , i , j ; <nl> ogg_page og [ 5 ] ; <nl> - <nl> + <nl> ogg_stream_reset ( & os_en ) ; <nl> <nl> for ( i = 0 ; pl [ i ] ! = - 1 ; i + + ) { <nl> ogg_packet op ; <nl> int len = pl [ i ] ; <nl> - <nl> + <nl> op . packet = data + inptr ; <nl> op . bytes = len ; <nl> op . e_o_s = ( pl [ i + 1 ] < 0 ? 1 : 0 ) ; <nl> int main ( void ) { <nl> ogg_stream_pagein ( & os_de , & temp ) ; <nl> <nl> / * do we get the expected results / packets ? * / <nl> - <nl> + <nl> if ( ogg_stream_packetout ( & os_de , & test ) ! = 1 ) error ( ) ; <nl> checkpacket ( & test , 0 , 0 , 0 ) ; <nl> if ( ogg_stream_packetout ( & os_de , & test ) ! = 1 ) error ( ) ; <nl> int main ( void ) { <nl> <nl> fprintf ( stderr , " ok . \ n " ) ; <nl> } <nl> - <nl> + <nl> / * Test recapture : garbage + page * / <nl> { <nl> ogg_page og_de ; <nl> fprintf ( stderr , " Testing search for capture . . . " ) ; <nl> - ogg_sync_reset ( & oy ) ; <nl> - <nl> + ogg_sync_reset ( & oy ) ; <nl> + <nl> / * ' garbage ' * / <nl> memcpy ( ogg_sync_buffer ( & oy , og [ 1 ] . body_len ) , og [ 1 ] . body , <nl> og [ 1 ] . body_len ) ; <nl> int main ( void ) { <nl> { <nl> ogg_page og_de ; <nl> fprintf ( stderr , " Testing recapture . . . " ) ; <nl> - ogg_sync_reset ( & oy ) ; <nl> + ogg_sync_reset ( & oy ) ; <nl> <nl> memcpy ( ogg_sync_buffer ( & oy , og [ 1 ] . header_len ) , og [ 1 ] . header , <nl> og [ 1 ] . header_len ) ; <nl> int main ( void ) { <nl> free_page ( & og [ i ] ) ; <nl> } <nl> } <nl> - } <nl> + } <nl> <nl> return ( 0 ) ; <nl> } <nl> <nl> # endif <nl> - <nl> - <nl> - <nl> - <nl> mmm a / drivers / ogg / ogg . h <nl> ppp b / drivers / ogg / ogg . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : toplevel libogg include <nl> - last mod : $ Id : ogg . h 17571 2010 - 10 - 27 13 : 28 : 20Z xiphmont $ <nl> + last mod : $ Id : ogg . h 18044 2011 - 08 - 01 17 : 55 : 20Z gmaxwell $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> # ifndef _OGG_H <nl> extern int ogg_stream_iovecin ( ogg_stream_state * os , ogg_iovec_t * iov , <nl> extern int ogg_stream_pageout ( ogg_stream_state * os , ogg_page * og ) ; <nl> extern int ogg_stream_pageout_fill ( ogg_stream_state * os , ogg_page * og , int nfill ) ; <nl> extern int ogg_stream_flush ( ogg_stream_state * os , ogg_page * og ) ; <nl> + extern int ogg_stream_flush_fill ( ogg_stream_state * os , ogg_page * og , int nfill ) ; <nl> <nl> / * Ogg BITSTREAM PRIMITIVES : decoding * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> mmm a / drivers / ogg / os_types . h <nl> ppp b / drivers / ogg / os_types . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : # ifdef jail to whip a few platforms into the UNIX ideal . <nl> - last mod : $ Id : os_types . h 17712 2010 - 12 - 03 17 : 10 : 02Z xiphmont $ <nl> + last mod : $ Id : os_types . h 19098 2014 - 02 - 26 19 : 06 : 45Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> # ifndef _OS_TYPES_H <nl> <nl> # define _ogg_realloc realloc <nl> # define _ogg_free free <nl> <nl> - # if defined ( _WIN32 ) <nl> + # if defined ( _WIN32 ) <nl> <nl> # if defined ( __CYGWIN__ ) <nl> # include < stdint . h > <nl> mmm a / drivers / theora / codec . h <nl> ppp b / drivers / theora / codec . h <nl> <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> - / * * \ file <nl> + / * * \ mainpage <nl> * <nl> * \ section intro Introduction <nl> * <nl> mmm a / drivers / theora / decode . c <nl> ppp b / drivers / theora / decode . c <nl> static void oc_filter_hedge ( unsigned char * _dst , int _dst_ystride , <nl> int sum1 ; <nl> int bx ; <nl> int by ; <nl> - int _rlimit1 ; <nl> - int _rlimit2 ; <nl> rdst = _dst ; <nl> rsrc = _src ; <nl> - for ( bx = 0 ; bx < 8 ; + + bx ) { <nl> + for ( bx = 0 ; bx < 8 ; bx + + ) { <nl> cdst = rdst ; <nl> csrc = rsrc ; <nl> - _rlimit1 = _rlimit2 = _flimit ; <nl> - for ( by = 0 ; by < 10 ; + + by ) { <nl> + for ( by = 0 ; by < 10 ; by + + ) { <nl> r [ by ] = * csrc ; <nl> csrc + = _src_ystride ; <nl> } <nl> sum0 = sum1 = 0 ; <nl> - for ( by = 0 ; by < 4 ; + + by ) { <nl> - int sumed = abs ( r [ by + 1 ] - r [ by ] ) ; <nl> - sum0 + = sumed ; <nl> - _rlimit1 - = sumed ; <nl> - sumed = abs ( r [ by + 5 ] - r [ by + 6 ] ) ; <nl> - sum1 + = sumed ; <nl> - _rlimit2 - = sumed ; <nl> + for ( by = 0 ; by < 4 ; by + + ) { <nl> + sum0 + = abs ( r [ by + 1 ] - r [ by ] ) ; <nl> + sum1 + = abs ( r [ by + 5 ] - r [ by + 6 ] ) ; <nl> } <nl> * _variance0 + = OC_MINI ( 255 , sum0 ) ; <nl> * _variance1 + = OC_MINI ( 255 , sum1 ) ; <nl> - if ( _rlimit1 & & _rlimit2 & & ! ( r [ 5 ] - r [ 4 ] - _qstep ) & & ! ( r [ 4 ] - r [ 5 ] - _qstep ) ) { <nl> + if ( sum0 < _flimit & & sum1 < _flimit & & r [ 5 ] - r [ 4 ] < _qstep & & r [ 4 ] - r [ 5 ] < _qstep ) { <nl> * cdst = ( unsigned char ) ( r [ 0 ] * 3 + r [ 1 ] * 2 + r [ 2 ] + r [ 3 ] + r [ 4 ] + 4 > > 3 ) ; <nl> cdst + = _dst_ystride ; <nl> * cdst = ( unsigned char ) ( r [ 0 ] * 2 + r [ 1 ] + r [ 2 ] * 2 + r [ 3 ] + r [ 4 ] + r [ 5 ] + 4 > > 3 ) ; <nl> cdst + = _dst_ystride ; <nl> - for ( by = 0 ; by < 4 ; + + by ) { <nl> + for ( by = 0 ; by < 4 ; by + + ) { <nl> * cdst = ( unsigned char ) ( r [ by ] + r [ by + 1 ] + r [ by + 2 ] + r [ by + 3 ] * 2 + <nl> r [ by + 4 ] + r [ by + 5 ] + r [ by + 6 ] + 4 > > 3 ) ; <nl> cdst + = _dst_ystride ; <nl> static void oc_filter_hedge ( unsigned char * _dst , int _dst_ystride , <nl> * cdst = ( unsigned char ) ( r [ 5 ] + r [ 6 ] + r [ 7 ] + r [ 8 ] * 2 + r [ 9 ] * 3 + 4 > > 3 ) ; <nl> } <nl> else { <nl> - for ( by = 1 ; by < = 8 ; + + by ) { <nl> + for ( by = 1 ; by < = 8 ; by + + ) { <nl> * cdst = ( unsigned char ) r [ by ] ; <nl> cdst + = _dst_ystride ; <nl> } <nl> } <nl> - + + rdst ; <nl> - + + rsrc ; <nl> + rdst + + ; <nl> + rsrc + + ; <nl> } <nl> } <nl> <nl> static void oc_filter_vedge ( unsigned char * _dst , int _dst_ystride , <nl> int sum1 ; <nl> int bx ; <nl> int by ; <nl> - int _rlimit1 ; <nl> - int _rlimit2 ; <nl> cdst = _dst ; <nl> - for ( by = 0 ; by < 8 ; + + by ) { <nl> + for ( by = 0 ; by < 8 ; by + + ) { <nl> rsrc = cdst - 1 ; <nl> rdst = cdst ; <nl> - for ( bx = 0 ; bx < 10 ; + + bx ) r [ bx ] = * rsrc + + ; <nl> + for ( bx = 0 ; bx < 10 ; bx + + ) r [ bx ] = * rsrc + + ; <nl> sum0 = sum1 = 0 ; <nl> - _rlimit1 = _rlimit2 = _flimit ; <nl> - for ( bx = 0 ; bx < 4 ; + + bx ) { <nl> - int sumed = abs ( r [ bx + 1 ] - r [ bx ] ) ; <nl> - sum0 + = sumed ; <nl> - _rlimit1 - = sumed ; <nl> - sumed = abs ( r [ bx + 5 ] - r [ bx + 6 ] ) ; <nl> - sum1 + = sumed ; <nl> - _rlimit2 - = sumed ; <nl> + for ( bx = 0 ; bx < 4 ; bx + + ) { <nl> + sum0 + = abs ( r [ bx + 1 ] - r [ bx ] ) ; <nl> + sum1 + = abs ( r [ bx + 5 ] - r [ bx + 6 ] ) ; <nl> } <nl> _variances [ 0 ] + = OC_MINI ( 255 , sum0 ) ; <nl> _variances [ 1 ] + = OC_MINI ( 255 , sum1 ) ; <nl> - if ( _rlimit1 & & _rlimit2 & & ! ( r [ 5 ] - r [ 4 ] - _qstep ) & & ! ( r [ 4 ] - r [ 5 ] - _qstep ) ) { <nl> + if ( sum0 < _flimit & & sum1 < _flimit & & r [ 5 ] - r [ 4 ] < _qstep & & r [ 4 ] - r [ 5 ] < _qstep ) { <nl> * rdst + + = ( unsigned char ) ( r [ 0 ] * 3 + r [ 1 ] * 2 + r [ 2 ] + r [ 3 ] + r [ 4 ] + 4 > > 3 ) ; <nl> * rdst + + = ( unsigned char ) ( r [ 0 ] * 2 + r [ 1 ] + r [ 2 ] * 2 + r [ 3 ] + r [ 4 ] + r [ 5 ] + 4 > > 3 ) ; <nl> for ( bx = 0 ; bx < 4 ; bx + + ) { <nl> mmm a / drivers / theora / encint . h <nl> ppp b / drivers / theora / encint . h <nl> <nl> last mod : $ Id : encint . h 16503 2009 - 08 - 22 18 : 14 : 02Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - <nl> # if ! defined ( _encint_H ) <nl> # define _encint_H ( 1 ) <nl> # if defined ( HAVE_CONFIG_H ) <nl> mmm a / drivers / vorbis / COPYING <nl> ppp b / drivers / vorbis / COPYING <nl> <nl> - Copyright ( c ) 2002 - 2008 Xiph . org Foundation <nl> + Copyright ( c ) 2002 - 2015 Xiph . org Foundation <nl> <nl> Redistribution and use in source and binary forms , with or without <nl> modification , are permitted provided that the following conditions <nl> mmm a / drivers / vorbis / barkmel . c <nl> ppp b / drivers / vorbis / barkmel . c <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : bark scale utility <nl> - last mod : $ Id : barkmel . c 16037 2009 - 05 - 26 21 : 10 : 58Z xiphmont $ <nl> + last mod : $ Id : barkmel . c 19454 2015 - 03 - 02 22 : 39 : 28Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> mmm a / drivers / vorbis / block . c <nl> ppp b / drivers / vorbis / block . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : PCM data vector blocking , windowing and dis / reassembly <nl> - last mod : $ Id : block . c 17561 2010 - 10 - 23 10 : 34 : 24Z xiphmont $ <nl> + last mod : $ Id : block . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> Handle windowing , overlap - add , etc of the PCM vectors . This is made <nl> more amusing by Vorbis ' current two allowed block sizes . <nl> <nl> # include " registry . h " <nl> # include " misc . h " <nl> <nl> - static int ilog2 ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - if ( v ) - - v ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> - } <nl> - <nl> / * pcm accumulator examples ( not exhaustive ) : <nl> <nl> < mmmmmmmmmmmm - - lW mmmmmmmmmmmmmmm - > <nl> static int _vds_shared_init ( vorbis_dsp_state * v , vorbis_info * vi , int encp ) { <nl> private_state * b = NULL ; <nl> int hs ; <nl> <nl> - if ( ci = = NULL ) return 1 ; <nl> + if ( ci = = NULL | | <nl> + ci - > modes < = 0 | | <nl> + ci - > blocksizes [ 0 ] < 64 | | <nl> + ci - > blocksizes [ 1 ] < ci - > blocksizes [ 0 ] ) { <nl> + return 1 ; <nl> + } <nl> hs = ci - > halfrate_flag ; <nl> <nl> memset ( v , 0 , sizeof ( * v ) ) ; <nl> b = v - > backend_state = _ogg_calloc ( 1 , sizeof ( * b ) ) ; <nl> <nl> v - > vi = vi ; <nl> - b - > modebits = ilog2 ( ci - > modes ) ; <nl> + b - > modebits = ov_ilog ( ci - > modes - 1 ) ; <nl> <nl> b - > transform [ 0 ] = _ogg_calloc ( VI_TRANSFORMB , sizeof ( * b - > transform [ 0 ] ) ) ; <nl> b - > transform [ 1 ] = _ogg_calloc ( VI_TRANSFORMB , sizeof ( * b - > transform [ 1 ] ) ) ; <nl> static int _vds_shared_init ( vorbis_dsp_state * v , vorbis_info * vi , int encp ) { <nl> mdct_init ( b - > transform [ 1 ] [ 0 ] , ci - > blocksizes [ 1 ] > > hs ) ; <nl> <nl> / * Vorbis I uses only window type 0 * / <nl> - b - > window [ 0 ] = ilog2 ( ci - > blocksizes [ 0 ] ) - 6 ; <nl> - b - > window [ 1 ] = ilog2 ( ci - > blocksizes [ 1 ] ) - 6 ; <nl> + / * note that the correct computation below is technically : <nl> + b - > window [ 0 ] = ov_ilog ( ci - > blocksizes [ 0 ] - 1 ) - 6 ; <nl> + b - > window [ 1 ] = ov_ilog ( ci - > blocksizes [ 1 ] - 1 ) - 6 ; <nl> + but since blocksizes are always powers of two , <nl> + the below is equivalent . <nl> + * / <nl> + b - > window [ 0 ] = ov_ilog ( ci - > blocksizes [ 0 ] ) - 7 ; <nl> + b - > window [ 1 ] = ov_ilog ( ci - > blocksizes [ 1 ] ) - 7 ; <nl> <nl> if ( encp ) { / * encode / decode differ here * / <nl> <nl> int vorbis_synthesis_blockin ( vorbis_dsp_state * v , vorbis_block * vb ) { <nl> if ( v - > lW ) { <nl> if ( v - > W ) { <nl> / * large / large * / <nl> - float * w = _vorbis_window_get ( b - > window [ 1 ] - hs ) ; <nl> + const float * w = _vorbis_window_get ( b - > window [ 1 ] - hs ) ; <nl> float * pcm = v - > pcm [ j ] + prevCenter ; <nl> float * p = vb - > pcm [ j ] ; <nl> for ( i = 0 ; i < n1 ; i + + ) <nl> pcm [ i ] = pcm [ i ] * w [ n1 - i - 1 ] + p [ i ] * w [ i ] ; <nl> } else { <nl> / * large / small * / <nl> - float * w = _vorbis_window_get ( b - > window [ 0 ] - hs ) ; <nl> + const float * w = _vorbis_window_get ( b - > window [ 0 ] - hs ) ; <nl> float * pcm = v - > pcm [ j ] + prevCenter + n1 / 2 - n0 / 2 ; <nl> float * p = vb - > pcm [ j ] ; <nl> for ( i = 0 ; i < n0 ; i + + ) <nl> int vorbis_synthesis_blockin ( vorbis_dsp_state * v , vorbis_block * vb ) { <nl> } else { <nl> if ( v - > W ) { <nl> / * small / large * / <nl> - float * w = _vorbis_window_get ( b - > window [ 0 ] - hs ) ; <nl> + const float * w = _vorbis_window_get ( b - > window [ 0 ] - hs ) ; <nl> float * pcm = v - > pcm [ j ] + prevCenter ; <nl> float * p = vb - > pcm [ j ] + n1 / 2 - n0 / 2 ; <nl> for ( i = 0 ; i < n0 ; i + + ) <nl> int vorbis_synthesis_blockin ( vorbis_dsp_state * v , vorbis_block * vb ) { <nl> pcm [ i ] = p [ i ] ; <nl> } else { <nl> / * small / small * / <nl> - float * w = _vorbis_window_get ( b - > window [ 0 ] - hs ) ; <nl> + const float * w = _vorbis_window_get ( b - > window [ 0 ] - hs ) ; <nl> float * pcm = v - > pcm [ j ] + prevCenter ; <nl> float * p = vb - > pcm [ j ] ; <nl> for ( i = 0 ; i < n0 ; i + + ) <nl> int vorbis_synthesis_lapout ( vorbis_dsp_state * v , float * * * pcm ) { <nl> <nl> } <nl> <nl> - float * vorbis_window ( vorbis_dsp_state * v , int W ) { <nl> + const float * vorbis_window ( vorbis_dsp_state * v , int W ) { <nl> vorbis_info * vi = v - > vi ; <nl> codec_setup_info * ci = vi - > codec_setup ; <nl> int hs = ci - > halfrate_flag ; <nl> deleted file mode 100644 <nl> index 3697a7177ec . . 00000000000 <nl> mmm a / drivers / vorbis / books / Makefile . am <nl> ppp / dev / null <nl> <nl> - # # Process this file with automake to produce Makefile . in <nl> - <nl> - SUBDIRS = coupled uncoupled floor <nl> deleted file mode 100644 <nl> index 0d957f0cf6f . . 00000000000 <nl> mmm a / drivers / vorbis / books / Makefile . in <nl> ppp / dev / null <nl> <nl> - # Makefile . in generated by automake 1 . 10 . 2 from Makefile . am . <nl> - # @ configure_input @ <nl> - <nl> - # Copyright ( C ) 1994 , 1995 , 1996 , 1997 , 1998 , 1999 , 2000 , 2001 , 2002 , <nl> - # 2003 , 2004 , 2005 , 2006 , 2007 , 2008 Free Software Foundation , Inc . <nl> - # This Makefile . in is free software ; the Free Software Foundation <nl> - # gives unlimited permission to copy and / or distribute it , <nl> - # with or without modifications , as long as this notice is preserved . <nl> - <nl> - # This program is distributed in the hope that it will be useful , <nl> - # but WITHOUT ANY WARRANTY , to the extent permitted by law ; without <nl> - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A <nl> - # PARTICULAR PURPOSE . <nl> - <nl> - @ SET_MAKE @ <nl> - VPATH = @ srcdir @ <nl> - pkgdatadir = $ ( datadir ) / @ PACKAGE @ <nl> - pkglibdir = $ ( libdir ) / @ PACKAGE @ <nl> - pkgincludedir = $ ( includedir ) / @ PACKAGE @ <nl> - am__cd = CDPATH = " $ $ { ZSH_VERSION + . } $ ( PATH_SEPARATOR ) " & & cd <nl> - install_sh_DATA = $ ( install_sh ) - c - m 644 <nl> - install_sh_PROGRAM = $ ( install_sh ) - c <nl> - install_sh_SCRIPT = $ ( install_sh ) - c <nl> - INSTALL_HEADER = $ ( INSTALL_DATA ) <nl> - transform = $ ( program_transform_name ) <nl> - NORMAL_INSTALL = : <nl> - PRE_INSTALL = : <nl> - POST_INSTALL = : <nl> - NORMAL_UNINSTALL = : <nl> - PRE_UNINSTALL = : <nl> - POST_UNINSTALL = : <nl> - build_triplet = @ build @ <nl> - host_triplet = @ host @ <nl> - target_triplet = @ target @ <nl> - subdir = lib / books <nl> - DIST_COMMON = $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . in <nl> - ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> - am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / add_cflags . m4 \ <nl> - $ ( top_srcdir ) / m4 / ogg . m4 $ ( top_srcdir ) / m4 / pkg . m4 \ <nl> - $ ( top_srcdir ) / configure . ac <nl> - am__configure_deps = $ ( am__aclocal_m4_deps ) $ ( CONFIGURE_DEPENDENCIES ) \ <nl> - $ ( ACLOCAL_M4 ) <nl> - mkinstalldirs = $ ( install_sh ) - d <nl> - CONFIG_HEADER = $ ( top_builddir ) / config . h <nl> - CONFIG_CLEAN_FILES = <nl> - SOURCES = <nl> - DIST_SOURCES = <nl> - RECURSIVE_TARGETS = all - recursive check - recursive dvi - recursive \ <nl> - html - recursive info - recursive install - data - recursive \ <nl> - install - dvi - recursive install - exec - recursive \ <nl> - install - html - recursive install - info - recursive \ <nl> - install - pdf - recursive install - ps - recursive install - recursive \ <nl> - installcheck - recursive installdirs - recursive pdf - recursive \ <nl> - ps - recursive uninstall - recursive <nl> - RECURSIVE_CLEAN_TARGETS = mostlyclean - recursive clean - recursive \ <nl> - distclean - recursive maintainer - clean - recursive <nl> - ETAGS = etags <nl> - CTAGS = ctags <nl> - DIST_SUBDIRS = $ ( SUBDIRS ) <nl> - DISTFILES = $ ( DIST_COMMON ) $ ( DIST_SOURCES ) $ ( TEXINFOS ) $ ( EXTRA_DIST ) <nl> - ACLOCAL = @ ACLOCAL @ <nl> - ACLOCAL_AMFLAGS = @ ACLOCAL_AMFLAGS @ <nl> - ALLOCA = @ ALLOCA @ <nl> - AMTAR = @ AMTAR @ <nl> - AR = @ AR @ <nl> - AS = @ AS @ <nl> - AUTOCONF = @ AUTOCONF @ <nl> - AUTOHEADER = @ AUTOHEADER @ <nl> - AUTOMAKE = @ AUTOMAKE @ <nl> - AWK = @ AWK @ <nl> - CC = @ CC @ <nl> - CCDEPMODE = @ CCDEPMODE @ <nl> - CFLAGS = @ CFLAGS @ <nl> - CPP = @ CPP @ <nl> - CPPFLAGS = @ CPPFLAGS @ <nl> - CYGPATH_W = @ CYGPATH_W @ <nl> - DEBUG = @ DEBUG @ <nl> - DEFS = @ DEFS @ <nl> - DEPDIR = @ DEPDIR @ <nl> - DLLTOOL = @ DLLTOOL @ <nl> - DSYMUTIL = @ DSYMUTIL @ <nl> - DUMPBIN = @ DUMPBIN @ <nl> - ECHO_C = @ ECHO_C @ <nl> - ECHO_N = @ ECHO_N @ <nl> - ECHO_T = @ ECHO_T @ <nl> - EGREP = @ EGREP @ <nl> - EXEEXT = @ EXEEXT @ <nl> - FGREP = @ FGREP @ <nl> - GREP = @ GREP @ <nl> - HAVE_DOXYGEN = @ HAVE_DOXYGEN @ <nl> - HTLATEX = @ HTLATEX @ <nl> - INSTALL = @ INSTALL @ <nl> - INSTALL_DATA = @ INSTALL_DATA @ <nl> - INSTALL_PROGRAM = @ INSTALL_PROGRAM @ <nl> - INSTALL_SCRIPT = @ INSTALL_SCRIPT @ <nl> - INSTALL_STRIP_PROGRAM = @ INSTALL_STRIP_PROGRAM @ <nl> - LD = @ LD @ <nl> - LDFLAGS = @ LDFLAGS @ <nl> - LIBOBJS = @ LIBOBJS @ <nl> - LIBS = @ LIBS @ <nl> - LIBTOOL = @ LIBTOOL @ <nl> - LIBTOOL_DEPS = @ LIBTOOL_DEPS @ <nl> - LIPO = @ LIPO @ <nl> - LN_S = @ LN_S @ <nl> - LTLIBOBJS = @ LTLIBOBJS @ <nl> - MAINT = @ MAINT @ <nl> - MAKEINFO = @ MAKEINFO @ <nl> - MKDIR_P = @ MKDIR_P @ <nl> - NM = @ NM @ <nl> - NMEDIT = @ NMEDIT @ <nl> - OBJDUMP = @ OBJDUMP @ <nl> - OBJEXT = @ OBJEXT @ <nl> - OGG_CFLAGS = @ OGG_CFLAGS @ <nl> - OGG_LIBS = @ OGG_LIBS @ <nl> - OTOOL = @ OTOOL @ <nl> - OTOOL64 = @ OTOOL64 @ <nl> - PACKAGE = @ PACKAGE @ <nl> - PACKAGE_BUGREPORT = @ PACKAGE_BUGREPORT @ <nl> - PACKAGE_NAME = @ PACKAGE_NAME @ <nl> - PACKAGE_STRING = @ PACKAGE_STRING @ <nl> - PACKAGE_TARNAME = @ PACKAGE_TARNAME @ <nl> - PACKAGE_VERSION = @ PACKAGE_VERSION @ <nl> - PATH_SEPARATOR = @ PATH_SEPARATOR @ <nl> - PDFLATEX = @ PDFLATEX @ <nl> - PKG_CONFIG = @ PKG_CONFIG @ <nl> - PROFILE = @ PROFILE @ <nl> - RANLIB = @ RANLIB @ <nl> - SED = @ SED @ <nl> - SET_MAKE = @ SET_MAKE @ <nl> - SHELL = @ SHELL @ <nl> - STRIP = @ STRIP @ <nl> - VERSION = @ VERSION @ <nl> - VE_LIB_AGE = @ VE_LIB_AGE @ <nl> - VE_LIB_CURRENT = @ VE_LIB_CURRENT @ <nl> - VE_LIB_REVISION = @ VE_LIB_REVISION @ <nl> - VF_LIB_AGE = @ VF_LIB_AGE @ <nl> - VF_LIB_CURRENT = @ VF_LIB_CURRENT @ <nl> - VF_LIB_REVISION = @ VF_LIB_REVISION @ <nl> - VORBIS_LIBS = @ VORBIS_LIBS @ <nl> - V_LIB_AGE = @ V_LIB_AGE @ <nl> - V_LIB_CURRENT = @ V_LIB_CURRENT @ <nl> - V_LIB_REVISION = @ V_LIB_REVISION @ <nl> - abs_builddir = @ abs_builddir @ <nl> - abs_srcdir = @ abs_srcdir @ <nl> - abs_top_builddir = @ abs_top_builddir @ <nl> - abs_top_srcdir = @ abs_top_srcdir @ <nl> - ac_ct_CC = @ ac_ct_CC @ <nl> - ac_ct_DUMPBIN = @ ac_ct_DUMPBIN @ <nl> - am__include = @ am__include @ <nl> - am__leading_dot = @ am__leading_dot @ <nl> - am__quote = @ am__quote @ <nl> - am__tar = @ am__tar @ <nl> - am__untar = @ am__untar @ <nl> - bindir = @ bindir @ <nl> - build = @ build @ <nl> - build_alias = @ build_alias @ <nl> - build_cpu = @ build_cpu @ <nl> - build_os = @ build_os @ <nl> - build_vendor = @ build_vendor @ <nl> - builddir = @ builddir @ <nl> - datadir = @ datadir @ <nl> - datarootdir = @ datarootdir @ <nl> - docdir = @ docdir @ <nl> - dvidir = @ dvidir @ <nl> - exec_prefix = @ exec_prefix @ <nl> - host = @ host @ <nl> - host_alias = @ host_alias @ <nl> - host_cpu = @ host_cpu @ <nl> - host_os = @ host_os @ <nl> - host_vendor = @ host_vendor @ <nl> - htmldir = @ htmldir @ <nl> - includedir = @ includedir @ <nl> - infodir = @ infodir @ <nl> - install_sh = @ install_sh @ <nl> - libdir = @ libdir @ <nl> - libexecdir = @ libexecdir @ <nl> - localedir = @ localedir @ <nl> - localstatedir = @ localstatedir @ <nl> - lt_ECHO = @ lt_ECHO @ <nl> - mandir = @ mandir @ <nl> - mkdir_p = @ mkdir_p @ <nl> - oldincludedir = @ oldincludedir @ <nl> - pdfdir = @ pdfdir @ <nl> - prefix = @ prefix @ <nl> - program_transform_name = @ program_transform_name @ <nl> - psdir = @ psdir @ <nl> - pthread_lib = @ pthread_lib @ <nl> - sbindir = @ sbindir @ <nl> - sharedstatedir = @ sharedstatedir @ <nl> - srcdir = @ srcdir @ <nl> - sysconfdir = @ sysconfdir @ <nl> - target = @ target @ <nl> - target_alias = @ target_alias @ <nl> - target_cpu = @ target_cpu @ <nl> - target_os = @ target_os @ <nl> - target_vendor = @ target_vendor @ <nl> - top_builddir = @ top_builddir @ <nl> - top_srcdir = @ top_srcdir @ <nl> - SUBDIRS = coupled uncoupled floor <nl> - all : all - recursive <nl> - <nl> - . SUFFIXES : <nl> - $ ( srcdir ) / Makefile . in : @ MAINTAINER_MODE_TRUE @ $ ( srcdir ) / Makefile . am $ ( am__configure_deps ) <nl> - @ for dep in $ ? ; do \ <nl> - case ' $ ( am__configure_deps ) ' in \ <nl> - * $ $ dep * ) \ <nl> - ( cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ) \ <nl> - & & { if test - f $ @ ; then exit 0 ; else break ; fi ; } ; \ <nl> - exit 1 ; ; \ <nl> - esac ; \ <nl> - done ; \ <nl> - echo ' cd $ ( top_srcdir ) & & $ ( AUTOMAKE ) - - gnu lib / books / Makefile ' ; \ <nl> - cd $ ( top_srcdir ) & & \ <nl> - $ ( AUTOMAKE ) - - gnu lib / books / Makefile <nl> - . PRECIOUS : Makefile <nl> - Makefile : $ ( srcdir ) / Makefile . in $ ( top_builddir ) / config . status <nl> - @ case ' $ ? ' in \ <nl> - * config . status * ) \ <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ; ; \ <nl> - * ) \ <nl> - echo ' cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ' ; \ <nl> - cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ; ; \ <nl> - esac ; <nl> - <nl> - $ ( top_builddir ) / config . status : $ ( top_srcdir ) / configure $ ( CONFIG_STATUS_DEPENDENCIES ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - $ ( top_srcdir ) / configure : @ MAINTAINER_MODE_TRUE @ $ ( am__configure_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - $ ( ACLOCAL_M4 ) : @ MAINTAINER_MODE_TRUE @ $ ( am__aclocal_m4_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - mostlyclean - libtool : <nl> - - rm - f * . lo <nl> - <nl> - clean - libtool : <nl> - - rm - rf . libs _libs <nl> - <nl> - # This directory ' s subdirectories are mostly independent ; you can cd <nl> - # into them and run ` make ' without going through this Makefile . <nl> - # To change the values of ` make ' variables : instead of editing Makefiles , <nl> - # ( 1 ) if the variable is set in ` config . status ' , edit ` config . status ' <nl> - # ( which will cause the Makefiles to be regenerated when you run ` make ' ) ; <nl> - # ( 2 ) otherwise , pass the desired values on the ` make ' command line . <nl> - $ ( RECURSIVE_TARGETS ) : <nl> - @ failcom = ' exit 1 ' ; \ <nl> - for f in x $ $ MAKEFLAGS ; do \ <nl> - case $ $ f in \ <nl> - * = * | - - [ ! k ] * ) ; ; \ <nl> - * k * ) failcom = ' fail = yes ' ; ; \ <nl> - esac ; \ <nl> - done ; \ <nl> - dot_seen = no ; \ <nl> - target = ` echo $ @ | sed s / - recursive / / ` ; \ <nl> - list = ' $ ( SUBDIRS ) ' ; for subdir in $ $ list ; do \ <nl> - echo " Making $ $ target in $ $ subdir " ; \ <nl> - if test " $ $ subdir " = " . " ; then \ <nl> - dot_seen = yes ; \ <nl> - local_target = " $ $ target - am " ; \ <nl> - else \ <nl> - local_target = " $ $ target " ; \ <nl> - fi ; \ <nl> - ( cd $ $ subdir & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) $ $ local_target ) \ <nl> - | | eval $ $ failcom ; \ <nl> - done ; \ <nl> - if test " $ $ dot_seen " = " no " ; then \ <nl> - $ ( MAKE ) $ ( AM_MAKEFLAGS ) " $ $ target - am " | | exit 1 ; \ <nl> - fi ; test - z " $ $ fail " <nl> - <nl> - $ ( RECURSIVE_CLEAN_TARGETS ) : <nl> - @ failcom = ' exit 1 ' ; \ <nl> - for f in x $ $ MAKEFLAGS ; do \ <nl> - case $ $ f in \ <nl> - * = * | - - [ ! k ] * ) ; ; \ <nl> - * k * ) failcom = ' fail = yes ' ; ; \ <nl> - esac ; \ <nl> - done ; \ <nl> - dot_seen = no ; \ <nl> - case " $ @ " in \ <nl> - distclean - * | maintainer - clean - * ) list = ' $ ( DIST_SUBDIRS ) ' ; ; \ <nl> - * ) list = ' $ ( SUBDIRS ) ' ; ; \ <nl> - esac ; \ <nl> - rev = ' ' ; for subdir in $ $ list ; do \ <nl> - if test " $ $ subdir " = " . " ; then : ; else \ <nl> - rev = " $ $ subdir $ $ rev " ; \ <nl> - fi ; \ <nl> - done ; \ <nl> - rev = " $ $ rev . " ; \ <nl> - target = ` echo $ @ | sed s / - recursive / / ` ; \ <nl> - for subdir in $ $ rev ; do \ <nl> - echo " Making $ $ target in $ $ subdir " ; \ <nl> - if test " $ $ subdir " = " . " ; then \ <nl> - local_target = " $ $ target - am " ; \ <nl> - else \ <nl> - local_target = " $ $ target " ; \ <nl> - fi ; \ <nl> - ( cd $ $ subdir & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) $ $ local_target ) \ <nl> - | | eval $ $ failcom ; \ <nl> - done & & test - z " $ $ fail " <nl> - tags - recursive : <nl> - list = ' $ ( SUBDIRS ) ' ; for subdir in $ $ list ; do \ <nl> - test " $ $ subdir " = . | | ( cd $ $ subdir & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) tags ) ; \ <nl> - done <nl> - ctags - recursive : <nl> - list = ' $ ( SUBDIRS ) ' ; for subdir in $ $ list ; do \ <nl> - test " $ $ subdir " = . | | ( cd $ $ subdir & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) ctags ) ; \ <nl> - done <nl> - <nl> - ID : $ ( HEADERS ) $ ( SOURCES ) $ ( LISP ) $ ( TAGS_FILES ) <nl> - list = ' $ ( SOURCES ) $ ( HEADERS ) $ ( LISP ) $ ( TAGS_FILES ) ' ; \ <nl> - unique = ` for i in $ $ list ; do \ <nl> - if test - f " $ $ i " ; then echo $ $ i ; else echo $ ( srcdir ) / $ $ i ; fi ; \ <nl> - done | \ <nl> - $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; nonempty = 1 ; } \ <nl> - END { if ( nonempty ) { for ( i in files ) print i ; } ; } ' ` ; \ <nl> - mkid - fID $ $ unique <nl> - tags : TAGS <nl> - <nl> - TAGS : tags - recursive $ ( HEADERS ) $ ( SOURCES ) $ ( TAGS_DEPENDENCIES ) \ <nl> - $ ( TAGS_FILES ) $ ( LISP ) <nl> - tags = ; \ <nl> - here = ` pwd ` ; \ <nl> - if ( $ ( ETAGS ) - - etags - include - - version ) > / dev / null 2 > & 1 ; then \ <nl> - include_option = - - etags - include ; \ <nl> - empty_fix = . ; \ <nl> - else \ <nl> - include_option = - - include ; \ <nl> - empty_fix = ; \ <nl> - fi ; \ <nl> - list = ' $ ( SUBDIRS ) ' ; for subdir in $ $ list ; do \ <nl> - if test " $ $ subdir " = . ; then : ; else \ <nl> - test ! - f $ $ subdir / TAGS | | \ <nl> - tags = " $ $ tags $ $ include_option = $ $ here / $ $ subdir / TAGS " ; \ <nl> - fi ; \ <nl> - done ; \ <nl> - list = ' $ ( SOURCES ) $ ( HEADERS ) $ ( LISP ) $ ( TAGS_FILES ) ' ; \ <nl> - unique = ` for i in $ $ list ; do \ <nl> - if test - f " $ $ i " ; then echo $ $ i ; else echo $ ( srcdir ) / $ $ i ; fi ; \ <nl> - done | \ <nl> - $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; nonempty = 1 ; } \ <nl> - END { if ( nonempty ) { for ( i in files ) print i ; } ; } ' ` ; \ <nl> - if test - z " $ ( ETAGS_ARGS ) $ $ tags $ $ unique " ; then : ; else \ <nl> - test - n " $ $ unique " | | unique = $ $ empty_fix ; \ <nl> - $ ( ETAGS ) $ ( ETAGSFLAGS ) $ ( AM_ETAGSFLAGS ) $ ( ETAGS_ARGS ) \ <nl> - $ $ tags $ $ unique ; \ <nl> - fi <nl> - ctags : CTAGS <nl> - CTAGS : ctags - recursive $ ( HEADERS ) $ ( SOURCES ) $ ( TAGS_DEPENDENCIES ) \ <nl> - $ ( TAGS_FILES ) $ ( LISP ) <nl> - tags = ; \ <nl> - list = ' $ ( SOURCES ) $ ( HEADERS ) $ ( LISP ) $ ( TAGS_FILES ) ' ; \ <nl> - unique = ` for i in $ $ list ; do \ <nl> - if test - f " $ $ i " ; then echo $ $ i ; else echo $ ( srcdir ) / $ $ i ; fi ; \ <nl> - done | \ <nl> - $ ( AWK ) ' { files [ $ $ 0 ] = 1 ; nonempty = 1 ; } \ <nl> - END { if ( nonempty ) { for ( i in files ) print i ; } ; } ' ` ; \ <nl> - test - z " $ ( CTAGS_ARGS ) $ $ tags $ $ unique " \ <nl> - | | $ ( CTAGS ) $ ( CTAGSFLAGS ) $ ( AM_CTAGSFLAGS ) $ ( CTAGS_ARGS ) \ <nl> - $ $ tags $ $ unique <nl> - <nl> - GTAGS : <nl> - here = ` $ ( am__cd ) $ ( top_builddir ) & & pwd ` \ <nl> - & & cd $ ( top_srcdir ) \ <nl> - & & gtags - i $ ( GTAGS_ARGS ) $ $ here <nl> - <nl> - distclean - tags : <nl> - - rm - f TAGS ID GTAGS GRTAGS GSYMS GPATH tags <nl> - <nl> - distdir : $ ( DISTFILES ) <nl> - @ srcdirstrip = ` echo " $ ( srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - topsrcdirstrip = ` echo " $ ( top_srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - list = ' $ ( DISTFILES ) ' ; \ <nl> - dist_files = ` for file in $ $ list ; do echo $ $ file ; done | \ <nl> - sed - e " s | ^ $ $ srcdirstrip / | | ; t " \ <nl> - - e " s | ^ $ $ topsrcdirstrip / | $ ( top_builddir ) / | ; t " ` ; \ <nl> - case $ $ dist_files in \ <nl> - * / * ) $ ( MKDIR_P ) ` echo " $ $ dist_files " | \ <nl> - sed ' / \ / / ! d ; s | ^ | $ ( distdir ) / | ; s , / [ ^ / ] * $ $ , , ' | \ <nl> - sort - u ` ; ; \ <nl> - esac ; \ <nl> - for file in $ $ dist_files ; do \ <nl> - if test - f $ $ file | | test - d $ $ file ; then d = . ; else d = $ ( srcdir ) ; fi ; \ <nl> - if test - d $ $ d / $ $ file ; then \ <nl> - dir = ` echo " / $ $ file " | sed - e ' s , / [ ^ / ] * $ $ , , ' ` ; \ <nl> - if test - d $ ( srcdir ) / $ $ file & & test $ $ d ! = $ ( srcdir ) ; then \ <nl> - cp - pR $ ( srcdir ) / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - fi ; \ <nl> - cp - pR $ $ d / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - else \ <nl> - test - f $ ( distdir ) / $ $ file \ <nl> - | | cp - p $ $ d / $ $ file $ ( distdir ) / $ $ file \ <nl> - | | exit 1 ; \ <nl> - fi ; \ <nl> - done <nl> - list = ' $ ( DIST_SUBDIRS ) ' ; for subdir in $ $ list ; do \ <nl> - if test " $ $ subdir " = . ; then : ; else \ <nl> - test - d " $ ( distdir ) / $ $ subdir " \ <nl> - | | $ ( MKDIR_P ) " $ ( distdir ) / $ $ subdir " \ <nl> - | | exit 1 ; \ <nl> - distdir = ` $ ( am__cd ) $ ( distdir ) & & pwd ` ; \ <nl> - top_distdir = ` $ ( am__cd ) $ ( top_distdir ) & & pwd ` ; \ <nl> - ( cd $ $ subdir & & \ <nl> - $ ( MAKE ) $ ( AM_MAKEFLAGS ) \ <nl> - top_distdir = " $ $ top_distdir " \ <nl> - distdir = " $ $ distdir / $ $ subdir " \ <nl> - am__remove_distdir = : \ <nl> - am__skip_length_check = : \ <nl> - distdir ) \ <nl> - | | exit 1 ; \ <nl> - fi ; \ <nl> - done <nl> - check - am : all - am <nl> - check : check - recursive <nl> - all - am : Makefile <nl> - installdirs : installdirs - recursive <nl> - installdirs - am : <nl> - install : install - recursive <nl> - install - exec : install - exec - recursive <nl> - install - data : install - data - recursive <nl> - uninstall : uninstall - recursive <nl> - <nl> - install - am : all - am <nl> - @ $ ( MAKE ) $ ( AM_MAKEFLAGS ) install - exec - am install - data - am <nl> - <nl> - installcheck : installcheck - recursive <nl> - install - strip : <nl> - $ ( MAKE ) $ ( AM_MAKEFLAGS ) INSTALL_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " \ <nl> - install_sh_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " INSTALL_STRIP_FLAG = - s \ <nl> - ` test - z ' $ ( STRIP ) ' | | \ <nl> - echo " INSTALL_PROGRAM_ENV = STRIPPROG = ' $ ( STRIP ) ' " ` install <nl> - mostlyclean - generic : <nl> - <nl> - clean - generic : <nl> - <nl> - distclean - generic : <nl> - - test - z " $ ( CONFIG_CLEAN_FILES ) " | | rm - f $ ( CONFIG_CLEAN_FILES ) <nl> - <nl> - maintainer - clean - generic : <nl> - @ echo " This command is intended for maintainers to use " <nl> - @ echo " it deletes files that may require special tools to rebuild . " <nl> - clean : clean - recursive <nl> - <nl> - clean - am : clean - generic clean - libtool mostlyclean - am <nl> - <nl> - distclean : distclean - recursive <nl> - - rm - f Makefile <nl> - distclean - am : clean - am distclean - generic distclean - tags <nl> - <nl> - dvi : dvi - recursive <nl> - <nl> - dvi - am : <nl> - <nl> - html : html - recursive <nl> - <nl> - info : info - recursive <nl> - <nl> - info - am : <nl> - <nl> - install - data - am : <nl> - <nl> - install - dvi : install - dvi - recursive <nl> - <nl> - install - exec - am : <nl> - <nl> - install - html : install - html - recursive <nl> - <nl> - install - info : install - info - recursive <nl> - <nl> - install - man : <nl> - <nl> - install - pdf : install - pdf - recursive <nl> - <nl> - install - ps : install - ps - recursive <nl> - <nl> - installcheck - am : <nl> - <nl> - maintainer - clean : maintainer - clean - recursive <nl> - - rm - f Makefile <nl> - maintainer - clean - am : distclean - am maintainer - clean - generic <nl> - <nl> - mostlyclean : mostlyclean - recursive <nl> - <nl> - mostlyclean - am : mostlyclean - generic mostlyclean - libtool <nl> - <nl> - pdf : pdf - recursive <nl> - <nl> - pdf - am : <nl> - <nl> - ps : ps - recursive <nl> - <nl> - ps - am : <nl> - <nl> - uninstall - am : <nl> - <nl> - . MAKE : $ ( RECURSIVE_CLEAN_TARGETS ) $ ( RECURSIVE_TARGETS ) install - am \ <nl> - install - strip <nl> - <nl> - . PHONY : $ ( RECURSIVE_CLEAN_TARGETS ) $ ( RECURSIVE_TARGETS ) CTAGS GTAGS \ <nl> - all all - am check check - am clean clean - generic clean - libtool \ <nl> - ctags ctags - recursive distclean distclean - generic \ <nl> - distclean - libtool distclean - tags distdir dvi dvi - am html \ <nl> - html - am info info - am install install - am install - data \ <nl> - install - data - am install - dvi install - dvi - am install - exec \ <nl> - install - exec - am install - html install - html - am install - info \ <nl> - install - info - am install - man install - pdf install - pdf - am \ <nl> - install - ps install - ps - am install - strip installcheck \ <nl> - installcheck - am installdirs installdirs - am maintainer - clean \ <nl> - maintainer - clean - generic mostlyclean mostlyclean - generic \ <nl> - mostlyclean - libtool pdf pdf - am ps ps - am tags tags - recursive \ <nl> - uninstall uninstall - am <nl> - <nl> - # Tell versions [ 3 . 59 , 3 . 63 ) of GNU make to not export all variables . <nl> - # Otherwise a system limit ( for SysV at least ) may be exceeded . <nl> - . NOEXPORT : <nl> deleted file mode 100644 <nl> index 1115201dd09 . . 00000000000 <nl> mmm a / drivers / vorbis / books / coupled / Makefile . am <nl> ppp / dev / null <nl> <nl> - # # Process this file with automake to produce Makefile . in <nl> - <nl> - EXTRA_DIST = res_books_stereo . h res_books_51 . h <nl> deleted file mode 100644 <nl> index ec9d98ead20 . . 00000000000 <nl> mmm a / drivers / vorbis / books / coupled / Makefile . in <nl> ppp / dev / null <nl> <nl> - # Makefile . in generated by automake 1 . 10 . 2 from Makefile . am . <nl> - # @ configure_input @ <nl> - <nl> - # Copyright ( C ) 1994 , 1995 , 1996 , 1997 , 1998 , 1999 , 2000 , 2001 , 2002 , <nl> - # 2003 , 2004 , 2005 , 2006 , 2007 , 2008 Free Software Foundation , Inc . <nl> - # This Makefile . in is free software ; the Free Software Foundation <nl> - # gives unlimited permission to copy and / or distribute it , <nl> - # with or without modifications , as long as this notice is preserved . <nl> - <nl> - # This program is distributed in the hope that it will be useful , <nl> - # but WITHOUT ANY WARRANTY , to the extent permitted by law ; without <nl> - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A <nl> - # PARTICULAR PURPOSE . <nl> - <nl> - @ SET_MAKE @ <nl> - VPATH = @ srcdir @ <nl> - pkgdatadir = $ ( datadir ) / @ PACKAGE @ <nl> - pkglibdir = $ ( libdir ) / @ PACKAGE @ <nl> - pkgincludedir = $ ( includedir ) / @ PACKAGE @ <nl> - am__cd = CDPATH = " $ $ { ZSH_VERSION + . } $ ( PATH_SEPARATOR ) " & & cd <nl> - install_sh_DATA = $ ( install_sh ) - c - m 644 <nl> - install_sh_PROGRAM = $ ( install_sh ) - c <nl> - install_sh_SCRIPT = $ ( install_sh ) - c <nl> - INSTALL_HEADER = $ ( INSTALL_DATA ) <nl> - transform = $ ( program_transform_name ) <nl> - NORMAL_INSTALL = : <nl> - PRE_INSTALL = : <nl> - POST_INSTALL = : <nl> - NORMAL_UNINSTALL = : <nl> - PRE_UNINSTALL = : <nl> - POST_UNINSTALL = : <nl> - build_triplet = @ build @ <nl> - host_triplet = @ host @ <nl> - target_triplet = @ target @ <nl> - subdir = lib / books / coupled <nl> - DIST_COMMON = $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . in <nl> - ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> - am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / add_cflags . m4 \ <nl> - $ ( top_srcdir ) / m4 / ogg . m4 $ ( top_srcdir ) / m4 / pkg . m4 \ <nl> - $ ( top_srcdir ) / configure . ac <nl> - am__configure_deps = $ ( am__aclocal_m4_deps ) $ ( CONFIGURE_DEPENDENCIES ) \ <nl> - $ ( ACLOCAL_M4 ) <nl> - mkinstalldirs = $ ( install_sh ) - d <nl> - CONFIG_HEADER = $ ( top_builddir ) / config . h <nl> - CONFIG_CLEAN_FILES = <nl> - SOURCES = <nl> - DIST_SOURCES = <nl> - DISTFILES = $ ( DIST_COMMON ) $ ( DIST_SOURCES ) $ ( TEXINFOS ) $ ( EXTRA_DIST ) <nl> - ACLOCAL = @ ACLOCAL @ <nl> - ACLOCAL_AMFLAGS = @ ACLOCAL_AMFLAGS @ <nl> - ALLOCA = @ ALLOCA @ <nl> - AMTAR = @ AMTAR @ <nl> - AR = @ AR @ <nl> - AS = @ AS @ <nl> - AUTOCONF = @ AUTOCONF @ <nl> - AUTOHEADER = @ AUTOHEADER @ <nl> - AUTOMAKE = @ AUTOMAKE @ <nl> - AWK = @ AWK @ <nl> - CC = @ CC @ <nl> - CCDEPMODE = @ CCDEPMODE @ <nl> - CFLAGS = @ CFLAGS @ <nl> - CPP = @ CPP @ <nl> - CPPFLAGS = @ CPPFLAGS @ <nl> - CYGPATH_W = @ CYGPATH_W @ <nl> - DEBUG = @ DEBUG @ <nl> - DEFS = @ DEFS @ <nl> - DEPDIR = @ DEPDIR @ <nl> - DLLTOOL = @ DLLTOOL @ <nl> - DSYMUTIL = @ DSYMUTIL @ <nl> - DUMPBIN = @ DUMPBIN @ <nl> - ECHO_C = @ ECHO_C @ <nl> - ECHO_N = @ ECHO_N @ <nl> - ECHO_T = @ ECHO_T @ <nl> - EGREP = @ EGREP @ <nl> - EXEEXT = @ EXEEXT @ <nl> - FGREP = @ FGREP @ <nl> - GREP = @ GREP @ <nl> - HAVE_DOXYGEN = @ HAVE_DOXYGEN @ <nl> - HTLATEX = @ HTLATEX @ <nl> - INSTALL = @ INSTALL @ <nl> - INSTALL_DATA = @ INSTALL_DATA @ <nl> - INSTALL_PROGRAM = @ INSTALL_PROGRAM @ <nl> - INSTALL_SCRIPT = @ INSTALL_SCRIPT @ <nl> - INSTALL_STRIP_PROGRAM = @ INSTALL_STRIP_PROGRAM @ <nl> - LD = @ LD @ <nl> - LDFLAGS = @ LDFLAGS @ <nl> - LIBOBJS = @ LIBOBJS @ <nl> - LIBS = @ LIBS @ <nl> - LIBTOOL = @ LIBTOOL @ <nl> - LIBTOOL_DEPS = @ LIBTOOL_DEPS @ <nl> - LIPO = @ LIPO @ <nl> - LN_S = @ LN_S @ <nl> - LTLIBOBJS = @ LTLIBOBJS @ <nl> - MAINT = @ MAINT @ <nl> - MAKEINFO = @ MAKEINFO @ <nl> - MKDIR_P = @ MKDIR_P @ <nl> - NM = @ NM @ <nl> - NMEDIT = @ NMEDIT @ <nl> - OBJDUMP = @ OBJDUMP @ <nl> - OBJEXT = @ OBJEXT @ <nl> - OGG_CFLAGS = @ OGG_CFLAGS @ <nl> - OGG_LIBS = @ OGG_LIBS @ <nl> - OTOOL = @ OTOOL @ <nl> - OTOOL64 = @ OTOOL64 @ <nl> - PACKAGE = @ PACKAGE @ <nl> - PACKAGE_BUGREPORT = @ PACKAGE_BUGREPORT @ <nl> - PACKAGE_NAME = @ PACKAGE_NAME @ <nl> - PACKAGE_STRING = @ PACKAGE_STRING @ <nl> - PACKAGE_TARNAME = @ PACKAGE_TARNAME @ <nl> - PACKAGE_VERSION = @ PACKAGE_VERSION @ <nl> - PATH_SEPARATOR = @ PATH_SEPARATOR @ <nl> - PDFLATEX = @ PDFLATEX @ <nl> - PKG_CONFIG = @ PKG_CONFIG @ <nl> - PROFILE = @ PROFILE @ <nl> - RANLIB = @ RANLIB @ <nl> - SED = @ SED @ <nl> - SET_MAKE = @ SET_MAKE @ <nl> - SHELL = @ SHELL @ <nl> - STRIP = @ STRIP @ <nl> - VERSION = @ VERSION @ <nl> - VE_LIB_AGE = @ VE_LIB_AGE @ <nl> - VE_LIB_CURRENT = @ VE_LIB_CURRENT @ <nl> - VE_LIB_REVISION = @ VE_LIB_REVISION @ <nl> - VF_LIB_AGE = @ VF_LIB_AGE @ <nl> - VF_LIB_CURRENT = @ VF_LIB_CURRENT @ <nl> - VF_LIB_REVISION = @ VF_LIB_REVISION @ <nl> - VORBIS_LIBS = @ VORBIS_LIBS @ <nl> - V_LIB_AGE = @ V_LIB_AGE @ <nl> - V_LIB_CURRENT = @ V_LIB_CURRENT @ <nl> - V_LIB_REVISION = @ V_LIB_REVISION @ <nl> - abs_builddir = @ abs_builddir @ <nl> - abs_srcdir = @ abs_srcdir @ <nl> - abs_top_builddir = @ abs_top_builddir @ <nl> - abs_top_srcdir = @ abs_top_srcdir @ <nl> - ac_ct_CC = @ ac_ct_CC @ <nl> - ac_ct_DUMPBIN = @ ac_ct_DUMPBIN @ <nl> - am__include = @ am__include @ <nl> - am__leading_dot = @ am__leading_dot @ <nl> - am__quote = @ am__quote @ <nl> - am__tar = @ am__tar @ <nl> - am__untar = @ am__untar @ <nl> - bindir = @ bindir @ <nl> - build = @ build @ <nl> - build_alias = @ build_alias @ <nl> - build_cpu = @ build_cpu @ <nl> - build_os = @ build_os @ <nl> - build_vendor = @ build_vendor @ <nl> - builddir = @ builddir @ <nl> - datadir = @ datadir @ <nl> - datarootdir = @ datarootdir @ <nl> - docdir = @ docdir @ <nl> - dvidir = @ dvidir @ <nl> - exec_prefix = @ exec_prefix @ <nl> - host = @ host @ <nl> - host_alias = @ host_alias @ <nl> - host_cpu = @ host_cpu @ <nl> - host_os = @ host_os @ <nl> - host_vendor = @ host_vendor @ <nl> - htmldir = @ htmldir @ <nl> - includedir = @ includedir @ <nl> - infodir = @ infodir @ <nl> - install_sh = @ install_sh @ <nl> - libdir = @ libdir @ <nl> - libexecdir = @ libexecdir @ <nl> - localedir = @ localedir @ <nl> - localstatedir = @ localstatedir @ <nl> - lt_ECHO = @ lt_ECHO @ <nl> - mandir = @ mandir @ <nl> - mkdir_p = @ mkdir_p @ <nl> - oldincludedir = @ oldincludedir @ <nl> - pdfdir = @ pdfdir @ <nl> - prefix = @ prefix @ <nl> - program_transform_name = @ program_transform_name @ <nl> - psdir = @ psdir @ <nl> - pthread_lib = @ pthread_lib @ <nl> - sbindir = @ sbindir @ <nl> - sharedstatedir = @ sharedstatedir @ <nl> - srcdir = @ srcdir @ <nl> - sysconfdir = @ sysconfdir @ <nl> - target = @ target @ <nl> - target_alias = @ target_alias @ <nl> - target_cpu = @ target_cpu @ <nl> - target_os = @ target_os @ <nl> - target_vendor = @ target_vendor @ <nl> - top_builddir = @ top_builddir @ <nl> - top_srcdir = @ top_srcdir @ <nl> - EXTRA_DIST = res_books_stereo . h res_books_51 . h <nl> - all : all - am <nl> - <nl> - . SUFFIXES : <nl> - $ ( srcdir ) / Makefile . in : @ MAINTAINER_MODE_TRUE @ $ ( srcdir ) / Makefile . am $ ( am__configure_deps ) <nl> - @ for dep in $ ? ; do \ <nl> - case ' $ ( am__configure_deps ) ' in \ <nl> - * $ $ dep * ) \ <nl> - ( cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ) \ <nl> - & & { if test - f $ @ ; then exit 0 ; else break ; fi ; } ; \ <nl> - exit 1 ; ; \ <nl> - esac ; \ <nl> - done ; \ <nl> - echo ' cd $ ( top_srcdir ) & & $ ( AUTOMAKE ) - - gnu lib / books / coupled / Makefile ' ; \ <nl> - cd $ ( top_srcdir ) & & \ <nl> - $ ( AUTOMAKE ) - - gnu lib / books / coupled / Makefile <nl> - . PRECIOUS : Makefile <nl> - Makefile : $ ( srcdir ) / Makefile . in $ ( top_builddir ) / config . status <nl> - @ case ' $ ? ' in \ <nl> - * config . status * ) \ <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ; ; \ <nl> - * ) \ <nl> - echo ' cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ' ; \ <nl> - cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ; ; \ <nl> - esac ; <nl> - <nl> - $ ( top_builddir ) / config . status : $ ( top_srcdir ) / configure $ ( CONFIG_STATUS_DEPENDENCIES ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - $ ( top_srcdir ) / configure : @ MAINTAINER_MODE_TRUE @ $ ( am__configure_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - $ ( ACLOCAL_M4 ) : @ MAINTAINER_MODE_TRUE @ $ ( am__aclocal_m4_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - mostlyclean - libtool : <nl> - - rm - f * . lo <nl> - <nl> - clean - libtool : <nl> - - rm - rf . libs _libs <nl> - tags : TAGS <nl> - TAGS : <nl> - <nl> - ctags : CTAGS <nl> - CTAGS : <nl> - <nl> - <nl> - distdir : $ ( DISTFILES ) <nl> - @ srcdirstrip = ` echo " $ ( srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - topsrcdirstrip = ` echo " $ ( top_srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - list = ' $ ( DISTFILES ) ' ; \ <nl> - dist_files = ` for file in $ $ list ; do echo $ $ file ; done | \ <nl> - sed - e " s | ^ $ $ srcdirstrip / | | ; t " \ <nl> - - e " s | ^ $ $ topsrcdirstrip / | $ ( top_builddir ) / | ; t " ` ; \ <nl> - case $ $ dist_files in \ <nl> - * / * ) $ ( MKDIR_P ) ` echo " $ $ dist_files " | \ <nl> - sed ' / \ / / ! d ; s | ^ | $ ( distdir ) / | ; s , / [ ^ / ] * $ $ , , ' | \ <nl> - sort - u ` ; ; \ <nl> - esac ; \ <nl> - for file in $ $ dist_files ; do \ <nl> - if test - f $ $ file | | test - d $ $ file ; then d = . ; else d = $ ( srcdir ) ; fi ; \ <nl> - if test - d $ $ d / $ $ file ; then \ <nl> - dir = ` echo " / $ $ file " | sed - e ' s , / [ ^ / ] * $ $ , , ' ` ; \ <nl> - if test - d $ ( srcdir ) / $ $ file & & test $ $ d ! = $ ( srcdir ) ; then \ <nl> - cp - pR $ ( srcdir ) / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - fi ; \ <nl> - cp - pR $ $ d / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - else \ <nl> - test - f $ ( distdir ) / $ $ file \ <nl> - | | cp - p $ $ d / $ $ file $ ( distdir ) / $ $ file \ <nl> - | | exit 1 ; \ <nl> - fi ; \ <nl> - done <nl> - check - am : all - am <nl> - check : check - am <nl> - all - am : Makefile <nl> - installdirs : <nl> - install : install - am <nl> - install - exec : install - exec - am <nl> - install - data : install - data - am <nl> - uninstall : uninstall - am <nl> - <nl> - install - am : all - am <nl> - @ $ ( MAKE ) $ ( AM_MAKEFLAGS ) install - exec - am install - data - am <nl> - <nl> - installcheck : installcheck - am <nl> - install - strip : <nl> - $ ( MAKE ) $ ( AM_MAKEFLAGS ) INSTALL_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " \ <nl> - install_sh_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " INSTALL_STRIP_FLAG = - s \ <nl> - ` test - z ' $ ( STRIP ) ' | | \ <nl> - echo " INSTALL_PROGRAM_ENV = STRIPPROG = ' $ ( STRIP ) ' " ` install <nl> - mostlyclean - generic : <nl> - <nl> - clean - generic : <nl> - <nl> - distclean - generic : <nl> - - test - z " $ ( CONFIG_CLEAN_FILES ) " | | rm - f $ ( CONFIG_CLEAN_FILES ) <nl> - <nl> - maintainer - clean - generic : <nl> - @ echo " This command is intended for maintainers to use " <nl> - @ echo " it deletes files that may require special tools to rebuild . " <nl> - clean : clean - am <nl> - <nl> - clean - am : clean - generic clean - libtool mostlyclean - am <nl> - <nl> - distclean : distclean - am <nl> - - rm - f Makefile <nl> - distclean - am : clean - am distclean - generic <nl> - <nl> - dvi : dvi - am <nl> - <nl> - dvi - am : <nl> - <nl> - html : html - am <nl> - <nl> - info : info - am <nl> - <nl> - info - am : <nl> - <nl> - install - data - am : <nl> - <nl> - install - dvi : install - dvi - am <nl> - <nl> - install - exec - am : <nl> - <nl> - install - html : install - html - am <nl> - <nl> - install - info : install - info - am <nl> - <nl> - install - man : <nl> - <nl> - install - pdf : install - pdf - am <nl> - <nl> - install - ps : install - ps - am <nl> - <nl> - installcheck - am : <nl> - <nl> - maintainer - clean : maintainer - clean - am <nl> - - rm - f Makefile <nl> - maintainer - clean - am : distclean - am maintainer - clean - generic <nl> - <nl> - mostlyclean : mostlyclean - am <nl> - <nl> - mostlyclean - am : mostlyclean - generic mostlyclean - libtool <nl> - <nl> - pdf : pdf - am <nl> - <nl> - pdf - am : <nl> - <nl> - ps : ps - am <nl> - <nl> - ps - am : <nl> - <nl> - uninstall - am : <nl> - <nl> - . MAKE : install - am install - strip <nl> - <nl> - . PHONY : all all - am check check - am clean clean - generic clean - libtool \ <nl> - distclean distclean - generic distclean - libtool distdir dvi \ <nl> - dvi - am html html - am info info - am install install - am \ <nl> - install - data install - data - am install - dvi install - dvi - am \ <nl> - install - exec install - exec - am install - html install - html - am \ <nl> - install - info install - info - am install - man install - pdf \ <nl> - install - pdf - am install - ps install - ps - am install - strip \ <nl> - installcheck installcheck - am installdirs maintainer - clean \ <nl> - maintainer - clean - generic mostlyclean mostlyclean - generic \ <nl> - mostlyclean - libtool pdf pdf - am ps ps - am uninstall uninstall - am <nl> - <nl> - # Tell versions [ 3 . 59 , 3 . 63 ) of GNU make to not export all variables . <nl> - # Otherwise a system limit ( for SysV at least ) may be exceeded . <nl> - . NOEXPORT : <nl> mmm a / drivers / vorbis / books / coupled / res_books_51 . h <nl> ppp b / drivers / vorbis / books / coupled / res_books_51 . h <nl> <nl> + / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + * * <nl> + * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE . * <nl> + * USE , DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * <nl> + * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> + * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> + * * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2010 * <nl> + * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> + * * <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> + * <nl> + * function : static codebooks for 5 . 1 surround <nl> + * last modified : $ Id : res_books_51 . h 19057 2014 - 01 - 22 12 : 32 : 31Z xiphmont $ <nl> + * <nl> + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + <nl> static const long _vq_quantlist__44p0_l0_0 [ ] = { <nl> 6 , <nl> 5 , <nl> static const long _vq_quantlist__44p0_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_l0_0 [ ] = { <nl> 1 , 3 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 10 , 10 , 10 , 5 , 6 , 5 , <nl> 8 , 7 , 9 , 8 , 9 , 9 , 10 , 9 , 11 , 10 , 5 , 5 , 7 , 7 , 8 , 8 , <nl> 9 , 9 , 9 , 9 , 10 , 10 , 11 , 8 , 9 , 8 , 10 , 9 , 10 , 9 , 10 , 9 , <nl> static const long _vq_lengthlist__44p0_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p0_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p0_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p0_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p0_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p0_l0_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 5 , 5 , 5 , 7 , 5 , 5 , 5 , 5 , 6 , 7 , 7 , <nl> 6 , 7 , 7 , 7 , 6 , 7 , 7 , 7 , 7 , <nl> } ; <nl> <nl> static const static_codebook _44p0_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p0_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p0_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p0_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p0_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p0_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p0_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p0_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p0_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p0_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p0_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p0_lfe , <nl> + ( char * ) _huff_lengthlist__44p0_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p0_long [ ] = { <nl> + static const char _huff_lengthlist__44p0_long [ ] = { <nl> 2 , 3 , 6 , 7 , 10 , 14 , 16 , 3 , 2 , 5 , 7 , 11 , 14 , 17 , 6 , 5 , <nl> 5 , 7 , 10 , 12 , 14 , 7 , 7 , 6 , 6 , 7 , 9 , 13 , 10 , 11 , 9 , 6 , <nl> 6 , 9 , 11 , 15 , 15 , 13 , 10 , 9 , 10 , 12 , 18 , 18 , 16 , 14 , 12 , 13 , <nl> static const long _huff_lengthlist__44p0_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p0_long = { <nl> 2 , 49 , <nl> - ( long * ) _huff_lengthlist__44p0_long , <nl> + ( char * ) _huff_lengthlist__44p0_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p0_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p1_0 [ ] = { <nl> 1 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p0_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p0_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p0_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p2_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , 8 , 8 , 0 , 6 , 6 , 0 , 11 , <nl> 11 , 0 , 12 , 12 , 0 , 12 , 12 , 0 , 15 , 15 , 0 , 11 , 11 , 0 , 12 , 12 , <nl> static const long _vq_lengthlist__44p0_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p0_p2_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p0_p2_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p2_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p2_1 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p2_1 [ ] = { <nl> 1 , 3 , 3 , 0 , 9 , 9 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , 9 , 9 , 0 , <nl> 10 , 10 , 0 , 10 , 10 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , 7 , 7 , 0 , 7 , <nl> 7 , 0 , 6 , 6 , 0 , 8 , 8 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 8 , 9 , <nl> static const long _vq_lengthlist__44p0_p2_1 [ ] = { <nl> <nl> static const static_codebook _44p0_p2_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p2_1 , <nl> + ( char * ) _vq_lengthlist__44p0_p2_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p2_1 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p3_0 [ ] = { <nl> 1 , 6 , 6 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 9 , 9 , 10 , 12 , 11 , 9 , <nl> 8 , 8 , 7 , 9 , 9 , 11 , 12 , 12 , 9 , 9 , 9 , 6 , 7 , 7 , 10 , 11 , <nl> 11 , 10 , 11 , 11 , 10 , 11 , 11 , 13 , 13 , 14 , 12 , 12 , 12 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44p0_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p0_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p0_p3_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p3_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p3_1 [ ] = { <nl> 2 , 4 , 4 , 8 , 8 , 10 , 12 , 12 , 11 , 11 , 9 , 11 , 11 , 12 , 13 , 11 , <nl> 12 , 12 , 11 , 11 , 11 , 12 , 12 , 12 , 12 , 10 , 13 , 12 , 13 , 13 , 11 , 12 , <nl> 12 , 13 , 13 , 11 , 12 , 12 , 13 , 13 , 11 , 12 , 13 , 13 , 13 , 11 , 13 , 13 , <nl> static const long _vq_lengthlist__44p0_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p0_p3_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p0_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p0_p3_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p4_0 [ ] = { <nl> 2 , 6 , 6 , 14 , 14 , 6 , 8 , 8 , 14 , 14 , 7 , 7 , 7 , 14 , 14 , 0 , <nl> 13 , 13 , 15 , 16 , 0 , 13 , 13 , 15 , 15 , 7 , 8 , 8 , 15 , 15 , 9 , 10 , <nl> 10 , 16 , 16 , 9 , 8 , 8 , 14 , 15 , 0 , 13 , 13 , 17 , 17 , 0 , 13 , 13 , <nl> static const long _vq_lengthlist__44p0_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p0_p4_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p0_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p0_p4_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p4_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p4_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p0_p4_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p0_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p0_p4_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p5_0 [ ] = { <nl> 1 , 6 , 6 , 6 , 8 , 8 , 7 , 8 , 8 , 7 , 9 , 8 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 7 , 8 , 8 , 11 , 11 , 11 , 9 , 8 , 8 , 6 , 7 , 7 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 14 , 13 , 13 , 12 , 11 , 11 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44p0_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p0_p5_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p0_p5_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p5_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p5_1 [ ] = { <nl> 2 , 7 , 7 , 7 , 8 , 8 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 7 , 7 , 6 , 6 , 6 , 9 , 7 , <nl> 7 , 9 , 7 , 7 , 9 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , <nl> static const long _vq_lengthlist__44p0_p5_1 [ ] = { <nl> <nl> static const static_codebook _44p0_p5_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p0_p5_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p6_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 8 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p0_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p0_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p0_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p0_p6_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p6_1 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p6_1 [ ] = { <nl> 1 , 3 , 2 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 12 , 12 , 12 , 14 , 14 , 14 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p0_p6_1 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p0_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p0_p6_1 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p0_p6_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p0_p6_2 [ ] = { <nl> + static const char _vq_lengthlist__44p0_p6_2 [ ] = { <nl> 3 , 4 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p0_p6_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p0_p6_2 , <nl> + ( char * ) _vq_lengthlist__44p0_p6_2 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p0_p6_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p0_short [ ] = { <nl> + static const char _huff_lengthlist__44p0_short [ ] = { <nl> 3 , 3 , 7 , 8 , 10 , 13 , 16 , 3 , 2 , 5 , 7 , 9 , 13 , 16 , 6 , 4 , <nl> 4 , 6 , 10 , 14 , 15 , 7 , 5 , 5 , 7 , 10 , 13 , 14 , 9 , 8 , 9 , 9 , <nl> 9 , 11 , 13 , 12 , 11 , 12 , 9 , 7 , 8 , 11 , 14 , 12 , 10 , 6 , 5 , 7 , <nl> static const long _huff_lengthlist__44p0_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p0_short = { <nl> 2 , 49 , <nl> - ( long * ) _huff_lengthlist__44p0_short , <nl> + ( char * ) _huff_lengthlist__44p0_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p1_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_l0_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 4 , 6 , 5 , <nl> 8 , 6 , 9 , 8 , 10 , 9 , 10 , 10 , 11 , 10 , 5 , 5 , 6 , 6 , 8 , 8 , <nl> 9 , 9 , 10 , 10 , 10 , 10 , 11 , 7 , 8 , 8 , 9 , 8 , 10 , 9 , 10 , 9 , <nl> static const long _vq_lengthlist__44p1_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p1_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p1_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p1_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p1_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p1_l0_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 5 , 5 , 5 , 6 , 6 , 5 , 6 , 5 , 6 , 6 , 6 , <nl> 6 , 7 , 7 , 7 , 6 , 7 , 6 , 7 , 7 , <nl> } ; <nl> <nl> static const static_codebook _44p1_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p1_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p1_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p1_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p1_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p1_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p1_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p1_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p1_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p1_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p1_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p1_lfe , <nl> + ( char * ) _huff_lengthlist__44p1_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p1_long [ ] = { <nl> + static const char _huff_lengthlist__44p1_long [ ] = { <nl> 3 , 3 , 7 , 7 , 9 , 13 , 16 , 3 , 2 , 4 , 6 , 10 , 13 , 17 , 7 , 4 , <nl> 4 , 6 , 9 , 12 , 14 , 7 , 6 , 6 , 5 , 7 , 9 , 12 , 10 , 10 , 9 , 6 , <nl> 6 , 9 , 12 , 14 , 14 , 13 , 9 , 8 , 10 , 11 , 18 , 18 , 15 , 13 , 11 , 10 , <nl> static const long _huff_lengthlist__44p1_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p1_long = { <nl> 2 , 49 , <nl> - ( long * ) _huff_lengthlist__44p1_long , <nl> + ( char * ) _huff_lengthlist__44p1_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p1_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p1_0 [ ] = { <nl> 1 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p1_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p1_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p1_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p2_0 [ ] = { <nl> 1 , 4 , 4 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , 8 , 8 , 0 , 6 , 6 , 0 , 11 , <nl> 11 , 0 , 11 , 11 , 0 , 12 , 12 , 0 , 14 , 14 , 0 , 11 , 11 , 0 , 12 , 12 , <nl> static const long _vq_lengthlist__44p1_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p1_p2_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p1_p2_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p2_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p2_1 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p2_1 [ ] = { <nl> 1 , 3 , 3 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 10 , 10 , 0 , 9 , 9 , 0 , <nl> 10 , 10 , 0 , 10 , 10 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , 7 , 7 , 0 , 7 , <nl> 7 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 9 , 9 , <nl> static const long _vq_lengthlist__44p1_p2_1 [ ] = { <nl> <nl> static const static_codebook _44p1_p2_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p2_1 , <nl> + ( char * ) _vq_lengthlist__44p1_p2_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p2_1 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p3_0 [ ] = { <nl> 1 , 6 , 6 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 7 , 9 , 9 , 11 , 12 , 12 , 9 , 8 , 8 , 6 , 7 , 7 , 9 , 11 , <nl> 11 , 10 , 11 , 11 , 10 , 11 , 11 , 13 , 13 , 13 , 11 , 12 , 12 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p1_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p1_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p1_p3_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p3_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p3_1 [ ] = { <nl> 2 , 3 , 4 , 7 , 7 , 10 , 12 , 12 , 12 , 12 , 10 , 11 , 11 , 13 , 13 , 11 , <nl> 12 , 12 , 11 , 11 , 12 , 12 , 12 , 12 , 12 , 11 , 13 , 13 , 13 , 13 , 12 , 12 , <nl> 12 , 13 , 14 , 12 , 13 , 13 , 13 , 13 , 12 , 13 , 13 , 13 , 13 , 12 , 13 , 13 , <nl> static const long _vq_lengthlist__44p1_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p1_p3_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p1_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p1_p3_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p4_0 [ ] = { <nl> 2 , 6 , 6 , 14 , 14 , 6 , 7 , 7 , 14 , 14 , 7 , 7 , 7 , 14 , 14 , 0 , <nl> 13 , 13 , 16 , 16 , 0 , 13 , 13 , 15 , 14 , 7 , 8 , 8 , 15 , 15 , 9 , 10 , <nl> 10 , 16 , 16 , 9 , 8 , 8 , 15 , 15 , 0 , 13 , 13 , 17 , 16 , 0 , 13 , 13 , <nl> static const long _vq_lengthlist__44p1_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p1_p4_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p1_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p1_p4_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p4_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p4_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p1_p4_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p1_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p1_p4_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p5_0 [ ] = { <nl> 1 , 6 , 6 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 9 , 8 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 7 , 8 , 8 , 11 , 11 , 11 , 9 , 8 , 8 , 6 , 7 , 7 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 14 , 13 , 13 , 12 , 11 , 11 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44p1_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p1_p5_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p1_p5_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p5_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p5_1 [ ] = { <nl> 2 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 8 , 8 , 8 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 8 , 8 , 9 , 7 , 7 , 6 , 6 , 6 , 9 , 8 , <nl> 7 , 9 , 7 , 7 , 9 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , <nl> static const long _vq_lengthlist__44p1_p5_1 [ ] = { <nl> <nl> static const static_codebook _44p1_p5_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p1_p5_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p6_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 8 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p1_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p1_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p1_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p1_p6_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p6_1 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p6_1 [ ] = { <nl> 1 , 3 , 2 , 5 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 13 , 14 , 16 , 16 , 16 , 16 , <nl> } ; <nl> <nl> static const static_codebook _44p1_p6_1 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p1_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p1_p6_1 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p1_p6_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p1_p6_2 [ ] = { <nl> + static const char _vq_lengthlist__44p1_p6_2 [ ] = { <nl> 3 , 4 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p1_p6_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p1_p6_2 , <nl> + ( char * ) _vq_lengthlist__44p1_p6_2 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p1_p6_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p1_short [ ] = { <nl> + static const char _huff_lengthlist__44p1_short [ ] = { <nl> 4 , 5 , 7 , 8 , 10 , 13 , 14 , 4 , 2 , 4 , 6 , 8 , 11 , 12 , 7 , 4 , <nl> 3 , 5 , 8 , 12 , 14 , 8 , 5 , 4 , 4 , 8 , 12 , 12 , 9 , 7 , 7 , 7 , <nl> 9 , 10 , 11 , 13 , 11 , 11 , 9 , 7 , 8 , 10 , 13 , 11 , 10 , 6 , 5 , 7 , <nl> static const long _huff_lengthlist__44p1_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p1_short = { <nl> 2 , 49 , <nl> - ( long * ) _huff_lengthlist__44p1_short , <nl> + ( char * ) _huff_lengthlist__44p1_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p2_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_l0_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 4 , 6 , 5 , <nl> 8 , 7 , 9 , 8 , 10 , 9 , 11 , 10 , 11 , 11 , 4 , 5 , 6 , 7 , 8 , 8 , <nl> 9 , 9 , 10 , 10 , 10 , 10 , 11 , 8 , 9 , 8 , 10 , 8 , 10 , 9 , 11 , 10 , <nl> static const long _vq_lengthlist__44p2_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p2_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p2_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p2_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p2_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p2_l0_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 6 , 5 , 4 , 5 , 5 , 5 , 6 , 5 , <nl> 5 , 6 , 6 , 6 , 5 , 6 , 5 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44p2_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p2_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p2_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p2_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p2_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p2_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p2_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p2_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p2_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p2_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p2_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p2_lfe , <nl> + ( char * ) _huff_lengthlist__44p2_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p2_long [ ] = { <nl> + static const char _huff_lengthlist__44p2_long [ ] = { <nl> 3 , 4 , 9 , 8 , 8 , 10 , 13 , 16 , 4 , 2 , 9 , 5 , 7 , 10 , 14 , 18 , <nl> 9 , 7 , 6 , 5 , 7 , 9 , 12 , 16 , 7 , 5 , 5 , 3 , 5 , 8 , 11 , 13 , <nl> 8 , 7 , 7 , 5 , 5 , 7 , 9 , 11 , 10 , 10 , 9 , 8 , 6 , 6 , 8 , 10 , <nl> static const long _huff_lengthlist__44p2_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p2_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p2_long , <nl> + ( char * ) _huff_lengthlist__44p2_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p2_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p1_0 [ ] = { <nl> 1 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p2_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p2_0 [ ] = { <nl> 1 , 4 , 4 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , <nl> 10 , 10 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 10 , 10 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , 11 , 11 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p2_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p2_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p3_0 [ ] = { <nl> 1 , 5 , 5 , 6 , 7 , 7 , 0 , 8 , 8 , 6 , 9 , 9 , 8 , 11 , 11 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , 8 , 8 , 5 , 7 , 7 , 7 , 10 , <nl> 10 , 0 , 12 , 12 , 8 , 11 , 11 , 9 , 12 , 12 , 0 , 11 , 12 , 0 , 12 , 12 , <nl> static const long _vq_lengthlist__44p2_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p3_1 [ ] = { <nl> 2 , 3 , 3 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 9 , 9 , 0 , 9 , 9 , 0 , <nl> 9 , 9 , 0 , 9 , 9 , 0 , 9 , 9 , 0 , 8 , 8 , 0 , 6 , 6 , 0 , 7 , <nl> 7 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , <nl> static const long _vq_lengthlist__44p2_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p2_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p2_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p4_0 [ ] = { <nl> 1 , 6 , 6 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 7 , 8 , 8 , 11 , 11 , 11 , 9 , 8 , 8 , 6 , 7 , 7 , 9 , 11 , <nl> 11 , 9 , 11 , 11 , 10 , 11 , 11 , 12 , 13 , 13 , 11 , 12 , 12 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p2_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p4_1 [ ] = { <nl> 3 , 4 , 4 , 8 , 8 , 11 , 9 , 9 , 12 , 12 , 11 , 10 , 10 , 12 , 12 , 12 , <nl> 10 , 10 , 11 , 11 , 12 , 12 , 12 , 12 , 12 , 12 , 11 , 11 , 13 , 13 , 12 , 12 , <nl> 12 , 13 , 13 , 12 , 10 , 10 , 12 , 12 , 12 , 11 , 11 , 13 , 13 , 12 , 13 , 13 , <nl> static const long _vq_lengthlist__44p2_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p2_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p2_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p2_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p5_0 [ ] = { <nl> 2 , 6 , 6 , 14 , 14 , 6 , 7 , 7 , 14 , 14 , 7 , 7 , 7 , 15 , 15 , 0 , <nl> 13 , 13 , 16 , 16 , 0 , 13 , 13 , 15 , 15 , 7 , 8 , 8 , 15 , 15 , 9 , 10 , <nl> 10 , 17 , 16 , 9 , 8 , 8 , 15 , 15 , 0 , 13 , 13 , 18 , 17 , 0 , 13 , 13 , <nl> static const long _vq_lengthlist__44p2_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p2_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p2_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p2_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p2_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p6_0 [ ] = { <nl> 1 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 9 , 9 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 7 , 8 , 9 , 11 , 11 , 11 , 9 , 8 , 8 , 6 , 7 , 7 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 14 , 14 , 14 , 12 , 11 , 11 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p2_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p6_1 [ ] = { <nl> 2 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 8 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 8 , 8 , 6 , 7 , 7 , 9 , 8 , <nl> 8 , 9 , 7 , 7 , 9 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , <nl> static const long _vq_lengthlist__44p2_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p2_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p2_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p2_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p2_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p2_p7_0 , <nl> 1 , - 513979392 , 1633504256 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p7_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p7_1 [ ] = { <nl> 1 , 9 , 9 , 6 , 9 , 9 , 5 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p2_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p2_p7_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p2_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p2_p7_1 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p7_2 [ ] = { <nl> 1 , 3 , 2 , 5 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p2_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p2_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p2_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p2_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p2_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p2_p7_3 [ ] = { <nl> 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p2_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p2_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p2_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p2_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p2_short [ ] = { <nl> + static const char _huff_lengthlist__44p2_short [ ] = { <nl> 4 , 4 , 12 , 9 , 8 , 12 , 15 , 17 , 4 , 2 , 11 , 6 , 5 , 9 , 13 , 15 , <nl> 11 , 7 , 8 , 7 , 7 , 10 , 14 , 13 , 8 , 5 , 7 , 5 , 5 , 8 , 12 , 12 , <nl> 8 , 4 , 7 , 4 , 3 , 6 , 11 , 12 , 11 , 8 , 9 , 7 , 6 , 8 , 11 , 12 , <nl> static const long _huff_lengthlist__44p2_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p2_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p2_short , <nl> + ( char * ) _huff_lengthlist__44p2_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p3_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_l0_0 [ ] = { <nl> 1 , 4 , 4 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 10 , 10 , 4 , 6 , 5 , <nl> 8 , 7 , 9 , 9 , 9 , 9 , 10 , 9 , 11 , 9 , 4 , 5 , 6 , 7 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 10 , 9 , 10 , 8 , 9 , 8 , 9 , 8 , 10 , 9 , 11 , 9 , <nl> static const long _vq_lengthlist__44p3_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p3_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p3_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p3_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p3_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p3_l0_1 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , <nl> 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p3_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p3_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p3_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p3_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p3_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p3_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p3_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p3_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p3_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p3_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p3_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p3_lfe , <nl> + ( char * ) _huff_lengthlist__44p3_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p3_long [ ] = { <nl> + static const char _huff_lengthlist__44p3_long [ ] = { <nl> 3 , 4 , 13 , 9 , 9 , 12 , 15 , 17 , 4 , 2 , 18 , 5 , 7 , 10 , 14 , 18 , <nl> 11 , 8 , 6 , 5 , 6 , 8 , 11 , 14 , 8 , 5 , 5 , 3 , 5 , 8 , 11 , 13 , <nl> 9 , 6 , 7 , 5 , 5 , 7 , 9 , 10 , 11 , 10 , 9 , 8 , 6 , 6 , 8 , 10 , <nl> static const long _huff_lengthlist__44p3_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p3_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p3_long , <nl> + ( char * ) _huff_lengthlist__44p3_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p3_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p1_0 [ ] = { <nl> 1 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p3_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p2_0 [ ] = { <nl> 3 , 7 , 7 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , <nl> 11 , 11 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 10 , 9 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , 10 , 11 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p3_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p3_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p3_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 8 , 8 , 0 , 8 , 8 , 6 , 9 , 9 , 8 , 10 , 10 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , 8 , 8 , 4 , 7 , 7 , 6 , 10 , <nl> 10 , 0 , 12 , 12 , 7 , 11 , 11 , 9 , 12 , 12 , 0 , 12 , 12 , 0 , 13 , 13 , <nl> static const long _vq_lengthlist__44p3_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p3_1 [ ] = { <nl> 3 , 4 , 4 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , 8 , 8 , 0 , 7 , 7 , 0 , 8 , <nl> 8 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , <nl> static const long _vq_lengthlist__44p3_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p3_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p3_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p4_0 [ ] = { <nl> 1 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 8 , 8 , 8 , 11 , 11 , 11 , 10 , 8 , 8 , 5 , 7 , 7 , 9 , 11 , <nl> 11 , 10 , 11 , 11 , 10 , 11 , 11 , 12 , 13 , 14 , 11 , 12 , 12 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p3_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p4_1 [ ] = { <nl> 3 , 4 , 5 , 8 , 8 , 12 , 10 , 10 , 12 , 12 , 12 , 10 , 10 , 12 , 12 , 13 , <nl> 11 , 11 , 12 , 12 , 13 , 12 , 12 , 12 , 12 , 13 , 10 , 10 , 13 , 13 , 13 , 13 , <nl> 13 , 13 , 13 , 13 , 10 , 10 , 13 , 13 , 13 , 11 , 11 , 13 , 13 , 14 , 13 , 13 , <nl> static const long _vq_lengthlist__44p3_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p3_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p3_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p3_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p5_0 [ ] = { <nl> 2 , 6 , 6 , 14 , 14 , 6 , 7 , 7 , 14 , 14 , 7 , 7 , 7 , 15 , 15 , 0 , <nl> 12 , 12 , 15 , 15 , 0 , 13 , 13 , 15 , 15 , 7 , 8 , 8 , 15 , 15 , 10 , 10 , <nl> 10 , 16 , 16 , 9 , 8 , 8 , 15 , 15 , 0 , 13 , 13 , 18 , 17 , 0 , 13 , 13 , <nl> static const long _vq_lengthlist__44p3_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p3_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p3_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p3_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p3_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p6_0 [ ] = { <nl> 1 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 7 , 9 , 9 , 11 , 11 , 11 , 9 , <nl> 8 , 8 , 8 , 9 , 9 , 12 , 11 , 11 , 9 , 8 , 8 , 6 , 7 , 7 , 10 , 11 , <nl> 10 , 10 , 10 , 10 , 11 , 11 , 10 , 14 , 13 , 14 , 12 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44p3_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p6_1 [ ] = { <nl> 2 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 7 , 8 , 6 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 9 , 8 , 8 , 10 , 9 , 9 , 10 , 8 , 8 , 10 , 8 , 8 , <nl> static const long _vq_lengthlist__44p3_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p3_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p3_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p3_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p3_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p3_p7_0 , <nl> 1 , - 513979392 , 1633504256 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p7_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p7_1 [ ] = { <nl> 1 , 9 , 9 , 6 , 9 , 9 , 5 , 9 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p3_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p3_p7_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p3_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p3_p7_1 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p7_2 [ ] = { <nl> 1 , 3 , 2 , 5 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p3_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p3_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p3_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p3_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p3_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p3_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p3_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p3_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p3_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p3_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p3_short [ ] = { <nl> + static const char _huff_lengthlist__44p3_short [ ] = { <nl> 4 , 5 , 16 , 9 , 9 , 12 , 17 , 18 , 4 , 2 , 18 , 6 , 5 , 9 , 13 , 15 , <nl> 10 , 7 , 7 , 6 , 7 , 9 , 13 , 13 , 8 , 5 , 6 , 5 , 5 , 7 , 11 , 12 , <nl> 8 , 4 , 7 , 4 , 3 , 6 , 10 , 12 , 11 , 8 , 9 , 7 , 6 , 8 , 11 , 12 , <nl> static const long _huff_lengthlist__44p3_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p3_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p3_short , <nl> + ( char * ) _huff_lengthlist__44p3_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p4_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_l0_0 [ ] = { <nl> 1 , 4 , 4 , 8 , 8 , 9 , 8 , 9 , 9 , 10 , 10 , 10 , 10 , 4 , 6 , 5 , <nl> 8 , 7 , 9 , 9 , 9 , 9 , 10 , 9 , 10 , 10 , 4 , 5 , 6 , 7 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 10 , 9 , 10 , 8 , 9 , 8 , 9 , 8 , 10 , 9 , 11 , 9 , <nl> static const long _vq_lengthlist__44p4_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p4_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p4_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p4_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p4_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p4_l0_1 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , <nl> 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p4_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p4_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p4_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p4_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p4_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p4_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p4_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p4_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p4_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p4_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p4_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p4_lfe , <nl> + ( char * ) _huff_lengthlist__44p4_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p4_long [ ] = { <nl> + static const char _huff_lengthlist__44p4_long [ ] = { <nl> 3 , 5 , 13 , 9 , 9 , 12 , 16 , 18 , 4 , 2 , 20 , 6 , 7 , 10 , 15 , 20 , <nl> 10 , 7 , 5 , 5 , 6 , 8 , 10 , 13 , 8 , 5 , 5 , 3 , 5 , 7 , 10 , 11 , <nl> 9 , 7 , 6 , 5 , 5 , 7 , 9 , 9 , 11 , 10 , 8 , 7 , 6 , 6 , 8 , 8 , <nl> static const long _huff_lengthlist__44p4_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p4_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p4_long , <nl> + ( char * ) _huff_lengthlist__44p4_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p4_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p1_0 [ ] = { <nl> 1 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p4_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p2_0 [ ] = { <nl> 3 , 9 , 9 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , <nl> 12 , 12 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 10 , 10 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , 11 , 11 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44p4_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p4_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p3_0 [ ] = { <nl> 1 , 6 , 6 , 5 , 7 , 8 , 0 , 8 , 8 , 6 , 9 , 9 , 7 , 10 , 10 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , 8 , 8 , 4 , 7 , 7 , 6 , 10 , <nl> 10 , 0 , 12 , 12 , 7 , 11 , 11 , 8 , 12 , 12 , 0 , 12 , 12 , 0 , 13 , 12 , <nl> static const long _vq_lengthlist__44p4_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p3_1 [ ] = { <nl> 3 , 5 , 5 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , <nl> 8 , 8 , 0 , 8 , 8 , 0 , 10 , 10 , 0 , 8 , 8 , 0 , 7 , 7 , 0 , 8 , <nl> 8 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , <nl> static const long _vq_lengthlist__44p4_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p4_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p4_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p4_0 [ ] = { <nl> 1 , 6 , 6 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 10 , 11 , 11 , 9 , <nl> 8 , 8 , 8 , 8 , 8 , 11 , 11 , 12 , 9 , 8 , 8 , 5 , 7 , 7 , 9 , 11 , <nl> 11 , 10 , 11 , 11 , 10 , 11 , 11 , 12 , 14 , 14 , 11 , 12 , 12 , 10 , 12 , 12 , <nl> static const long _vq_lengthlist__44p4_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p4_1 [ ] = { <nl> 4 , 5 , 5 , 9 , 9 , 12 , 9 , 9 , 12 , 12 , 12 , 10 , 10 , 13 , 13 , 13 , <nl> 11 , 11 , 12 , 12 , 13 , 13 , 13 , 12 , 12 , 13 , 10 , 10 , 13 , 13 , 13 , 13 , <nl> 13 , 13 , 13 , 13 , 10 , 10 , 13 , 12 , 13 , 11 , 11 , 13 , 13 , 13 , 14 , 14 , <nl> static const long _vq_lengthlist__44p4_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p4_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p4_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p4_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p5_0 [ ] = { <nl> 1 , 7 , 6 , 15 , 15 , 7 , 8 , 8 , 15 , 15 , 8 , 8 , 8 , 15 , 15 , 0 , <nl> 13 , 13 , 16 , 16 , 0 , 14 , 14 , 16 , 16 , 7 , 9 , 9 , 16 , 16 , 10 , 11 , <nl> 11 , 17 , 17 , 10 , 8 , 8 , 15 , 16 , 0 , 14 , 14 , 18 , 18 , 0 , 14 , 14 , <nl> static const long _vq_lengthlist__44p4_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p4_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p4_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p4_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p4_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p6_0 [ ] = { <nl> 1 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 9 , 9 , 11 , 11 , 11 , 9 , <nl> 8 , 8 , 8 , 9 , 9 , 12 , 11 , 12 , 9 , 8 , 8 , 6 , 7 , 7 , 10 , 11 , <nl> 11 , 10 , 10 , 10 , 11 , 11 , 11 , 14 , 14 , 14 , 12 , 11 , 12 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44p4_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p6_1 [ ] = { <nl> 2 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 8 , 8 , 6 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 9 , 8 , 8 , 9 , 8 , 9 , 9 , 8 , 8 , 10 , 8 , 8 , <nl> static const long _vq_lengthlist__44p4_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p4_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p4_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p4_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p4_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p4_p7_0 , <nl> 1 , - 513979392 , 1633504256 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p7_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p7_1 [ ] = { <nl> 1 , 9 , 9 , 7 , 9 , 9 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 8 , <nl> 9 , 9 , 7 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 7 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p4_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p4_p7_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p4_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p4_p7_1 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p7_2 [ ] = { <nl> 1 , 3 , 2 , 5 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p4_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p4_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p4_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p4_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p4_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p4_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p4_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p4_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p4_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p4_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p4_short [ ] = { <nl> + static const char _huff_lengthlist__44p4_short [ ] = { <nl> 3 , 5 , 16 , 9 , 9 , 13 , 18 , 21 , 4 , 2 , 21 , 6 , 6 , 10 , 15 , 21 , <nl> 16 , 19 , 6 , 5 , 7 , 10 , 13 , 16 , 8 , 6 , 5 , 4 , 4 , 8 , 13 , 16 , <nl> 8 , 5 , 6 , 4 , 4 , 7 , 12 , 15 , 13 , 10 , 9 , 7 , 7 , 9 , 13 , 16 , <nl> static const long _huff_lengthlist__44p4_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p4_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p4_short , <nl> + ( char * ) _huff_lengthlist__44p4_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p5_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_l0_0 [ ] = { <nl> 1 , 4 , 4 , 8 , 8 , 10 , 10 , 10 , 10 , 9 , 8 , 11 , 11 , 4 , 6 , 5 , <nl> 8 , 6 , 10 , 10 , 10 , 10 , 10 , 9 , 10 , 9 , 4 , 5 , 6 , 6 , 9 , 10 , <nl> 10 , 10 , 10 , 9 , 10 , 9 , 10 , 8 , 9 , 8 , 9 , 8 , 9 , 9 , 10 , 9 , <nl> static const long _vq_lengthlist__44p5_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p5_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p5_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p5_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p5_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p5_l0_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 4 , 5 , 4 , 4 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p5_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p5_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p5_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p5_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p5_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p5_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p5_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p5_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p5_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p5_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p5_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p5_lfe , <nl> + ( char * ) _huff_lengthlist__44p5_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p5_long [ ] = { <nl> + static const char _huff_lengthlist__44p5_long [ ] = { <nl> 3 , 7 , 12 , 14 , 14 , 16 , 18 , 19 , 6 , 2 , 4 , 6 , 8 , 9 , 12 , 14 , <nl> 12 , 3 , 3 , 5 , 7 , 8 , 11 , 13 , 13 , 6 , 4 , 5 , 7 , 8 , 10 , 11 , <nl> 14 , 8 , 7 , 7 , 7 , 7 , 9 , 10 , 15 , 9 , 8 , 7 , 7 , 6 , 8 , 9 , <nl> static const long _huff_lengthlist__44p5_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p5_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p5_long , <nl> + ( char * ) _huff_lengthlist__44p5_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p5_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p1_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 5 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 10 , 8 , 9 , 10 , 9 , 10 , 12 , 10 , 11 , 11 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p5_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p2_0 [ ] = { <nl> 4 , 6 , 6 , 9 , 9 , 6 , 7 , 8 , 10 , 10 , 6 , 8 , 7 , 10 , 10 , 8 , <nl> 10 , 10 , 12 , 13 , 8 , 10 , 10 , 13 , 12 , 6 , 7 , 8 , 10 , 10 , 7 , 8 , <nl> 9 , 10 , 11 , 8 , 9 , 9 , 11 , 11 , 10 , 10 , 11 , 12 , 14 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p5_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p5_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p3_0 [ ] = { <nl> 1 , 5 , 6 , 5 , 7 , 8 , 5 , 8 , 7 , 5 , 7 , 8 , 7 , 8 , 10 , 8 , <nl> 10 , 10 , 5 , 8 , 7 , 8 , 10 , 10 , 7 , 10 , 8 , 6 , 8 , 9 , 8 , 10 , <nl> 11 , 9 , 10 , 10 , 9 , 10 , 11 , 10 , 11 , 12 , 11 , 12 , 12 , 9 , 11 , 10 , <nl> static const long _vq_lengthlist__44p5_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p3_1 [ ] = { <nl> 5 , 6 , 6 , 6 , 7 , 7 , 6 , 7 , 7 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , <nl> 8 , 8 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 7 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 9 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p5_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p5_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p5_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p4_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 9 , 5 , 9 , 7 , 5 , 7 , 8 , 7 , 7 , 10 , 9 , <nl> 10 , 10 , 5 , 8 , 7 , 9 , 10 , 10 , 7 , 10 , 7 , 6 , 8 , 9 , 9 , 10 , <nl> 12 , 9 , 11 , 11 , 9 , 10 , 11 , 11 , 11 , 13 , 12 , 13 , 13 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44p5_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p4_1 [ ] = { <nl> 5 , 7 , 7 , 10 , 10 , 7 , 8 , 9 , 10 , 11 , 7 , 9 , 8 , 11 , 10 , 9 , <nl> 10 , 10 , 11 , 11 , 9 , 10 , 10 , 11 , 11 , 7 , 9 , 9 , 10 , 10 , 8 , 9 , <nl> 10 , 10 , 11 , 9 , 10 , 10 , 11 , 11 , 10 , 10 , 11 , 11 , 11 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p5_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p5_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p5_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p5_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p5_0 [ ] = { <nl> 1 , 6 , 6 , 10 , 10 , 6 , 7 , 9 , 11 , 13 , 5 , 9 , 7 , 13 , 11 , 8 , <nl> 11 , 12 , 13 , 15 , 8 , 12 , 11 , 15 , 13 , 6 , 7 , 8 , 11 , 11 , 7 , 8 , <nl> 10 , 11 , 13 , 9 , 10 , 10 , 13 , 13 , 11 , 11 , 13 , 12 , 16 , 12 , 13 , 13 , <nl> static const long _vq_lengthlist__44p5_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p5_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p5_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p5_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p5_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p6_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 9 , 5 , 9 , 7 , 5 , 7 , 8 , 7 , 7 , 10 , 9 , <nl> 9 , 10 , 5 , 8 , 7 , 9 , 10 , 9 , 7 , 10 , 7 , 6 , 9 , 9 , 9 , 10 , <nl> 12 , 10 , 12 , 11 , 9 , 10 , 11 , 11 , 10 , 13 , 12 , 12 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p5_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p6_1 [ ] = { <nl> 2 , 6 , 6 , 5 , 7 , 8 , 5 , 8 , 7 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 7 , 6 , 8 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 9 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44p5_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p5_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p5_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p5_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p5_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p5_p7_0 , <nl> 1 , - 513979392 , 1633504256 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p7_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p7_1 [ ] = { <nl> 1 , 7 , 7 , 6 , 9 , 9 , 7 , 9 , 9 , 6 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p5_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p5_p7_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p5_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p5_p7_1 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p7_2 [ ] = { <nl> 1 , 2 , 3 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 12 , 12 , 13 , 13 , 14 , 14 , 14 , 14 , <nl> } ; <nl> <nl> static const static_codebook _44p5_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p5_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p5_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p5_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p5_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p5_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p5_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p5_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p5_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p5_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p5_short [ ] = { <nl> + static const char _huff_lengthlist__44p5_short [ ] = { <nl> 4 , 7 , 12 , 14 , 15 , 18 , 20 , 20 , 5 , 3 , 4 , 6 , 9 , 11 , 15 , 19 , <nl> 9 , 4 , 3 , 4 , 7 , 9 , 13 , 18 , 11 , 6 , 3 , 3 , 5 , 8 , 13 , 19 , <nl> 14 , 9 , 6 , 5 , 7 , 10 , 16 , 20 , 16 , 11 , 9 , 8 , 10 , 10 , 14 , 16 , <nl> static const long _huff_lengthlist__44p5_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p5_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p5_short , <nl> + ( char * ) _huff_lengthlist__44p5_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p6_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_l0_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 10 , 10 , 12 , 12 , 12 , 12 , 13 , 12 , 5 , 5 , 5 , <nl> 8 , 6 , 11 , 9 , 12 , 12 , 13 , 12 , 12 , 12 , 4 , 5 , 5 , 6 , 8 , 9 , <nl> 11 , 12 , 12 , 13 , 12 , 12 , 12 , 7 , 7 , 8 , 9 , 9 , 11 , 8 , 12 , 9 , <nl> static const long _vq_lengthlist__44p6_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p6_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p6_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p6_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p6_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p6_l0_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44p6_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p6_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p6_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p6_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p6_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_l1_0 [ ] = { <nl> 1 , 3 , 2 , 5 , 5 , 6 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44p6_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44p6_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p6_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p6_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p6_lfe [ ] = { <nl> 2 , 3 , 1 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p6_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p6_lfe , <nl> + ( char * ) _huff_lengthlist__44p6_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p6_long [ ] = { <nl> + static const char _huff_lengthlist__44p6_long [ ] = { <nl> 2 , 7 , 13 , 15 , 16 , 17 , 19 , 20 , 6 , 3 , 4 , 7 , 9 , 10 , 12 , 15 , <nl> 13 , 4 , 3 , 4 , 7 , 8 , 11 , 13 , 14 , 7 , 4 , 4 , 6 , 7 , 10 , 11 , <nl> 16 , 9 , 7 , 6 , 7 , 8 , 9 , 10 , 16 , 9 , 8 , 7 , 7 , 6 , 8 , 8 , <nl> static const long _huff_lengthlist__44p6_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p6_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p6_long , <nl> + ( char * ) _huff_lengthlist__44p6_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p6_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p1_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 5 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 9 , 8 , 9 , 10 , 9 , 10 , 12 , 10 , 11 , 11 , 8 , 9 , 10 , <nl> static const long _vq_lengthlist__44p6_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p2_0 [ ] = { <nl> 4 , 6 , 6 , 9 , 9 , 6 , 7 , 8 , 10 , 10 , 6 , 8 , 7 , 10 , 10 , 8 , <nl> 10 , 10 , 12 , 13 , 8 , 10 , 10 , 13 , 12 , 6 , 8 , 8 , 10 , 10 , 7 , 8 , <nl> 9 , 10 , 11 , 8 , 9 , 9 , 11 , 11 , 10 , 10 , 11 , 12 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p6_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p6_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p3_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 8 , 5 , 8 , 7 , 5 , 7 , 8 , 8 , 8 , 10 , 8 , <nl> 10 , 10 , 5 , 8 , 7 , 8 , 10 , 10 , 8 , 10 , 8 , 6 , 8 , 9 , 8 , 10 , <nl> 12 , 9 , 11 , 11 , 9 , 10 , 11 , 11 , 11 , 13 , 12 , 13 , 13 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44p6_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p3_1 [ ] = { <nl> 5 , 7 , 7 , 6 , 7 , 7 , 6 , 7 , 7 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , <nl> 8 , 8 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 7 , 8 , 7 , 8 , <nl> 8 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 9 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p6_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p6_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p6_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p4_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 7 , 8 , 5 , 8 , 7 , 5 , 7 , 7 , 7 , 7 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 8 , 9 , 9 , 7 , 9 , 7 , 6 , 8 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 9 , 8 , 9 , 10 , 9 , 9 , 11 , 10 , 11 , 11 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44p6_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p4_1 [ ] = { <nl> 6 , 8 , 8 , 10 , 10 , 8 , 9 , 9 , 10 , 11 , 8 , 10 , 9 , 11 , 10 , 9 , <nl> 10 , 10 , 11 , 11 , 9 , 10 , 10 , 11 , 11 , 8 , 9 , 9 , 10 , 10 , 9 , 9 , <nl> 10 , 11 , 11 , 10 , 10 , 10 , 11 , 11 , 10 , 11 , 11 , 11 , 11 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p6_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p6_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p6_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p6_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p5_0 [ ] = { <nl> 2 , 6 , 6 , 10 , 10 , 5 , 7 , 8 , 11 , 12 , 5 , 8 , 7 , 12 , 11 , 9 , <nl> 11 , 11 , 13 , 15 , 9 , 11 , 11 , 15 , 13 , 6 , 7 , 8 , 11 , 11 , 7 , 7 , <nl> 9 , 11 , 13 , 8 , 9 , 9 , 13 , 12 , 11 , 11 , 12 , 12 , 15 , 11 , 12 , 12 , <nl> static const long _vq_lengthlist__44p6_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p6_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p6_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p6_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p6_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p6_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 9 , 5 , 9 , 7 , 5 , 7 , 8 , 7 , 7 , 10 , 9 , <nl> 10 , 10 , 5 , 8 , 7 , 9 , 10 , 10 , 7 , 10 , 7 , 6 , 9 , 9 , 9 , 10 , <nl> 12 , 9 , 11 , 11 , 9 , 10 , 11 , 11 , 11 , 13 , 12 , 13 , 13 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44p6_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p6_1 [ ] = { <nl> 2 , 6 , 6 , 6 , 7 , 8 , 6 , 8 , 7 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , <nl> 8 , 8 , 6 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 7 , 6 , 8 , 8 , 8 , 9 , <nl> 9 , 8 , 9 , 9 , 8 , 9 , 9 , 9 , 9 , 10 , 9 , 10 , 10 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44p6_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p6_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p6_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p6_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p6_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p6_p7_0 , <nl> 1 , - 513979392 , 1633504256 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p7_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p7_1 [ ] = { <nl> 1 , 4 , 5 , 5 , 10 , 10 , 5 , 10 , 10 , 5 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 5 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 7 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44p6_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p6_p7_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p6_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p6_p7_1 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p7_2 [ ] = { <nl> 1 , 2 , 3 , 4 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p6_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p6_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p6_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p6_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p6_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p6_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p6_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p6_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p6_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p6_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p6_short [ ] = { <nl> + static const char _huff_lengthlist__44p6_short [ ] = { <nl> 2 , 8 , 13 , 15 , 16 , 18 , 21 , 22 , 5 , 4 , 6 , 8 , 10 , 12 , 17 , 21 , <nl> 9 , 5 , 5 , 6 , 8 , 11 , 15 , 19 , 11 , 6 , 5 , 5 , 6 , 7 , 12 , 14 , <nl> 14 , 8 , 7 , 5 , 4 , 4 , 9 , 11 , 16 , 11 , 9 , 7 , 4 , 3 , 7 , 10 , <nl> static const long _huff_lengthlist__44p6_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p6_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p6_short , <nl> + ( char * ) _huff_lengthlist__44p6_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p7_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_l0_0 [ ] = { <nl> 2 , 4 , 4 , 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 12 , 12 , 4 , 5 , 5 , <nl> 7 , 7 , 9 , 9 , 11 , 9 , 12 , 11 , 12 , 12 , 4 , 5 , 5 , 7 , 7 , 9 , <nl> 9 , 9 , 10 , 10 , 11 , 12 , 12 , 7 , 7 , 7 , 7 , 8 , 9 , 8 , 11 , 5 , <nl> static const long _vq_lengthlist__44p7_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p7_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p7_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p7_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p7_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p7_l0_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p7_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p7_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p7_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p7_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p7_l1_0 [ ] = { <nl> 108 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_l1_0 [ ] = { <nl> 1 , 2 , 3 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> } ; <nl> <nl> static const static_codebook _44p7_l1_0 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p7_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p7_l1_0 , <nl> 1 , - 514516992 , 1620639744 , 7 , 0 , <nl> ( long * ) _vq_quantlist__44p7_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p7_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p7_lfe [ ] = { <nl> 2 , 3 , 1 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p7_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p7_lfe , <nl> + ( char * ) _huff_lengthlist__44p7_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p7_long [ ] = { <nl> + static const char _huff_lengthlist__44p7_long [ ] = { <nl> 2 , 7 , 14 , 16 , 17 , 17 , 18 , 20 , 6 , 3 , 5 , 8 , 10 , 11 , 13 , 15 , <nl> 13 , 5 , 3 , 5 , 8 , 9 , 11 , 12 , 15 , 7 , 4 , 3 , 5 , 7 , 9 , 11 , <nl> 16 , 10 , 7 , 5 , 6 , 7 , 9 , 10 , 17 , 11 , 8 , 7 , 7 , 6 , 8 , 8 , <nl> static const long _huff_lengthlist__44p7_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p7_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p7_long , <nl> + ( char * ) _huff_lengthlist__44p7_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p7_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p1_0 [ ] = { <nl> 2 , 5 , 5 , 4 , 7 , 7 , 4 , 7 , 7 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 6 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 10 , 8 , 9 , 10 , 10 , 10 , 12 , 10 , 11 , 11 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p7_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p2_0 [ ] = { <nl> 4 , 6 , 6 , 9 , 9 , 6 , 8 , 8 , 10 , 10 , 6 , 8 , 8 , 10 , 10 , 8 , <nl> 10 , 10 , 12 , 13 , 8 , 10 , 10 , 13 , 12 , 6 , 8 , 8 , 10 , 10 , 8 , 8 , <nl> 9 , 10 , 11 , 8 , 9 , 9 , 11 , 11 , 10 , 10 , 11 , 12 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p7_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p7_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p3_0 [ ] = { <nl> 2 , 5 , 5 , 4 , 7 , 7 , 4 , 7 , 7 , 5 , 7 , 8 , 7 , 8 , 10 , 8 , <nl> 9 , 9 , 5 , 7 , 7 , 8 , 9 , 9 , 7 , 10 , 8 , 5 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 10 , 10 , 8 , 9 , 10 , 10 , 10 , 12 , 10 , 12 , 12 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p7_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p3_1 [ ] = { <nl> 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 7 , <nl> 8 , 8 , 7 , 8 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 8 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p7_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p7_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p7_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p4_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 8 , 5 , 8 , 7 , 5 , 7 , 8 , 7 , 8 , 10 , 8 , <nl> 10 , 10 , 5 , 8 , 7 , 8 , 10 , 10 , 7 , 10 , 8 , 6 , 8 , 9 , 9 , 10 , <nl> 12 , 9 , 11 , 11 , 9 , 10 , 11 , 11 , 11 , 13 , 11 , 13 , 13 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44p7_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p4_1 [ ] = { <nl> 7 , 8 , 8 , 10 , 10 , 8 , 9 , 9 , 10 , 11 , 8 , 9 , 9 , 10 , 10 , 9 , <nl> 10 , 10 , 11 , 11 , 9 , 10 , 10 , 11 , 11 , 8 , 9 , 9 , 10 , 10 , 9 , 9 , <nl> 10 , 11 , 11 , 9 , 10 , 10 , 11 , 11 , 10 , 10 , 11 , 11 , 11 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p7_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p7_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p7_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p7_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p5_0 [ ] = { <nl> 2 , 6 , 6 , 9 , 9 , 5 , 7 , 8 , 10 , 11 , 5 , 8 , 7 , 11 , 10 , 8 , <nl> 10 , 11 , 12 , 13 , 8 , 11 , 10 , 13 , 12 , 6 , 7 , 8 , 10 , 11 , 7 , 8 , <nl> 10 , 10 , 12 , 8 , 9 , 9 , 12 , 11 , 10 , 10 , 12 , 11 , 14 , 10 , 11 , 12 , <nl> static const long _vq_lengthlist__44p7_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p7_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p7_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p7_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p7_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p6_0 [ ] = { <nl> 2 , 5 , 6 , 5 , 7 , 8 , 5 , 8 , 7 , 5 , 7 , 7 , 7 , 7 , 9 , 8 , <nl> 9 , 9 , 5 , 7 , 7 , 8 , 9 , 9 , 7 , 9 , 7 , 6 , 8 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 9 , 8 , 9 , 10 , 9 , 9 , 11 , 10 , 10 , 11 , 8 , 10 , 9 , <nl> static const long _vq_lengthlist__44p7_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p6_1 [ ] = { <nl> 4 , 7 , 7 , 6 , 7 , 8 , 6 , 8 , 7 , 7 , 7 , 8 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 7 , 7 , 7 , 8 , 8 , 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 9 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p7_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p7_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p7_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p7_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p7_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p7_p7_0 , <nl> 1 , - 513979392 , 1633504256 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p7_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p7_1 [ ] = { <nl> 1 , 5 , 5 , 4 , 10 , 10 , 5 , 10 , 10 , 5 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 5 , 10 , 10 , 10 , 10 , 10 , 9 , 10 , 10 , 6 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44p7_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p7_p7_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p7_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p7_p7_1 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p7_2 [ ] = { <nl> 1 , 3 , 2 , 4 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p7_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p7_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p7_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p7_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p7_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p7_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p7_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p7_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p7_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p7_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p7_short [ ] = { <nl> + static const char _huff_lengthlist__44p7_short [ ] = { <nl> 3 , 9 , 14 , 16 , 17 , 19 , 22 , 22 , 5 , 4 , 6 , 9 , 11 , 13 , 17 , 20 , <nl> 9 , 5 , 5 , 6 , 9 , 11 , 15 , 19 , 11 , 7 , 5 , 5 , 7 , 9 , 13 , 17 , <nl> 14 , 9 , 7 , 6 , 6 , 7 , 11 , 14 , 16 , 11 , 9 , 7 , 6 , 4 , 4 , 8 , <nl> static const long _huff_lengthlist__44p7_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p7_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p7_short , <nl> + ( char * ) _huff_lengthlist__44p7_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p8_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_l0_0 [ ] = { <nl> 2 , 4 , 4 , 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 12 , 12 , 4 , 5 , 5 , <nl> 7 , 7 , 9 , 9 , 10 , 9 , 12 , 10 , 12 , 12 , 4 , 5 , 5 , 7 , 7 , 9 , <nl> 9 , 9 , 10 , 10 , 12 , 12 , 12 , 7 , 7 , 7 , 7 , 8 , 9 , 8 , 11 , 5 , <nl> static const long _vq_lengthlist__44p8_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p8_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p8_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p8_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p8_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p8_l0_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p8_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p8_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p8_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p8_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p8_l1_0 [ ] = { <nl> 108 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_l1_0 [ ] = { <nl> 1 , 2 , 3 , 6 , 7 , 7 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> } ; <nl> <nl> static const static_codebook _44p8_l1_0 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p8_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p8_l1_0 , <nl> 1 , - 514516992 , 1620639744 , 7 , 0 , <nl> ( long * ) _vq_quantlist__44p8_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p8_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p8_lfe [ ] = { <nl> 2 , 3 , 1 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p8_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44p8_lfe , <nl> + ( char * ) _huff_lengthlist__44p8_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p8_long [ ] = { <nl> + static const char _huff_lengthlist__44p8_long [ ] = { <nl> 2 , 7 , 14 , 16 , 17 , 18 , 20 , 21 , 7 , 4 , 6 , 8 , 11 , 12 , 14 , 16 , <nl> 13 , 5 , 4 , 4 , 8 , 9 , 11 , 13 , 15 , 8 , 4 , 3 , 5 , 7 , 9 , 10 , <nl> 17 , 11 , 8 , 4 , 4 , 6 , 9 , 9 , 17 , 11 , 9 , 7 , 6 , 5 , 7 , 8 , <nl> static const long _huff_lengthlist__44p8_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44p8_long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p8_long , <nl> + ( char * ) _huff_lengthlist__44p8_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p8_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p1_0 [ ] = { <nl> 2 , 5 , 5 , 4 , 7 , 7 , 4 , 7 , 7 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 6 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 10 , 8 , 9 , 10 , 10 , 10 , 12 , 10 , 11 , 12 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p8_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p2_0 [ ] = { <nl> 4 , 6 , 6 , 9 , 9 , 6 , 8 , 8 , 10 , 10 , 6 , 8 , 8 , 10 , 10 , 8 , <nl> 9 , 10 , 12 , 12 , 8 , 10 , 9 , 12 , 12 , 6 , 8 , 8 , 10 , 10 , 8 , 8 , <nl> 9 , 10 , 11 , 8 , 9 , 9 , 11 , 11 , 9 , 10 , 11 , 12 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p8_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p8_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p3_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 5 , 7 , 8 , 7 , 9 , <nl> 10 , 8 , 9 , 9 , 8 , 9 , 10 , 9 , 10 , 12 , 10 , 11 , 11 , 8 , 10 , 9 , <nl> static const long _vq_lengthlist__44p8_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p3_1 [ ] = { <nl> 6 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , <nl> 8 , 8 , 7 , 8 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p8_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p8_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p8_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p4_0 [ ] = { <nl> 2 , 5 , 5 , 4 , 7 , 8 , 4 , 8 , 7 , 5 , 7 , 8 , 7 , 7 , 10 , 8 , <nl> 9 , 9 , 5 , 7 , 7 , 8 , 9 , 9 , 7 , 10 , 7 , 5 , 7 , 8 , 8 , 9 , <nl> 11 , 8 , 10 , 10 , 8 , 9 , 10 , 10 , 10 , 12 , 11 , 12 , 12 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p8_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p4_1 [ ] = { <nl> 7 , 9 , 9 , 10 , 10 , 9 , 10 , 10 , 10 , 11 , 9 , 10 , 10 , 11 , 10 , 9 , <nl> 10 , 10 , 11 , 11 , 9 , 10 , 10 , 11 , 11 , 9 , 10 , 10 , 11 , 11 , 10 , 10 , <nl> 10 , 11 , 11 , 10 , 10 , 10 , 11 , 11 , 10 , 11 , 11 , 11 , 11 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p8_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p8_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p8_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p8_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p5_0 [ ] = { <nl> 2 , 6 , 6 , 9 , 9 , 5 , 7 , 8 , 10 , 11 , 5 , 8 , 7 , 11 , 10 , 8 , <nl> 10 , 11 , 12 , 13 , 8 , 11 , 10 , 13 , 12 , 6 , 7 , 8 , 10 , 11 , 7 , 8 , <nl> 10 , 10 , 12 , 8 , 9 , 9 , 12 , 12 , 10 , 10 , 12 , 12 , 14 , 10 , 12 , 12 , <nl> static const long _vq_lengthlist__44p8_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p8_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p8_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p8_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p8_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p6_0 [ ] = { <nl> 2 , 6 , 6 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 7 , 9 , 7 , <nl> 9 , 9 , 6 , 7 , 7 , 8 , 9 , 9 , 7 , 9 , 7 , 6 , 8 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 9 , 8 , 9 , 10 , 9 , 9 , 10 , 10 , 10 , 10 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44p8_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p6_1 [ ] = { <nl> 4 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , <nl> 8 , 8 , 7 , 8 , 7 , 8 , 8 , 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 8 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p8_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p8_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p8_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44p8_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p8_p7_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p8_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p8_p7_0 , <nl> 1 , - 512202240 , 1635281408 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p7_1 [ ] = { <nl> 1 , 7 , 7 , 12 , 12 , 5 , 11 , 12 , 12 , 12 , 5 , 12 , 11 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 13 , 13 , 13 , 13 , 7 , 11 , 11 , 13 , 13 , 13 , 12 , <nl> 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , <nl> static const long _vq_lengthlist__44p8_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p8_p7_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p8_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p8_p7_1 , <nl> 1 , - 514619392 , 1630767104 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p7_2 [ ] = { <nl> 1 , 3 , 2 , 4 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44p8_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p8_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p8_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p8_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p8_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p8_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p8_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p8_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p8_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p8_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p8_short [ ] = { <nl> + static const char _huff_lengthlist__44p8_short [ ] = { <nl> 3 , 9 , 15 , 17 , 20 , 21 , 22 , 23 , 5 , 5 , 7 , 9 , 11 , 13 , 17 , 20 , <nl> 9 , 5 , 5 , 6 , 8 , 10 , 15 , 18 , 11 , 7 , 5 , 4 , 6 , 9 , 13 , 17 , <nl> 14 , 9 , 7 , 5 , 6 , 7 , 10 , 14 , 17 , 10 , 8 , 6 , 6 , 4 , 5 , 8 , <nl> static const long _huff_lengthlist__44p8_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44p8_short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44p8_short , <nl> + ( char * ) _huff_lengthlist__44p8_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p9_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_l0_0 [ ] = { <nl> 2 , 5 , 5 , 7 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 4 , 5 , 5 , <nl> 6 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 10 , 4 , 5 , 5 , 7 , 6 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 10 , 10 , 6 , 6 , 7 , 6 , 7 , 8 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44p9_l0_0 [ ] = { <nl> <nl> static const static_codebook _44p9_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44p9_l0_0 , <nl> + ( char * ) _vq_lengthlist__44p9_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44p9_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44p9_l0_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p9_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p9_l0_1 , <nl> + ( char * ) _vq_lengthlist__44p9_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44p9_l1_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_l1_0 [ ] = { <nl> 1 , 2 , 3 , 5 , 9 , 9 , 4 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> } ; <nl> <nl> static const static_codebook _44p9_l1_0 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44p9_l1_0 , <nl> + ( char * ) _vq_lengthlist__44p9_l1_0 , <nl> 1 , - 514619392 , 1630767104 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p9_lfe [ ] = { <nl> + static const char _huff_lengthlist__44p9_lfe [ ] = { <nl> 1 , 1 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p9_lfe = { <nl> 1 , 2 , <nl> - ( long * ) _huff_lengthlist__44p9_lfe , <nl> + ( char * ) _huff_lengthlist__44p9_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p9_long [ ] = { <nl> + static const char _huff_lengthlist__44p9_long [ ] = { <nl> 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p9_long = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist__44p9_long , <nl> + ( char * ) _huff_lengthlist__44p9_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44p9_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p1_0 [ ] = { <nl> 1 , 5 , 5 , 4 , 8 , 8 , 4 , 8 , 8 , 5 , 7 , 8 , 8 , 9 , 10 , 8 , <nl> 10 , 10 , 5 , 8 , 7 , 8 , 10 , 10 , 8 , 10 , 9 , 7 , 9 , 9 , 9 , 11 , <nl> 11 , 9 , 11 , 11 , 9 , 11 , 11 , 11 , 12 , 13 , 11 , 13 , 13 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44p9_p1_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p9_p1_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p2_0 [ ] = { <nl> 4 , 6 , 6 , 8 , 8 , 5 , 7 , 7 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 6 , <nl> 8 , 8 , 11 , 11 , 6 , 8 , 8 , 11 , 11 , 6 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 9 , 10 , 11 , 7 , 9 , 9 , 11 , 10 , 8 , 9 , 10 , 12 , 12 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p9_p2_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p2_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p9_p2_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p3_0 [ ] = { <nl> 2 , 5 , 4 , 4 , 7 , 7 , 4 , 7 , 6 , 5 , 6 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 6 , 7 , 9 , 9 , 7 , 9 , 8 , 6 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 8 , 9 , 10 , 10 , 11 , 12 , 10 , 12 , 12 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p9_p3_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p9_p3_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p3_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p3_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p3_1 [ ] = { <nl> 4 , 6 , 6 , 6 , 7 , 7 , 6 , 7 , 7 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , <nl> 7 , 8 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 8 , 9 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p9_p3_1 [ ] = { <nl> <nl> static const static_codebook _44p9_p3_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p9_p3_1 , <nl> + ( char * ) _vq_lengthlist__44p9_p3_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p4_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p4_0 [ ] = { <nl> 2 , 5 , 5 , 4 , 7 , 7 , 4 , 7 , 6 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 6 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 10 , 10 , 8 , 9 , 10 , 10 , 11 , 12 , 10 , 11 , 12 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p9_p4_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p4_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p9_p4_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p4_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p4_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p4_1 [ ] = { <nl> 6 , 8 , 8 , 10 , 9 , 8 , 9 , 9 , 10 , 10 , 8 , 9 , 9 , 10 , 10 , 8 , <nl> 10 , 10 , 10 , 10 , 8 , 10 , 10 , 10 , 10 , 9 , 9 , 9 , 10 , 10 , 9 , 10 , <nl> 10 , 10 , 11 , 9 , 10 , 10 , 11 , 11 , 10 , 10 , 10 , 11 , 11 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44p9_p4_1 [ ] = { <nl> <nl> static const static_codebook _44p9_p4_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p9_p4_1 , <nl> + ( char * ) _vq_lengthlist__44p9_p4_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p5_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p5_0 [ ] = { <nl> 4 , 6 , 6 , 9 , 9 , 6 , 7 , 8 , 10 , 11 , 6 , 8 , 7 , 10 , 10 , 8 , <nl> 10 , 10 , 12 , 12 , 8 , 10 , 10 , 12 , 12 , 6 , 7 , 8 , 10 , 10 , 7 , 8 , <nl> 9 , 10 , 11 , 8 , 9 , 9 , 11 , 11 , 10 , 10 , 11 , 12 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44p9_p5_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p5_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p9_p5_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p5_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p5_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p5_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44p9_p5_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44p9_p5_1 , <nl> + ( char * ) _vq_lengthlist__44p9_p5_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p6_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 8 , 5 , 7 , 8 , 8 , 9 , <nl> 10 , 8 , 9 , 10 , 8 , 9 , 10 , 10 , 10 , 12 , 10 , 11 , 11 , 8 , 10 , 10 , <nl> static const long _vq_lengthlist__44p9_p6_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p9_p6_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p6_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p6_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p6_1 [ ] = { <nl> 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 7 , <nl> 8 , 8 , 7 , 8 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 8 , 9 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44p9_p6_1 [ ] = { <nl> <nl> static const static_codebook _44p9_p6_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44p9_p6_1 , <nl> + ( char * ) _vq_lengthlist__44p9_p6_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p7_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p7_0 [ ] = { <nl> 1 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> static const long _vq_lengthlist__44p9_p7_0 [ ] = { <nl> <nl> static const static_codebook _44p9_p7_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p9_p7_0 , <nl> + ( char * ) _vq_lengthlist__44p9_p7_0 , <nl> 1 , - 510105088 , 1635281408 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p7_1 [ ] = { <nl> 1 , 4 , 4 , 16 , 16 , 4 , 9 , 11 , 15 , 16 , 4 , 12 , 8 , 16 , 16 , 12 , <nl> 16 , 16 , 16 , 16 , 13 , 16 , 16 , 16 , 16 , 5 , 8 , 10 , 16 , 16 , 9 , 9 , <nl> 14 , 15 , 16 , 12 , 14 , 14 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , <nl> static const long _vq_lengthlist__44p9_p7_1 [ ] = { <nl> <nl> static const static_codebook _44p9_p7_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44p9_p7_1 , <nl> + ( char * ) _vq_lengthlist__44p9_p7_1 , <nl> 1 , - 514619392 , 1630767104 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p7_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p7_2 [ ] = { <nl> 1 , 3 , 2 , 5 , 4 , 7 , 7 , 8 , 8 , 9 , 10 , 10 , 10 , 11 , 11 , 11 , <nl> 12 , 12 , 12 , 13 , 13 , 13 , 13 , 13 , 13 , <nl> } ; <nl> <nl> static const static_codebook _44p9_p7_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p9_p7_2 , <nl> + ( char * ) _vq_lengthlist__44p9_p7_2 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p7_2 , <nl> 0 <nl> static const long _vq_quantlist__44p9_p7_3 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44p9_p7_3 [ ] = { <nl> + static const char _vq_lengthlist__44p9_p7_3 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44p9_p7_3 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44p9_p7_3 , <nl> + ( char * ) _vq_lengthlist__44p9_p7_3 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44p9_p7_3 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44p9_short [ ] = { <nl> + static const char _huff_lengthlist__44p9_short [ ] = { <nl> 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44p9_short = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist__44p9_short , <nl> + ( char * ) _huff_lengthlist__44p9_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44pn1_l0_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_l0_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_l0_0 [ ] = { <nl> 1 , 3 , 3 , 8 , 8 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 5 , 7 , 5 , <nl> 9 , 8 , 10 , 10 , 10 , 10 , 11 , 10 , 11 , 10 , 5 , 5 , 7 , 8 , 9 , 10 , <nl> 10 , 11 , 10 , 10 , 11 , 10 , 11 , 10 , 10 , 10 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44pn1_l0_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_l0_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44pn1_l0_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_l0_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_l0_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_l0_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_l0_1 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_l0_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 4 , 5 , 6 , 7 , 7 , 4 , 6 , 5 , 7 , 7 , 7 , <nl> 6 , 7 , 6 , 7 , 7 , 7 , 6 , 7 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44pn1_l0_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44pn1_l0_1 , <nl> + ( char * ) _vq_lengthlist__44pn1_l0_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_l0_1 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_l1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_l1_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_l1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> } ; <nl> <nl> static const static_codebook _44pn1_l1_0 = { <nl> 2 , 9 , <nl> - ( long * ) _vq_lengthlist__44pn1_l1_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_l1_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_l1_0 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44pn1_lfe [ ] = { <nl> + static const char _huff_lengthlist__44pn1_lfe [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book__44pn1_lfe = { <nl> 2 , 4 , <nl> - ( long * ) _huff_lengthlist__44pn1_lfe , <nl> + ( char * ) _huff_lengthlist__44pn1_lfe , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44pn1_long [ ] = { <nl> + static const char _huff_lengthlist__44pn1_long [ ] = { <nl> 2 , 3 , 6 , 7 , 9 , 13 , 17 , 3 , 2 , 5 , 7 , 9 , 13 , 17 , 6 , 5 , <nl> 5 , 6 , 9 , 12 , 16 , 7 , 7 , 6 , 6 , 7 , 10 , 13 , 10 , 10 , 9 , 7 , <nl> 6 , 10 , 13 , 13 , 13 , 12 , 10 , 10 , 11 , 15 , 17 , 17 , 17 , 14 , 14 , 15 , <nl> static const long _huff_lengthlist__44pn1_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44pn1_long = { <nl> 2 , 49 , <nl> - ( long * ) _huff_lengthlist__44pn1_long , <nl> + ( char * ) _huff_lengthlist__44pn1_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p1_0 [ ] = { <nl> 1 , 2 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44pn1_p1_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_p1_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p1_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p2_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 9 , 9 , 0 , 12 , 12 , 0 , <nl> 8 , 8 , 0 , 9 , 9 , 0 , 13 , 13 , 0 , 8 , 8 , 0 , 6 , 6 , 0 , 11 , <nl> 11 , 0 , 12 , 12 , 0 , 12 , 12 , 0 , 14 , 14 , 0 , 11 , 12 , 0 , 12 , 12 , <nl> static const long _vq_lengthlist__44pn1_p2_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_p2_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p2_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_p2_0 , <nl> 1 , - 533200896 , 1614282752 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p2_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p2_1 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p2_1 [ ] = { <nl> 1 , 3 , 3 , 0 , 9 , 9 , 0 , 9 , 9 , 0 , 10 , 10 , 0 , 9 , 9 , 0 , <nl> 10 , 10 , 0 , 10 , 10 , 0 , 10 , 10 , 0 , 10 , 10 , 0 , 7 , 7 , 0 , 7 , <nl> 7 , 0 , 6 , 6 , 0 , 8 , 8 , 0 , 7 , 7 , 0 , 8 , 8 , 0 , 8 , 8 , <nl> static const long _vq_lengthlist__44pn1_p2_1 [ ] = { <nl> <nl> static const static_codebook _44pn1_p2_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p2_1 , <nl> + ( char * ) _vq_lengthlist__44pn1_p2_1 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p2_1 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p3_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p3_0 [ ] = { <nl> 1 , 6 , 6 , 6 , 8 , 8 , 6 , 8 , 8 , 7 , 9 , 9 , 10 , 11 , 11 , 8 , <nl> 8 , 8 , 7 , 9 , 9 , 11 , 12 , 12 , 9 , 9 , 9 , 6 , 7 , 7 , 10 , 11 , <nl> 11 , 10 , 11 , 11 , 10 , 11 , 11 , 13 , 13 , 13 , 12 , 12 , 12 , 10 , 12 , 11 , <nl> static const long _vq_lengthlist__44pn1_p3_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_p3_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p3_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_p3_0 , <nl> 1 , - 531365888 , 1616117760 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p3_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p3_1 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p3_1 [ ] = { <nl> 2 , 3 , 4 , 9 , 9 , 10 , 12 , 12 , 12 , 11 , 10 , 12 , 12 , 13 , 12 , 11 , <nl> 13 , 12 , 11 , 11 , 11 , 12 , 12 , 12 , 11 , 11 , 13 , 13 , 13 , 13 , 11 , 12 , <nl> 12 , 14 , 14 , 12 , 13 , 13 , 13 , 13 , 11 , 13 , 13 , 13 , 13 , 11 , 13 , 13 , <nl> static const long _vq_lengthlist__44pn1_p3_1 [ ] = { <nl> <nl> static const static_codebook _44pn1_p3_1 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44pn1_p3_1 , <nl> + ( char * ) _vq_lengthlist__44pn1_p3_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p3_1 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p4_0 [ ] = { <nl> 1 , 7 , 7 , 14 , 14 , 6 , 8 , 8 , 15 , 16 , 7 , 8 , 8 , 16 , 15 , 0 , <nl> 14 , 14 , 17 , 17 , 0 , 14 , 14 , 16 , 16 , 7 , 9 , 9 , 16 , 16 , 10 , 11 , <nl> 11 , 17 , 18 , 9 , 8 , 8 , 16 , 16 , 0 , 14 , 14 , 19 , 19 , 0 , 14 , 14 , <nl> static const long _vq_lengthlist__44pn1_p4_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_p4_0 = { <nl> 5 , 3125 , <nl> - ( long * ) _vq_lengthlist__44pn1_p4_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_p4_0 , <nl> 1 , - 528744448 , 1616642048 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p4_1 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p4_1 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p4_1 [ ] = { <nl> 2 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _44pn1_p4_1 = { <nl> 1 , 7 , <nl> - ( long * ) _vq_lengthlist__44pn1_p4_1 , <nl> + ( char * ) _vq_lengthlist__44pn1_p4_1 , <nl> 1 , - 533200896 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p4_1 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p5_0 [ ] = { <nl> 1 , 7 , 7 , 6 , 8 , 8 , 7 , 8 , 8 , 7 , 9 , 9 , 11 , 11 , 11 , 9 , <nl> 8 , 8 , 7 , 9 , 9 , 11 , 12 , 11 , 9 , 9 , 9 , 6 , 7 , 7 , 10 , 11 , <nl> 11 , 10 , 10 , 10 , 10 , 11 , 11 , 15 , 14 , 14 , 12 , 12 , 12 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44pn1_p5_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_p5_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p5_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_p5_0 , <nl> 1 , - 527106048 , 1620377600 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p5_1 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p5_1 [ ] = { <nl> 2 , 6 , 7 , 6 , 8 , 8 , 7 , 7 , 8 , 7 , 8 , 8 , 9 , 9 , 9 , 8 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 8 , 8 , 6 , 6 , 6 , 9 , 7 , <nl> 7 , 9 , 7 , 7 , 9 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , 10 , 8 , 8 , <nl> static const long _vq_lengthlist__44pn1_p5_1 [ ] = { <nl> <nl> static const static_codebook _44pn1_p5_1 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p5_1 , <nl> + ( char * ) _vq_lengthlist__44pn1_p5_1 , <nl> 1 , - 530841600 , 1616642048 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p6_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44pn1_p6_0 [ ] = { <nl> <nl> static const static_codebook _44pn1_p6_0 = { <nl> 5 , 243 , <nl> - ( long * ) _vq_lengthlist__44pn1_p6_0 , <nl> + ( char * ) _vq_lengthlist__44pn1_p6_0 , <nl> 1 , - 516716544 , 1630767104 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p6_1 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p6_1 [ ] = { <nl> 1 , 3 , 2 , 5 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 13 , 13 , 14 , 14 , 15 , 15 , 15 , 15 , <nl> } ; <nl> <nl> static const static_codebook _44pn1_p6_1 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44pn1_p6_1 , <nl> + ( char * ) _vq_lengthlist__44pn1_p6_1 , <nl> 1 , - 518864896 , 1620639744 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44pn1_p6_2 [ ] = { <nl> 24 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44pn1_p6_2 [ ] = { <nl> + static const char _vq_lengthlist__44pn1_p6_2 [ ] = { <nl> 3 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44pn1_p6_2 = { <nl> 1 , 25 , <nl> - ( long * ) _vq_lengthlist__44pn1_p6_2 , <nl> + ( char * ) _vq_lengthlist__44pn1_p6_2 , <nl> 1 , - 529006592 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44pn1_p6_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44pn1_short [ ] = { <nl> + static const char _huff_lengthlist__44pn1_short [ ] = { <nl> 4 , 3 , 7 , 9 , 12 , 16 , 16 , 3 , 2 , 5 , 7 , 11 , 14 , 15 , 7 , 4 , <nl> 5 , 6 , 9 , 12 , 15 , 8 , 5 , 5 , 5 , 8 , 10 , 14 , 9 , 7 , 6 , 6 , <nl> 8 , 10 , 12 , 12 , 10 , 10 , 7 , 6 , 8 , 10 , 15 , 12 , 10 , 6 , 4 , 7 , <nl> static const long _huff_lengthlist__44pn1_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44pn1_short = { <nl> 2 , 49 , <nl> - ( long * ) _huff_lengthlist__44pn1_short , <nl> + ( char * ) _huff_lengthlist__44pn1_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> mmm a / drivers / vorbis / books / coupled / res_books_stereo . h <nl> ppp b / drivers / vorbis / books / coupled / res_books_stereo . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : static codebooks autogenerated by huff / huffbuld <nl> - last modified : $ Id : res_books_stereo . h 17025 2010 - 03 - 25 04 : 56 : 56Z xiphmont $ <nl> + last modified : $ Id : res_books_stereo . h 19057 2014 - 01 - 22 12 : 32 : 31Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static const long _vq_quantlist__16c0_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p1_0 [ ] = { <nl> 1 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c0_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p3_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 6 , 6 , 7 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c0_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p4_0 [ ] = { <nl> 1 , 3 , 2 , 7 , 8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c0_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p5_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 6 , 6 , 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , <nl> 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , 8 , 8 , 0 , 0 , 0 , 7 , 7 , <nl> 8 , 8 , 9 , 9 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c0_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p6_0 [ ] = { <nl> 1 , 3 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 11 , <nl> 11 , 11 , 0 , 0 , 0 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__16c0_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 11 , 10 , 10 , 11 , <nl> 11 , 10 , 4 , 7 , 7 , 10 , 10 , 10 , 11 , 10 , 10 , 6 , 10 , 10 , 11 , 11 , <nl> 11 , 11 , 11 , 10 , 6 , 9 , 9 , 11 , 12 , 12 , 11 , 9 , 9 , 6 , 9 , 10 , <nl> static const long _vq_lengthlist__16c0_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p7_1 [ ] = { <nl> 1 , 3 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , 7 , <nl> 8 , 8 , 8 , 9 , 9 , 9 , 10 , 10 , 10 , 6 , 7 , 8 , 8 , 8 , 8 , 9 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__16c0_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 7 , 6 , 8 , 8 , 10 , 10 , 6 , 5 , 6 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 10 , 10 , 7 , 6 , 6 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 10 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__16c0_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p8_1 [ ] = { <nl> 1 , 4 , 3 , 5 , 5 , 7 , 7 , 7 , 6 , 6 , 7 , 7 , 7 , 5 , 5 , 7 , <nl> 7 , 7 , 6 , 6 , 7 , 7 , 7 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _16c0_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p9_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p9_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__16c0_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p9_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p9_0 , <nl> 1 , - 518803456 , 1628680192 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p9_1 [ ] = { <nl> 1 , 5 , 5 , 5 , 5 , 9 , 11 , 11 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 7 , <nl> 6 , 6 , 6 , 6 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 7 , 6 , <nl> 6 , 6 , 6 , 10 , 9 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 7 , 7 , <nl> static const long _vq_lengthlist__16c0_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p9_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__16c0_s_p9_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c0_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__16c0_s_p9_2 [ ] = { <nl> 1 , 5 , 5 , 7 , 8 , 8 , 7 , 9 , 9 , 9 , 12 , 12 , 11 , 12 , 12 , 10 , <nl> 10 , 11 , 12 , 12 , 12 , 11 , 12 , 12 , 8 , 9 , 8 , 7 , 9 , 10 , 10 , 11 , <nl> 11 , 10 , 11 , 12 , 10 , 12 , 10 , 12 , 12 , 12 , 11 , 12 , 11 , 9 , 8 , 8 , <nl> static const long _vq_lengthlist__16c0_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _16c0_s_p9_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__16c0_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__16c0_s_p9_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c0_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16c0_s_single [ ] = { <nl> + static const char _huff_lengthlist__16c0_s_single [ ] = { <nl> 3 , 4 , 19 , 7 , 9 , 7 , 8 , 11 , 9 , 12 , 4 , 1 , 19 , 6 , 7 , 7 , <nl> 8 , 10 , 11 , 13 , 18 , 18 , 18 , 18 , 18 , 18 , 18 , 18 , 18 , 18 , 8 , 6 , <nl> 18 , 8 , 9 , 9 , 11 , 12 , 14 , 18 , 9 , 6 , 18 , 9 , 7 , 8 , 9 , 11 , <nl> static const long _huff_lengthlist__16c0_s_single [ ] = { <nl> <nl> static const static_codebook _huff_book__16c0_s_single = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16c0_s_single , <nl> + ( char * ) _huff_lengthlist__16c0_s_single , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16c1_s_long [ ] = { <nl> + static const char _huff_lengthlist__16c1_s_long [ ] = { <nl> 2 , 5 , 20 , 7 , 10 , 7 , 8 , 10 , 11 , 11 , 4 , 2 , 20 , 5 , 8 , 6 , <nl> 7 , 9 , 10 , 10 , 20 , 20 , 20 , 20 , 19 , 19 , 19 , 19 , 19 , 19 , 7 , 5 , <nl> 19 , 6 , 10 , 7 , 9 , 11 , 13 , 17 , 11 , 8 , 19 , 10 , 7 , 7 , 8 , 10 , <nl> static const long _huff_lengthlist__16c1_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__16c1_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16c1_s_long , <nl> + ( char * ) _huff_lengthlist__16c1_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c1_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p3_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c1_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p4_0 [ ] = { <nl> 1 , 2 , 3 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c1_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p5_0 [ ] = { <nl> 1 , 3 , 3 , 5 , 5 , 6 , 6 , 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , <nl> 9 , 9 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , 8 , 8 , <nl> 8 , 8 , 9 , 9 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c1_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p6_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , <nl> 12 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__16c1_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 10 , 10 , <nl> 10 , 9 , 4 , 7 , 7 , 10 , 10 , 10 , 11 , 10 , 10 , 6 , 10 , 10 , 11 , 11 , <nl> 11 , 11 , 10 , 10 , 6 , 10 , 9 , 11 , 11 , 11 , 11 , 10 , 10 , 6 , 10 , 10 , <nl> static const long _vq_lengthlist__16c1_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p7_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 10 , 10 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__16c1_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 6 , 5 , 5 , <nl> 7 , 8 , 8 , 9 , 8 , 8 , 9 , 9 , 10 , 11 , 6 , 5 , 5 , 8 , 8 , 9 , <nl> 9 , 8 , 8 , 9 , 10 , 10 , 11 , 0 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__16c1_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p8_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _16c1_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p9_0 [ ] = { <nl> 1 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__16c1_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p9_0 , <nl> 1 , - 513964032 , 1628680192 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 4 , 4 , 8 , 8 , 12 , 13 , 14 , 14 , 14 , 14 , 14 , 14 , 6 , <nl> 6 , 6 , 6 , 6 , 10 , 9 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 7 , 6 , <nl> 5 , 6 , 6 , 10 , 9 , 12 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 7 , 7 , <nl> static const long _vq_lengthlist__16c1_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p9_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__16c1_s_p9_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c1_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__16c1_s_p9_2 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , <nl> 10 , 10 , 9 , 10 , 10 , 11 , 12 , 12 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> 10 , 10 , 10 , 10 , 10 , 11 , 11 , 10 , 12 , 11 , 11 , 13 , 11 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__16c1_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _16c1_s_p9_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__16c1_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__16c1_s_p9_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c1_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16c1_s_short [ ] = { <nl> + static const char _huff_lengthlist__16c1_s_short [ ] = { <nl> 5 , 6 , 17 , 8 , 12 , 9 , 10 , 10 , 12 , 13 , 5 , 2 , 17 , 4 , 9 , 5 , <nl> 7 , 8 , 11 , 13 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 6 , 4 , <nl> 16 , 5 , 10 , 5 , 7 , 10 , 14 , 16 , 13 , 9 , 16 , 11 , 8 , 7 , 8 , 9 , <nl> static const long _huff_lengthlist__16c1_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__16c1_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16c1_s_short , <nl> + ( char * ) _huff_lengthlist__16c1_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16c2_s_long [ ] = { <nl> + static const char _huff_lengthlist__16c2_s_long [ ] = { <nl> 4 , 7 , 9 , 9 , 9 , 8 , 9 , 10 , 13 , 16 , 5 , 4 , 5 , 6 , 7 , 7 , <nl> 8 , 9 , 12 , 16 , 6 , 5 , 5 , 5 , 7 , 7 , 9 , 10 , 12 , 15 , 7 , 6 , <nl> 5 , 4 , 5 , 6 , 8 , 9 , 10 , 13 , 8 , 7 , 7 , 5 , 5 , 5 , 7 , 9 , <nl> static const long _huff_lengthlist__16c2_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__16c2_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16c2_s_long , <nl> + ( char * ) _huff_lengthlist__16c2_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p1_0 [ ] = { <nl> 1 , 3 , 3 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 4 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c2_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p2_0 [ ] = { <nl> 2 , 4 , 4 , 7 , 7 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 8 , 8 , 0 , <nl> 0 , 0 , 8 , 8 , 0 , 0 , 0 , 8 , 8 , 4 , 4 , 4 , 8 , 7 , 0 , 0 , <nl> 0 , 8 , 8 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c2_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p3_0 [ ] = { <nl> 1 , 3 , 3 , 5 , 5 , 7 , 7 , 8 , 8 , 0 , 0 , 0 , 6 , 6 , 8 , 8 , <nl> 9 , 9 , 0 , 0 , 0 , 6 , 6 , 8 , 8 , 9 , 9 , 0 , 0 , 0 , 7 , 7 , <nl> 8 , 9 , 10 , 10 , 0 , 0 , 0 , 7 , 7 , 9 , 9 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__16c2_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p4_0 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , <nl> 9 , 0 , 0 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> 11 , 10 , 0 , 0 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__16c2_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 6 , 7 , 7 , 4 , 6 , 6 , 10 , 11 , 10 , 10 , <nl> 10 , 11 , 4 , 6 , 6 , 10 , 10 , 11 , 10 , 11 , 10 , 5 , 10 , 10 , 9 , 12 , <nl> 11 , 10 , 12 , 12 , 7 , 10 , 10 , 12 , 12 , 12 , 12 , 13 , 13 , 7 , 11 , 10 , <nl> static const long _vq_lengthlist__16c2_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p5_1 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 11 , 10 , 10 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 11 , 11 , 11 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 11 , 11 , 11 , 6 , <nl> static const long _vq_lengthlist__16c2_s_p5_1 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p5_1 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 5 , 5 , 5 , <nl> 7 , 7 , 9 , 9 , 9 , 9 , 11 , 11 , 12 , 12 , 6 , 5 , 5 , 7 , 7 , 9 , <nl> 9 , 10 , 9 , 11 , 11 , 12 , 12 , 0 , 7 , 7 , 7 , 7 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__16c2_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p6_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _16c2_s_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 9 , 10 , 10 , 5 , 5 , 5 , <nl> 7 , 7 , 9 , 9 , 10 , 10 , 11 , 10 , 12 , 11 , 6 , 5 , 5 , 7 , 7 , 9 , <nl> 9 , 10 , 10 , 11 , 11 , 12 , 12 , 20 , 7 , 7 , 7 , 7 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__16c2_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 9 , 9 , 9 , 6 , 7 , <nl> 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 9 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 7 , <nl> static const long _vq_lengthlist__16c2_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , <nl> 6 , 6 , 8 , 8 , 9 , 9 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 6 , 5 , <nl> 5 , 8 , 7 , 9 , 9 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 20 , 8 , 8 , <nl> static const long _vq_lengthlist__16c2_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p8_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 11 , 11 , 11 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 11 , 10 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__16c2_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p9_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p9_0 [ ] = { <nl> 1 , 4 , 3 , 10 , 8 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 6 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 6 , 10 , 9 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__16c2_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p9_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p9_0 , <nl> 1 , - 509798400 , 1631393792 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p9_1 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 9 , 11 , 10 , 13 , <nl> 11 , 14 , 13 , 6 , 6 , 6 , 8 , 8 , 8 , 8 , 8 , 7 , 9 , 8 , 11 , 9 , <nl> 13 , 11 , 14 , 12 , 14 , 13 , 5 , 6 , 6 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , <nl> static const long _vq_lengthlist__16c2_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p9_1 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p9_1 , <nl> 1 , - 518287360 , 1622704128 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__16c2_s_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16c2_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__16c2_s_p9_2 [ ] = { <nl> 2 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__16c2_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _16c2_s_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__16c2_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__16c2_s_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__16c2_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16c2_s_short [ ] = { <nl> + static const char _huff_lengthlist__16c2_s_short [ ] = { <nl> 7 , 10 , 12 , 11 , 12 , 13 , 15 , 16 , 18 , 15 , 10 , 8 , 8 , 8 , 9 , 10 , <nl> 12 , 13 , 14 , 17 , 10 , 7 , 7 , 7 , 7 , 8 , 10 , 12 , 15 , 18 , 10 , 7 , <nl> 7 , 5 , 5 , 6 , 8 , 10 , 13 , 15 , 10 , 7 , 6 , 5 , 4 , 4 , 6 , 9 , <nl> static const long _huff_lengthlist__16c2_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__16c2_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16c2_s_short , <nl> + ( char * ) _huff_lengthlist__16c2_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p1_0 [ ] = { <nl> 1 , 5 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c0_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p3_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 6 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c0_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p4_0 [ ] = { <nl> 1 , 2 , 3 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c0_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p5_0 [ ] = { <nl> 1 , 3 , 3 , 5 , 5 , 7 , 6 , 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , <nl> 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , 8 , 9 , 0 , 0 , 0 , 8 , 8 , <nl> 8 , 8 , 9 , 9 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c0_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p6_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 8 , 8 , 9 , 9 , 8 , 8 , 10 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 11 , 12 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__8c0_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 11 , 9 , 10 , 12 , <nl> 9 , 10 , 4 , 7 , 7 , 10 , 10 , 10 , 11 , 9 , 9 , 6 , 11 , 10 , 11 , 11 , <nl> 12 , 11 , 11 , 11 , 6 , 10 , 10 , 11 , 11 , 12 , 11 , 10 , 10 , 6 , 9 , 10 , <nl> static const long _vq_lengthlist__8c0_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p7_1 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 7 , 7 , <nl> 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 9 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , <nl> 9 , 10 , 10 , 10 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 8 , <nl> static const long _vq_lengthlist__8c0_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 7 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 7 , 7 , 8 , 9 , 10 , 10 , 7 , 6 , 6 , 7 , 7 , 8 , <nl> 7 , 7 , 7 , 9 , 9 , 10 , 12 , 0 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 8 , <nl> static const long _vq_lengthlist__8c0_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p8_1 [ ] = { <nl> 1 , 3 , 4 , 5 , 5 , 7 , 6 , 6 , 6 , 5 , 7 , 7 , 7 , 6 , 6 , 7 , <nl> 7 , 7 , 6 , 6 , 7 , 7 , 7 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _8c0_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p9_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p9_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__8c0_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p9_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p9_0 , <nl> 1 , - 518803456 , 1628680192 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 5 , 5 , 10 , 8 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 6 , <nl> 6 , 6 , 7 , 6 , 11 , 10 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 7 , 5 , <nl> 6 , 6 , 6 , 8 , 7 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 7 , 8 , <nl> static const long _vq_lengthlist__8c0_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p9_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__8c0_s_p9_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c0_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__8c0_s_p9_2 [ ] = { <nl> 1 , 5 , 5 , 7 , 7 , 8 , 7 , 8 , 8 , 10 , 10 , 9 , 9 , 10 , 10 , 10 , <nl> 11 , 11 , 10 , 12 , 11 , 12 , 12 , 12 , 9 , 8 , 8 , 8 , 8 , 8 , 9 , 10 , <nl> 10 , 10 , 10 , 11 , 11 , 11 , 10 , 11 , 11 , 12 , 12 , 11 , 12 , 8 , 8 , 7 , <nl> static const long _vq_lengthlist__8c0_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _8c0_s_p9_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__8c0_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__8c0_s_p9_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__8c0_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__8c0_s_single [ ] = { <nl> + static const char _huff_lengthlist__8c0_s_single [ ] = { <nl> 4 , 5 , 18 , 7 , 10 , 6 , 7 , 8 , 9 , 10 , 5 , 2 , 18 , 5 , 7 , 5 , <nl> 6 , 7 , 8 , 11 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 17 , 7 , 4 , <nl> 17 , 6 , 9 , 6 , 8 , 10 , 12 , 15 , 11 , 7 , 17 , 9 , 6 , 6 , 7 , 9 , <nl> static const long _huff_lengthlist__8c0_s_single [ ] = { <nl> <nl> static const static_codebook _huff_book__8c0_s_single = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__8c0_s_single , <nl> + ( char * ) _huff_lengthlist__8c0_s_single , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c1_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p3_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c1_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p4_0 [ ] = { <nl> 1 , 2 , 3 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c1_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p5_0 [ ] = { <nl> 1 , 3 , 3 , 4 , 5 , 6 , 6 , 8 , 8 , 0 , 0 , 0 , 8 , 8 , 7 , 7 , <nl> 9 , 9 , 0 , 0 , 0 , 8 , 8 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , 9 , 10 , <nl> 8 , 8 , 9 , 9 , 0 , 0 , 0 , 10 , 10 , 8 , 8 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__8c1_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p6_0 [ ] = { <nl> 1 , 3 , 3 , 5 , 5 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 11 , <nl> 11 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__8c1_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 10 , <nl> 9 , 9 , 5 , 7 , 7 , 10 , 9 , 9 , 10 , 9 , 9 , 6 , 10 , 10 , 10 , 10 , <nl> 10 , 11 , 10 , 10 , 6 , 9 , 9 , 10 , 9 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__8c1_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p7_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 7 , 7 , 7 , 7 , 7 , 7 , 10 , 10 , 9 , 7 , 7 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__8c1_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 10 , 11 , 11 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 11 , 11 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__8c1_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p8_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _8c1_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p9_0 [ ] = { <nl> 1 , 3 , 3 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 5 , 6 , 6 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 6 , 7 , 8 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__8c1_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p9_0 , <nl> 1 , - 513964032 , 1628680192 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 11 , 11 , 12 , 12 , 13 , 13 , 6 , <nl> 5 , 5 , 6 , 6 , 9 , 9 , 10 , 10 , 12 , 12 , 12 , 13 , 15 , 14 , 6 , 5 , <nl> 5 , 7 , 7 , 9 , 9 , 10 , 10 , 12 , 12 , 12 , 13 , 14 , 13 , 17 , 7 , 7 , <nl> static const long _vq_lengthlist__8c1_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p9_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__8c1_s_p9_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8c1_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__8c1_s_p9_2 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 11 , 11 , 12 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 11 , 11 , 11 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__8c1_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _8c1_s_p9_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__8c1_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__8c1_s_p9_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__8c1_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__8c1_s_single [ ] = { <nl> + static const char _huff_lengthlist__8c1_s_single [ ] = { <nl> 4 , 6 , 18 , 8 , 11 , 8 , 8 , 9 , 9 , 10 , 4 , 4 , 18 , 5 , 9 , 5 , <nl> 6 , 7 , 8 , 10 , 18 , 18 , 18 , 18 , 17 , 17 , 17 , 17 , 17 , 17 , 7 , 5 , <nl> 17 , 6 , 11 , 6 , 7 , 8 , 9 , 12 , 12 , 9 , 17 , 12 , 8 , 8 , 9 , 10 , <nl> static const long _huff_lengthlist__8c1_s_single [ ] = { <nl> <nl> static const static_codebook _huff_book__8c1_s_single = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__8c1_s_single , <nl> + ( char * ) _huff_lengthlist__8c1_s_single , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c2_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c2_s_long [ ] = { <nl> 6 , 6 , 12 , 10 , 10 , 10 , 9 , 10 , 12 , 12 , 6 , 1 , 10 , 5 , 6 , 6 , <nl> 7 , 9 , 11 , 14 , 12 , 9 , 8 , 11 , 7 , 8 , 9 , 11 , 13 , 15 , 10 , 5 , <nl> 12 , 7 , 8 , 7 , 9 , 12 , 14 , 15 , 10 , 6 , 7 , 8 , 5 , 6 , 7 , 9 , <nl> static const long _huff_lengthlist__44c2_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c2_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c2_s_long , <nl> + ( char * ) _huff_lengthlist__44c2_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p1_0 [ ] = { <nl> 2 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 6 , 6 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 6 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c2_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p2_0 [ ] = { <nl> 1 , 4 , 4 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , <nl> 8 , 8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 6 , 6 , 0 , 0 , 0 , 8 , <nl> 8 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 9 , 9 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c2_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p3_0 [ ] = { <nl> 2 , 4 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c2_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p4_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 6 , 6 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 6 , 6 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c2_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p5_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 9 , 9 , 0 , 7 , 7 , 7 , 7 , 7 , 7 , 9 , 9 , 0 , 8 , 8 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c2_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p6_0 [ ] = { <nl> 1 , 4 , 3 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 11 , 0 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44c2_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 10 , 9 , 9 , 7 , 10 , 10 , 11 , 10 , <nl> 11 , 11 , 10 , 11 , 6 , 9 , 9 , 11 , 10 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c2_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p7_1 [ ] = { <nl> 2 , 3 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 9 , 7 , 7 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c2_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 6 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 10 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c2_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p8_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 4 , 6 , 5 , 5 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c2_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p9_0 [ ] = { <nl> 1 , 5 , 4 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 4 , 9 , 8 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 2 , 8 , 7 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44c2_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p9_0 , <nl> 1 , - 514541568 , 1627103232 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p9_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 6 , 8 , 8 , 10 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 7 , 10 , 9 , 11 , 11 , 12 , 13 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 11 , 11 , 13 , 13 , 18 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c2_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p9_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p9_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c2_s_p9_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c2_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c2_s_p9_2 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 10 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c2_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c2_s_p9_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c2_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c2_s_p9_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c2_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c2_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c2_s_short [ ] = { <nl> 11 , 9 , 13 , 12 , 12 , 11 , 12 , 12 , 13 , 15 , 8 , 2 , 11 , 4 , 8 , 5 , <nl> 7 , 10 , 12 , 15 , 13 , 7 , 10 , 9 , 8 , 8 , 10 , 13 , 17 , 17 , 11 , 4 , <nl> 12 , 5 , 9 , 5 , 8 , 11 , 14 , 16 , 12 , 6 , 8 , 7 , 6 , 6 , 8 , 11 , <nl> static const long _huff_lengthlist__44c2_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c2_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c2_s_short , <nl> + ( char * ) _huff_lengthlist__44c2_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c3_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c3_s_long [ ] = { <nl> 5 , 6 , 11 , 11 , 11 , 11 , 10 , 10 , 12 , 11 , 5 , 2 , 11 , 5 , 6 , 6 , <nl> 7 , 9 , 11 , 13 , 13 , 10 , 7 , 11 , 6 , 7 , 8 , 9 , 10 , 12 , 11 , 5 , <nl> 11 , 6 , 8 , 7 , 9 , 11 , 14 , 15 , 11 , 6 , 6 , 8 , 4 , 5 , 7 , 8 , <nl> static const long _huff_lengthlist__44c3_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c3_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c3_s_long , <nl> + ( char * ) _huff_lengthlist__44c3_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p1_0 [ ] = { <nl> 2 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 6 , 6 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c3_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p2_0 [ ] = { <nl> 2 , 5 , 5 , 0 , 0 , 0 , 5 , 5 , 0 , 0 , 0 , 5 , 5 , 0 , 0 , 0 , <nl> 7 , 8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 6 , 6 , 0 , 0 , 0 , 7 , <nl> 7 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 10 , 10 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c3_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p3_0 [ ] = { <nl> 2 , 4 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c3_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p4_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 5 , 5 , 6 , 6 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c3_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p5_0 [ ] = { <nl> 1 , 3 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 5 , 5 , 7 , 7 , 7 , 8 , <nl> 9 , 9 , 0 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 0 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c3_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p6_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 10 , 0 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , <nl> 11 , 11 , 0 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c3_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 11 , 11 , <nl> 10 , 12 , 11 , 11 , 6 , 9 , 9 , 11 , 10 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c3_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c3_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 11 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c3_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p8_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , 4 , 5 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c3_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p9_0 [ ] = { <nl> 1 , 4 , 4 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 4 , 9 , 8 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 2 , 9 , 7 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> static const long _vq_lengthlist__44c3_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p9_0 , <nl> 1 , - 514332672 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 7 , 9 , 9 , 10 , 10 , 10 , 10 , 6 , <nl> 5 , 5 , 7 , 7 , 8 , 8 , 10 , 8 , 11 , 10 , 12 , 12 , 13 , 13 , 6 , 5 , <nl> 5 , 7 , 7 , 8 , 8 , 10 , 9 , 11 , 11 , 12 , 12 , 13 , 12 , 18 , 8 , 8 , <nl> static const long _vq_lengthlist__44c3_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p9_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c3_s_p9_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c3_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c3_s_p9_2 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 10 , 6 , 6 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c3_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c3_s_p9_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c3_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c3_s_p9_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c3_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c3_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c3_s_short [ ] = { <nl> 10 , 9 , 13 , 11 , 14 , 10 , 12 , 13 , 13 , 14 , 7 , 2 , 12 , 5 , 10 , 5 , <nl> 7 , 10 , 12 , 14 , 12 , 6 , 9 , 8 , 7 , 7 , 9 , 11 , 13 , 16 , 10 , 4 , <nl> 12 , 5 , 10 , 6 , 8 , 12 , 14 , 16 , 12 , 6 , 8 , 7 , 6 , 5 , 7 , 11 , <nl> static const long _huff_lengthlist__44c3_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c3_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c3_s_short , <nl> + ( char * ) _huff_lengthlist__44c3_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c4_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c4_s_long [ ] = { <nl> 4 , 7 , 11 , 11 , 11 , 11 , 10 , 11 , 12 , 11 , 5 , 2 , 11 , 5 , 6 , 6 , <nl> 7 , 9 , 11 , 12 , 11 , 9 , 6 , 10 , 6 , 7 , 8 , 9 , 10 , 11 , 11 , 5 , <nl> 11 , 7 , 8 , 8 , 9 , 11 , 13 , 14 , 11 , 6 , 5 , 8 , 4 , 5 , 7 , 8 , <nl> static const long _huff_lengthlist__44c4_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c4_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c4_s_long , <nl> + ( char * ) _huff_lengthlist__44c4_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p1_0 [ ] = { <nl> 2 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 6 , 6 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 6 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c4_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p2_0 [ ] = { <nl> 2 , 5 , 5 , 0 , 0 , 0 , 5 , 5 , 0 , 0 , 0 , 5 , 5 , 0 , 0 , 0 , <nl> 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 6 , 6 , 0 , 0 , 0 , 7 , <nl> 7 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 10 , 10 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c4_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p3_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c4_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p4_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 5 , 5 , 6 , 6 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c4_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 0 , 4 , 5 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 10 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c4_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p6_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 11 , 11 , 0 , 4 , 4 , 7 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44c4_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 11 , 11 , <nl> 10 , 11 , 11 , 11 , 6 , 9 , 9 , 11 , 10 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c4_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c4_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 10 , 11 , 11 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 11 , 11 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c4_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p8_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , 5 , 4 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c4_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p9_0 [ ] = { <nl> 1 , 3 , 3 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 4 , 7 , 7 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 3 , 8 , 8 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> static const long _vq_lengthlist__44c4_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p9_0 , <nl> 1 , - 513964032 , 1628680192 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 8 , 10 , 9 , 10 , 10 , 10 , 10 , 6 , <nl> 5 , 5 , 7 , 7 , 9 , 8 , 10 , 9 , 11 , 10 , 12 , 12 , 13 , 13 , 6 , 5 , <nl> 5 , 7 , 7 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 12 , 13 , 19 , 8 , 8 , <nl> static const long _vq_lengthlist__44c4_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p9_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c4_s_p9_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c4_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c4_s_p9_2 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 9 , 9 , 9 , 9 , 11 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , 11 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44c4_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c4_s_p9_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44c4_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c4_s_p9_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c4_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c4_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c4_s_short [ ] = { <nl> 4 , 7 , 14 , 10 , 15 , 10 , 12 , 15 , 16 , 15 , 4 , 2 , 11 , 5 , 10 , 6 , <nl> 8 , 11 , 14 , 14 , 14 , 10 , 7 , 11 , 6 , 8 , 10 , 11 , 13 , 15 , 9 , 4 , <nl> 11 , 5 , 9 , 6 , 9 , 12 , 14 , 15 , 14 , 9 , 6 , 9 , 4 , 5 , 7 , 10 , <nl> static const long _huff_lengthlist__44c4_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c4_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c4_s_short , <nl> + ( char * ) _huff_lengthlist__44c4_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c5_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c5_s_long [ ] = { <nl> 3 , 8 , 9 , 13 , 10 , 12 , 12 , 12 , 12 , 12 , 6 , 4 , 6 , 8 , 6 , 8 , <nl> 10 , 10 , 11 , 12 , 8 , 5 , 4 , 10 , 4 , 7 , 8 , 9 , 10 , 11 , 13 , 8 , <nl> 10 , 8 , 9 , 9 , 11 , 12 , 13 , 14 , 10 , 6 , 4 , 9 , 3 , 5 , 6 , 8 , <nl> static const long _huff_lengthlist__44c5_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c5_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c5_s_long , <nl> + ( char * ) _huff_lengthlist__44c5_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p1_0 [ ] = { <nl> 2 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 4 , 6 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c5_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p2_0 [ ] = { <nl> 2 , 4 , 4 , 0 , 0 , 0 , 5 , 5 , 0 , 0 , 0 , 5 , 5 , 0 , 0 , 0 , <nl> 8 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 6 , 6 , 0 , 0 , 0 , 8 , <nl> 8 , 0 , 0 , 0 , 8 , 7 , 0 , 0 , 0 , 10 , 10 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c5_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p3_0 [ ] = { <nl> 2 , 4 , 3 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c5_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p4_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 5 , 5 , 6 , 6 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c5_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p5_0 [ ] = { <nl> 2 , 4 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 9 , 9 , 0 , 0 , 0 , 7 , 6 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c5_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p6_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p6_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , 11 , <nl> 11 , 0 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 0 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44c5_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p6_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p6_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 11 , 11 , <nl> 10 , 11 , 11 , 11 , 6 , 9 , 9 , 11 , 10 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c5_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c5_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 9 , 10 , 10 , 10 , 10 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 10 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c5_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p8_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p8_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p8_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , 4 , 5 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c5_s_p8_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p8_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p9_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p9_0 [ ] = { <nl> 1 , 3 , 3 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 4 , <nl> 7 , 7 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 3 , 8 , <nl> 6 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , <nl> static const long _vq_lengthlist__44c5_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p9_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p9_0 , <nl> 1 , - 512522752 , 1628852224 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p9_1 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 8 , 10 , 9 , 10 , 10 , 11 , 10 , 11 , <nl> 11 , 6 , 5 , 5 , 7 , 7 , 8 , 9 , 10 , 10 , 11 , 10 , 12 , 11 , 12 , 11 , <nl> 13 , 12 , 6 , 5 , 5 , 7 , 7 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 13 , <nl> static const long _vq_lengthlist__44c5_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p9_1 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p9_1 , <nl> 1 , - 520814592 , 1620377600 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c5_s_p9_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c5_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c5_s_p9_2 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 9 , 11 , 5 , 6 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , 8 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 11 , 5 , 5 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44c5_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c5_s_p9_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44c5_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c5_s_p9_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c5_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c5_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c5_s_short [ ] = { <nl> 5 , 8 , 10 , 14 , 11 , 11 , 12 , 16 , 15 , 17 , 5 , 5 , 7 , 9 , 7 , 8 , <nl> 10 , 13 , 17 , 17 , 7 , 5 , 5 , 10 , 5 , 7 , 8 , 11 , 13 , 15 , 10 , 8 , <nl> 10 , 8 , 8 , 8 , 11 , 15 , 18 , 18 , 8 , 5 , 5 , 8 , 3 , 4 , 6 , 10 , <nl> static const long _huff_lengthlist__44c5_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c5_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c5_s_short , <nl> + ( char * ) _huff_lengthlist__44c5_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c6_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c6_s_long [ ] = { <nl> 3 , 8 , 11 , 13 , 14 , 14 , 13 , 13 , 16 , 14 , 6 , 3 , 4 , 7 , 9 , 9 , <nl> 10 , 11 , 14 , 13 , 10 , 4 , 3 , 5 , 7 , 7 , 9 , 10 , 13 , 15 , 12 , 7 , <nl> 4 , 4 , 6 , 6 , 8 , 10 , 13 , 15 , 12 , 8 , 6 , 6 , 6 , 6 , 8 , 10 , <nl> static const long _huff_lengthlist__44c6_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c6_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c6_s_long , <nl> + ( char * ) _huff_lengthlist__44c6_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 5 , 5 , 0 , 5 , 5 , 5 , 8 , 7 , 0 , 9 , 9 , 0 , <nl> 9 , 8 , 5 , 7 , 8 , 0 , 9 , 9 , 0 , 8 , 9 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 5 , 9 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 5 , 8 , 9 , <nl> static const long _vq_lengthlist__44c6_s_p1_0 [ ] = { <nl> } ; <nl> static const static_codebook _44c6_s_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p2_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , <nl> 7 , 7 , 9 , 9 , 0 , 0 , 0 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 0 , 8 , <nl> 8 , 10 , 10 , 0 , 8 , 7 , 10 , 9 , 0 , 10 , 10 , 11 , 11 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c6_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p3_0 [ ] = { <nl> 2 , 3 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 10 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 10 , 9 , 0 , 5 , 5 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 7 , 6 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c6_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p4_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 10 , 10 , <nl> 10 , 0 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , <nl> 11 , 11 , 0 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c6_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 6 , 7 , 7 , 4 , 6 , 6 , 9 , 9 , 10 , 10 , <nl> 10 , 9 , 4 , 6 , 6 , 9 , 10 , 9 , 10 , 9 , 10 , 6 , 9 , 9 , 10 , 12 , <nl> 11 , 10 , 11 , 11 , 7 , 10 , 9 , 11 , 12 , 12 , 12 , 12 , 12 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44c6_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p5_1 [ ] = { <nl> 3 , 5 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 11 , 4 , 4 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 11 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 11 , 6 , 6 , 6 , 6 , 8 , 8 , 8 , 8 , 9 , 9 , 11 , 11 , 11 , 6 , <nl> static const long _vq_lengthlist__44c6_s_p5_1 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p5_1 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 10 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , 6 , 5 , 5 , 7 , 7 , 9 , <nl> 9 , 10 , 9 , 11 , 10 , 11 , 11 , 0 , 6 , 6 , 7 , 7 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c6_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p6_1 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c6_s_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 10 , 10 , 11 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 12 , 11 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 12 , 11 , 21 , 7 , 7 , 7 , 7 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c6_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p7_1 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 9 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 7 , 7 , 8 , 7 , 8 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 9 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , 7 , 8 , 9 , 9 , 9 , 7 , <nl> static const long _vq_lengthlist__44c6_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 7 , 7 , 8 , 7 , 9 , 8 , 10 , 9 , 6 , <nl> 5 , 5 , 8 , 8 , 9 , 9 , 8 , 8 , 9 , 9 , 11 , 10 , 11 , 10 , 6 , 5 , <nl> 5 , 8 , 8 , 9 , 9 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 18 , 8 , 8 , <nl> static const long _vq_lengthlist__44c6_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p8_1 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44c6_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p9_0 [ ] = { <nl> 1 , 3 , 3 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 4 , 7 , 7 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 5 , 8 , 9 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44c6_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p9_0 , <nl> 1 , - 511845376 , 1630791680 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p9_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 7 , 6 , 8 , 8 , 8 , 8 , 6 , 6 , 6 , <nl> 8 , 8 , 8 , 8 , 8 , 7 , 9 , 8 , 10 , 10 , 5 , 6 , 6 , 8 , 8 , 9 , <nl> 9 , 8 , 8 , 10 , 10 , 10 , 10 , 16 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 8 , <nl> static const long _vq_lengthlist__44c6_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p9_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p9_1 , <nl> 1 , - 518889472 , 1622704128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c6_s_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c6_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c6_s_p9_2 [ ] = { <nl> 2 , 4 , 3 , 4 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44c6_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c6_s_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44c6_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c6_s_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44c6_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c6_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c6_s_short [ ] = { <nl> 3 , 9 , 11 , 11 , 13 , 14 , 19 , 17 , 17 , 19 , 5 , 4 , 5 , 8 , 10 , 10 , <nl> 13 , 16 , 18 , 19 , 7 , 4 , 4 , 5 , 8 , 9 , 12 , 14 , 17 , 19 , 8 , 6 , <nl> 5 , 5 , 7 , 7 , 10 , 13 , 16 , 18 , 10 , 8 , 7 , 6 , 5 , 5 , 8 , 11 , <nl> static const long _huff_lengthlist__44c6_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c6_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c6_s_short , <nl> + ( char * ) _huff_lengthlist__44c6_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c7_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c7_s_long [ ] = { <nl> 3 , 8 , 11 , 13 , 15 , 14 , 14 , 13 , 15 , 14 , 6 , 4 , 5 , 7 , 9 , 10 , <nl> 11 , 11 , 14 , 13 , 10 , 4 , 3 , 5 , 7 , 8 , 9 , 10 , 13 , 13 , 12 , 7 , <nl> 4 , 4 , 5 , 6 , 8 , 9 , 12 , 14 , 13 , 9 , 6 , 5 , 5 , 6 , 8 , 9 , <nl> static const long _huff_lengthlist__44c7_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c7_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c7_s_long , <nl> + ( char * ) _huff_lengthlist__44c7_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 5 , 5 , 0 , 5 , 5 , 5 , 8 , 7 , 0 , 9 , 9 , 0 , <nl> 9 , 8 , 5 , 7 , 8 , 0 , 9 , 9 , 0 , 8 , 9 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 5 , 9 , 9 , 0 , 8 , 8 , 0 , 8 , 8 , 5 , 8 , 9 , <nl> static const long _vq_lengthlist__44c7_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p2_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , <nl> 7 , 7 , 9 , 9 , 0 , 0 , 0 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 0 , 8 , <nl> 8 , 10 , 10 , 0 , 8 , 7 , 10 , 9 , 0 , 10 , 10 , 11 , 11 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c7_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p3_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 5 , 5 , 6 , 6 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 6 , 6 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c7_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p4_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44c7_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 6 , 7 , 7 , 4 , 6 , 7 , 10 , 10 , 10 , 10 , <nl> 10 , 9 , 4 , 6 , 6 , 10 , 10 , 10 , 10 , 9 , 10 , 5 , 10 , 10 , 9 , 11 , <nl> 12 , 10 , 11 , 12 , 7 , 10 , 10 , 11 , 12 , 12 , 12 , 12 , 12 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44c7_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p5_1 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 11 , 4 , 4 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 9 , 9 , 11 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , <nl> 9 , 12 , 5 , 5 , 6 , 6 , 7 , 7 , 9 , 9 , 9 , 9 , 12 , 12 , 12 , 6 , <nl> static const long _vq_lengthlist__44c7_s_p5_1 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p5_1 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 7 , 9 , 8 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 9 , 9 , 9 , 10 , 11 , 11 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 11 , 11 , 0 , 7 , 7 , 7 , 7 , 9 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44c7_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p6_1 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c7_s_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 8 , 9 , 9 , 10 , 10 , 12 , 11 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 9 , 10 , 11 , 11 , 12 , 12 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 11 , 11 , 12 , 12 , 20 , 7 , 7 , 7 , 7 , 8 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c7_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p7_1 [ ] = { <nl> 4 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 8 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 8 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 7 , <nl> static const long _vq_lengthlist__44c7_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 8 , 7 , 9 , 8 , 9 , 9 , 10 , 10 , 6 , <nl> 5 , 5 , 7 , 7 , 9 , 9 , 8 , 8 , 10 , 9 , 11 , 10 , 12 , 11 , 6 , 5 , <nl> 5 , 8 , 7 , 9 , 9 , 8 , 8 , 10 , 10 , 11 , 11 , 12 , 11 , 19 , 8 , 8 , <nl> static const long _vq_lengthlist__44c7_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p8_1 [ ] = { <nl> 3 , 5 , 5 , 7 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44c7_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p9_0 [ ] = { <nl> 1 , 3 , 3 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 4 , 6 , 6 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 4 , 7 , 7 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44c7_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p9_0 , <nl> 1 , - 511845376 , 1630791680 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p9_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 7 , 6 , 8 , 8 , 8 , 8 , 6 , 6 , 6 , <nl> 8 , 8 , 9 , 8 , 8 , 7 , 9 , 8 , 11 , 10 , 5 , 6 , 6 , 8 , 8 , 9 , <nl> 8 , 8 , 8 , 10 , 9 , 11 , 11 , 16 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , 8 , <nl> static const long _vq_lengthlist__44c7_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p9_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p9_1 , <nl> 1 , - 518889472 , 1622704128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c7_s_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c7_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c7_s_p9_2 [ ] = { <nl> 2 , 4 , 3 , 4 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44c7_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c7_s_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44c7_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c7_s_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44c7_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c7_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c7_s_short [ ] = { <nl> 4 , 11 , 12 , 14 , 15 , 15 , 17 , 17 , 18 , 18 , 5 , 6 , 6 , 8 , 9 , 10 , <nl> 13 , 17 , 18 , 19 , 7 , 5 , 4 , 6 , 8 , 9 , 11 , 15 , 19 , 19 , 8 , 6 , <nl> 5 , 5 , 6 , 7 , 11 , 14 , 16 , 17 , 9 , 7 , 7 , 6 , 7 , 7 , 10 , 13 , <nl> static const long _huff_lengthlist__44c7_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c7_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c7_s_short , <nl> + ( char * ) _huff_lengthlist__44c7_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c8_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c8_s_long [ ] = { <nl> 3 , 8 , 12 , 13 , 14 , 14 , 14 , 13 , 14 , 14 , 6 , 4 , 5 , 8 , 10 , 10 , <nl> 11 , 11 , 14 , 13 , 9 , 5 , 4 , 5 , 7 , 8 , 9 , 10 , 13 , 13 , 12 , 7 , <nl> 5 , 4 , 5 , 6 , 8 , 9 , 12 , 13 , 13 , 9 , 6 , 5 , 5 , 5 , 7 , 9 , <nl> static const long _huff_lengthlist__44c8_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c8_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c8_s_long , <nl> + ( char * ) _huff_lengthlist__44c8_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 5 , 5 , 0 , 5 , 5 , 5 , 7 , 7 , 0 , 9 , 8 , 0 , <nl> 9 , 8 , 6 , 7 , 7 , 0 , 8 , 9 , 0 , 8 , 9 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 5 , 9 , 8 , 0 , 8 , 8 , 0 , 8 , 8 , 5 , 8 , 9 , <nl> static const long _vq_lengthlist__44c8_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p2_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , <nl> 7 , 7 , 9 , 9 , 0 , 0 , 0 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 0 , 8 , <nl> 7 , 10 , 9 , 0 , 8 , 7 , 10 , 9 , 0 , 10 , 10 , 11 , 11 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c8_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p3_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 5 , 5 , 6 , 6 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 6 , 6 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c8_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p4_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 8 , 10 , 10 , 11 , 11 , <nl> 11 , 11 , 0 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44c8_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 6 , 7 , 7 , 4 , 7 , 6 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 4 , 6 , 6 , 10 , 10 , 10 , 10 , 9 , 10 , 5 , 10 , 10 , 9 , 11 , <nl> 11 , 10 , 11 , 11 , 7 , 10 , 10 , 11 , 12 , 12 , 12 , 12 , 12 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44c8_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p5_1 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 11 , 4 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 11 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 9 , 12 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 12 , 12 , 12 , 6 , <nl> static const long _vq_lengthlist__44c8_s_p5_1 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p5_1 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 11 , 11 , 0 , 7 , 7 , 7 , 7 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c8_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p6_1 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c8_s_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 7 , 9 , 9 , 10 , 10 , 12 , 12 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 12 , 12 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 11 , 11 , 12 , 12 , 21 , 7 , 7 , 7 , 7 , 8 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c8_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p7_1 [ ] = { <nl> 4 , 5 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 6 , 6 , 6 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 8 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 8 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 7 , <nl> static const long _vq_lengthlist__44c8_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 8 , 8 , 8 , 7 , 9 , 8 , 10 , 10 , 11 , 10 , 6 , <nl> 5 , 5 , 7 , 7 , 9 , 9 , 8 , 8 , 10 , 10 , 11 , 11 , 12 , 11 , 6 , 5 , <nl> 5 , 7 , 7 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 20 , 8 , 8 , <nl> static const long _vq_lengthlist__44c8_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p8_1 [ ] = { <nl> 4 , 5 , 5 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44c8_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p9_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p9_0 [ ] = { <nl> 1 , 4 , 3 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 4 , 7 , 7 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 4 , 8 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44c8_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p9_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p9_0 , <nl> 1 , - 509798400 , 1631393792 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p9_1 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 10 , <nl> 10 , 11 , 11 , 6 , 6 , 6 , 8 , 8 , 9 , 8 , 8 , 7 , 10 , 8 , 11 , 10 , <nl> 12 , 11 , 12 , 12 , 13 , 13 , 5 , 5 , 6 , 8 , 8 , 9 , 9 , 8 , 8 , 10 , <nl> static const long _vq_lengthlist__44c8_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p9_1 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p9_1 , <nl> 1 , - 518287360 , 1622704128 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c8_s_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c8_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c8_s_p9_2 [ ] = { <nl> 2 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 6 , 6 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44c8_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c8_s_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44c8_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c8_s_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44c8_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c8_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c8_s_short [ ] = { <nl> 4 , 11 , 13 , 14 , 15 , 15 , 18 , 17 , 19 , 17 , 5 , 6 , 8 , 9 , 10 , 10 , <nl> 12 , 15 , 19 , 19 , 6 , 6 , 6 , 6 , 8 , 8 , 11 , 14 , 18 , 19 , 8 , 6 , <nl> 5 , 4 , 6 , 7 , 10 , 13 , 16 , 17 , 9 , 7 , 6 , 5 , 6 , 7 , 9 , 12 , <nl> static const long _huff_lengthlist__44c8_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c8_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c8_s_short , <nl> + ( char * ) _huff_lengthlist__44c8_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c9_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c9_s_long [ ] = { <nl> 3 , 8 , 12 , 14 , 15 , 15 , 15 , 13 , 15 , 15 , 6 , 5 , 8 , 10 , 12 , 12 , <nl> 13 , 12 , 14 , 13 , 10 , 6 , 5 , 6 , 8 , 9 , 11 , 11 , 13 , 13 , 13 , 8 , <nl> 5 , 4 , 5 , 6 , 8 , 10 , 11 , 13 , 14 , 10 , 7 , 5 , 4 , 5 , 7 , 9 , <nl> static const long _huff_lengthlist__44c9_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c9_s_long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c9_s_long , <nl> + ( char * ) _huff_lengthlist__44c9_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 5 , 5 , 0 , 5 , 5 , 6 , 8 , 8 , 0 , 9 , 8 , 0 , <nl> 9 , 8 , 6 , 8 , 8 , 0 , 8 , 9 , 0 , 8 , 9 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 5 , 8 , 8 , 0 , 7 , 7 , 0 , 8 , 8 , 5 , 8 , 8 , <nl> static const long _vq_lengthlist__44c9_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p2_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , 5 , 5 , 8 , 8 , 0 , <nl> 7 , 7 , 9 , 9 , 0 , 0 , 0 , 9 , 9 , 6 , 7 , 7 , 9 , 8 , 0 , 8 , <nl> 8 , 9 , 9 , 0 , 8 , 7 , 9 , 9 , 0 , 9 , 10 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c9_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p3_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 6 , 6 , 8 , 8 , 0 , 4 , 4 , 5 , 5 , 6 , 7 , <nl> 8 , 8 , 0 , 4 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 0 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 9 , 9 , 0 , 0 , 0 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c9_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p4_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 10 , <nl> 10 , 0 , 5 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> 11 , 11 , 0 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44c9_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 6 , 7 , 7 , 4 , 7 , 6 , 9 , 10 , 10 , 10 , <nl> 10 , 9 , 4 , 6 , 7 , 9 , 10 , 10 , 10 , 9 , 10 , 5 , 9 , 9 , 9 , 11 , <nl> 11 , 10 , 11 , 11 , 7 , 10 , 9 , 11 , 12 , 11 , 12 , 12 , 12 , 7 , 9 , 10 , <nl> static const long _vq_lengthlist__44c9_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p5_1 [ ] = { <nl> 4 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 11 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 7 , 7 , 8 , 8 , 11 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , <nl> 8 , 11 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 11 , 11 , 11 , 6 , <nl> static const long _vq_lengthlist__44c9_s_p5_1 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p5_1 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p6_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 5 , 4 , 4 , <nl> 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 6 , 4 , 4 , 6 , 6 , 8 , <nl> 8 , 9 , 9 , 9 , 9 , 10 , 10 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44c9_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p6_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c9_s_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p7_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 6 , 4 , 4 , <nl> 6 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 12 , 12 , 6 , 4 , 5 , 6 , 6 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 12 , 12 , 20 , 6 , 6 , 6 , 6 , 8 , 8 , 9 , 10 , <nl> static const long _vq_lengthlist__44c9_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p7_1 [ ] = { <nl> 5 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 6 , 6 , 6 , 6 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 8 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 6 , <nl> static const long _vq_lengthlist__44c9_s_p7_1 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 10 , 6 , <nl> 5 , 5 , 7 , 7 , 9 , 9 , 8 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 6 , 5 , <nl> 5 , 7 , 7 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 21 , 7 , 8 , <nl> static const long _vq_lengthlist__44c9_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p8_1 [ ] = { <nl> 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44c9_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p9_0 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p9_0 [ ] = { <nl> 1 , 4 , 3 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 4 , 5 , 6 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 4 , 6 , 6 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> static const long _vq_lengthlist__44c9_s_p9_0 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p9_0 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p9_0 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p9_0 , <nl> 1 , - 508535424 , 1631393792 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p9_1 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 8 , 7 , 9 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 11 , 11 , 6 , 5 , 5 , 8 , 8 , 9 , 9 , 9 , 8 , 10 , 9 , 11 , 10 , <nl> 12 , 12 , 13 , 12 , 13 , 13 , 5 , 5 , 5 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44c9_s_p9_1 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p9_1 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p9_1 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p9_1 , <nl> 1 , - 518287360 , 1622704128 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44c9_s_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c9_s_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44c9_s_p9_2 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44c9_s_p9_2 [ ] = { <nl> <nl> static const static_codebook _44c9_s_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44c9_s_p9_2 , <nl> + ( char * ) _vq_lengthlist__44c9_s_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44c9_s_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c9_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c9_s_short [ ] = { <nl> 5 , 13 , 18 , 16 , 17 , 17 , 19 , 18 , 19 , 19 , 5 , 7 , 10 , 11 , 12 , 12 , <nl> 13 , 16 , 17 , 18 , 6 , 6 , 7 , 7 , 9 , 9 , 10 , 14 , 17 , 19 , 8 , 7 , <nl> 6 , 5 , 6 , 7 , 9 , 12 , 19 , 17 , 8 , 7 , 7 , 6 , 5 , 6 , 8 , 11 , <nl> static const long _huff_lengthlist__44c9_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c9_s_short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44c9_s_short , <nl> + ( char * ) _huff_lengthlist__44c9_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c0_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c0_s_long [ ] = { <nl> 5 , 4 , 8 , 9 , 8 , 9 , 10 , 12 , 15 , 4 , 1 , 5 , 5 , 6 , 8 , 11 , <nl> 12 , 12 , 8 , 5 , 8 , 9 , 9 , 11 , 13 , 12 , 12 , 9 , 5 , 8 , 5 , 7 , <nl> 9 , 12 , 13 , 13 , 8 , 6 , 8 , 7 , 7 , 9 , 11 , 11 , 11 , 9 , 7 , 9 , <nl> static const long _huff_lengthlist__44c0_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c0_s_long = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c0_s_long , <nl> + ( char * ) _huff_lengthlist__44c0_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p2_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 7 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p3_0 [ ] = { <nl> 1 , 3 , 2 , 8 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p4_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 6 , 6 , 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , <nl> 9 , 9 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , 7 , 7 , <nl> 7 , 8 , 9 , 9 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p5_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p5_0 [ ] = { <nl> 1 , 4 , 3 , 6 , 6 , 8 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> 11 , 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c0_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p5_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p5_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 10 , <nl> 9 , 9 , 4 , 6 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 11 , 11 , <nl> 11 , 12 , 10 , 11 , 6 , 9 , 9 , 11 , 10 , 11 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c0_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p6_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p6_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p6_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p6_1 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 8 , 10 , 10 , 10 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c0_s_p6_1 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p6_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p6_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 7 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 5 , 6 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 10 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c0_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p7_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p7_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c0_s_p7_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p7_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p8_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p8_0 [ ] = { <nl> 1 , 5 , 5 , 10 , 10 , 6 , 9 , 8 , 10 , 10 , 6 , 10 , 9 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c0_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p8_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p8_0 , <nl> 1 , - 518283264 , 1627103232 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p8_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p8_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 11 , 12 , 13 , 12 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 10 , 9 , 12 , 12 , 12 , 12 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 9 , 12 , 11 , 11 , 13 , 16 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c0_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p8_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p8_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c0_s_p8_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_s_p8_2 [ ] = { <nl> + static const char _vq_lengthlist__44c0_s_p8_2 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 10 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c0_s_p8_2 [ ] = { <nl> <nl> static const static_codebook _44c0_s_p8_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c0_s_p8_2 , <nl> + ( char * ) _vq_lengthlist__44c0_s_p8_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c0_s_p8_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c0_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c0_s_short [ ] = { <nl> 9 , 8 , 12 , 11 , 12 , 13 , 14 , 14 , 16 , 6 , 1 , 5 , 6 , 6 , 9 , 12 , <nl> 14 , 17 , 9 , 4 , 5 , 9 , 7 , 9 , 13 , 15 , 16 , 8 , 5 , 8 , 6 , 8 , <nl> 10 , 13 , 17 , 17 , 9 , 6 , 7 , 7 , 8 , 9 , 13 , 15 , 17 , 11 , 8 , 9 , <nl> static const long _huff_lengthlist__44c0_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c0_s_short = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c0_s_short , <nl> + ( char * ) _huff_lengthlist__44c0_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c0_sm_long [ ] = { <nl> + static const char _huff_lengthlist__44c0_sm_long [ ] = { <nl> 5 , 4 , 9 , 10 , 9 , 10 , 11 , 12 , 13 , 4 , 1 , 5 , 7 , 7 , 9 , 11 , <nl> 12 , 14 , 8 , 5 , 7 , 9 , 8 , 10 , 13 , 13 , 13 , 10 , 7 , 9 , 4 , 6 , <nl> 7 , 10 , 12 , 14 , 9 , 6 , 7 , 6 , 6 , 7 , 10 , 12 , 12 , 9 , 8 , 9 , <nl> static const long _huff_lengthlist__44c0_sm_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c0_sm_long = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c0_sm_long , <nl> + ( char * ) _huff_lengthlist__44c0_sm_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_sm_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p2_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_sm_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p3_0 [ ] = { <nl> 1 , 3 , 3 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 5 , 4 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 5 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 6 , 7 , 8 , 8 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_sm_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p4_0 [ ] = { <nl> 1 , 4 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 5 , 5 , 7 , 7 , 8 , 7 , <nl> 9 , 9 , 0 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 0 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c0_sm_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p5_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p5_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 11 , <nl> 11 , 11 , 0 , 5 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c0_sm_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p5_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p5_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 10 , 11 , <nl> 11 , 11 , 10 , 10 , 6 , 9 , 9 , 11 , 11 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c0_sm_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p6_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p6_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p6_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p6_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 8 , 9 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c0_sm_p6_1 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p6_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p6_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 7 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 6 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 10 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c0_sm_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p7_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p7_1 [ ] = { <nl> 2 , 4 , 4 , 4 , 4 , 6 , 5 , 5 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c0_sm_p7_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p7_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p8_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p8_0 [ ] = { <nl> 1 , 3 , 3 , 11 , 11 , 11 , 11 , 11 , 11 , 3 , 7 , 6 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 4 , 8 , 7 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44c0_sm_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p8_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p8_0 , <nl> 1 , - 516186112 , 1627103232 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p8_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p8_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 10 , 11 , 12 , 12 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 10 , 10 , 12 , 11 , 12 , 12 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 12 , 11 , 12 , 12 , 17 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44c0_sm_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p8_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p8_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c0_sm_p8_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c0_sm_p8_2 [ ] = { <nl> + static const char _vq_lengthlist__44c0_sm_p8_2 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 10 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 6 , 6 , 7 , 7 , 8 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c0_sm_p8_2 [ ] = { <nl> <nl> static const static_codebook _44c0_sm_p8_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c0_sm_p8_2 , <nl> + ( char * ) _vq_lengthlist__44c0_sm_p8_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c0_sm_p8_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c0_sm_short [ ] = { <nl> + static const char _huff_lengthlist__44c0_sm_short [ ] = { <nl> 6 , 6 , 12 , 13 , 13 , 14 , 16 , 17 , 17 , 4 , 2 , 5 , 8 , 7 , 9 , 12 , <nl> 15 , 15 , 9 , 4 , 5 , 9 , 7 , 9 , 12 , 16 , 18 , 11 , 6 , 7 , 4 , 6 , <nl> 8 , 11 , 14 , 18 , 10 , 5 , 6 , 5 , 5 , 7 , 10 , 14 , 17 , 10 , 5 , 7 , <nl> static const long _huff_lengthlist__44c0_sm_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c0_sm_short = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c0_sm_short , <nl> + ( char * ) _huff_lengthlist__44c0_sm_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c1_s_long [ ] = { <nl> + static const char _huff_lengthlist__44c1_s_long [ ] = { <nl> 5 , 5 , 9 , 10 , 9 , 9 , 10 , 11 , 12 , 5 , 1 , 5 , 6 , 6 , 7 , 10 , <nl> 12 , 14 , 9 , 5 , 6 , 8 , 8 , 10 , 12 , 14 , 14 , 10 , 5 , 8 , 5 , 6 , <nl> 8 , 11 , 13 , 14 , 9 , 5 , 7 , 6 , 6 , 8 , 10 , 12 , 11 , 9 , 7 , 9 , <nl> static const long _huff_lengthlist__44c1_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c1_s_long = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c1_s_long , <nl> + ( char * ) _huff_lengthlist__44c1_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p1_0 [ ] = { <nl> 2 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 6 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 6 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p2_0 [ ] = { <nl> 2 , 3 , 4 , 6 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p3_0 [ ] = { <nl> 1 , 3 , 2 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 13 , 13 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 12 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p4_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 5 , 6 , 6 , 8 , 8 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , <nl> 9 , 9 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p5_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p5_0 [ ] = { <nl> 1 , 4 , 3 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , <nl> 11 , 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c1_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p5_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p5_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 6 , 10 , 10 , 11 , 11 , <nl> 11 , 11 , 10 , 10 , 6 , 9 , 9 , 11 , 10 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c1_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p6_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p6_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p6_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p6_1 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 10 , 10 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c1_s_p6_1 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p6_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p6_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 9 , 7 , 5 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 10 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c1_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p7_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p7_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c1_s_p7_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p7_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p8_0 [ ] = { <nl> 1 , 4 , 3 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 4 , 8 , 6 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 4 , 8 , 7 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c1_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p8_0 , <nl> 1 , - 514541568 , 1627103232 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p8_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p8_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 5 , 7 , 7 , 9 , 9 , 10 , 10 , 12 , 12 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 10 , 10 , 12 , 11 , 12 , 12 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 11 , 11 , 12 , 12 , 15 , 7 , 7 , 8 , 8 , 9 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44c1_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p8_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p8_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c1_s_p8_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_s_p8_2 [ ] = { <nl> + static const char _vq_lengthlist__44c1_s_p8_2 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 10 , 10 , 7 , 7 , 8 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c1_s_p8_2 [ ] = { <nl> <nl> static const static_codebook _44c1_s_p8_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c1_s_p8_2 , <nl> + ( char * ) _vq_lengthlist__44c1_s_p8_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c1_s_p8_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c1_s_short [ ] = { <nl> + static const char _huff_lengthlist__44c1_s_short [ ] = { <nl> 6 , 8 , 13 , 12 , 13 , 14 , 15 , 16 , 16 , 4 , 2 , 4 , 7 , 6 , 8 , 11 , <nl> 13 , 15 , 10 , 4 , 4 , 8 , 6 , 8 , 11 , 14 , 17 , 11 , 5 , 6 , 5 , 6 , <nl> 8 , 12 , 14 , 17 , 11 , 5 , 5 , 6 , 5 , 7 , 10 , 13 , 16 , 12 , 6 , 7 , <nl> static const long _huff_lengthlist__44c1_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c1_s_short = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c1_s_short , <nl> + ( char * ) _huff_lengthlist__44c1_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c1_sm_long [ ] = { <nl> + static const char _huff_lengthlist__44c1_sm_long [ ] = { <nl> 5 , 4 , 8 , 10 , 9 , 9 , 10 , 11 , 12 , 4 , 2 , 5 , 6 , 6 , 8 , 10 , <nl> 11 , 13 , 8 , 4 , 6 , 8 , 7 , 9 , 12 , 12 , 14 , 10 , 6 , 8 , 4 , 5 , <nl> 6 , 9 , 11 , 12 , 9 , 5 , 6 , 5 , 5 , 6 , 9 , 11 , 11 , 9 , 7 , 9 , <nl> static const long _huff_lengthlist__44c1_sm_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44c1_sm_long = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c1_sm_long , <nl> + ( char * ) _huff_lengthlist__44c1_sm_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p1_0 [ ] = { <nl> 1 , 5 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_sm_p1_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p1_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p2_0 [ ] = { <nl> 2 , 3 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 4 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_sm_p2_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p2_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p3_0 [ ] = { <nl> 1 , 3 , 3 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 5 , 5 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 5 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_sm_p3_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p3_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p4_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , <nl> 9 , 9 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 0 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44c1_sm_p4_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p4_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p5_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 5 , 5 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , <nl> 11 , 11 , 0 , 5 , 5 , 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44c1_sm_p5_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p5_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p5_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p5_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 7 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 10 , 11 , <nl> 11 , 11 , 10 , 10 , 6 , 9 , 9 , 11 , 11 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44c1_sm_p6_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p6_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p6_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p6_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p6_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p6_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44c1_sm_p6_1 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p6_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p6_1 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p6_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 7 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 5 , 6 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 11 , 10 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c1_sm_p7_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p7_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p7_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p7_1 [ ] = { <nl> 2 , 4 , 4 , 4 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44c1_sm_p7_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p7_1 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p7_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p8_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p8_0 [ ] = { <nl> 1 , 3 , 3 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 3 , 6 , 6 , <nl> 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 4 , 8 , 7 , 13 , 13 , 13 , <nl> 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , <nl> static const long _vq_lengthlist__44c1_sm_p8_0 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p8_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p8_0 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p8_0 , <nl> 1 , - 514541568 , 1627103232 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p8_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p8_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 10 , 11 , 12 , 12 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 7 , 10 , 10 , 11 , 11 , 12 , 12 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 11 , 11 , 12 , 12 , 16 , 7 , 7 , 8 , 8 , 9 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44c1_sm_p8_1 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p8_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p8_1 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p8_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44c1_sm_p8_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44c1_sm_p8_2 [ ] = { <nl> + static const char _vq_lengthlist__44c1_sm_p8_2 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 10 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44c1_sm_p8_2 [ ] = { <nl> <nl> static const static_codebook _44c1_sm_p8_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44c1_sm_p8_2 , <nl> + ( char * ) _vq_lengthlist__44c1_sm_p8_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44c1_sm_p8_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44c1_sm_short [ ] = { <nl> + static const char _huff_lengthlist__44c1_sm_short [ ] = { <nl> 4 , 7 , 13 , 14 , 14 , 15 , 16 , 18 , 18 , 4 , 2 , 5 , 8 , 7 , 9 , 12 , <nl> 15 , 15 , 10 , 4 , 5 , 10 , 6 , 8 , 11 , 15 , 17 , 12 , 5 , 7 , 5 , 6 , <nl> 8 , 11 , 14 , 17 , 11 , 5 , 6 , 6 , 5 , 6 , 9 , 13 , 17 , 12 , 6 , 7 , <nl> static const long _huff_lengthlist__44c1_sm_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44c1_sm_short = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44c1_sm_short , <nl> + ( char * ) _huff_lengthlist__44c1_sm_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44cn1_s_long [ ] = { <nl> + static const char _huff_lengthlist__44cn1_s_long [ ] = { <nl> 4 , 4 , 7 , 8 , 7 , 8 , 10 , 12 , 17 , 3 , 1 , 6 , 6 , 7 , 8 , 10 , <nl> 12 , 15 , 7 , 6 , 9 , 9 , 9 , 11 , 12 , 14 , 17 , 8 , 6 , 9 , 6 , 7 , <nl> 9 , 11 , 13 , 17 , 7 , 6 , 9 , 7 , 7 , 8 , 9 , 12 , 15 , 8 , 8 , 10 , <nl> static const long _huff_lengthlist__44cn1_s_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44cn1_s_long = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44cn1_s_long , <nl> + ( char * ) _huff_lengthlist__44cn1_s_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p1_0 [ ] = { <nl> 1 , 4 , 4 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_s_p1_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p1_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p2_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_s_p2_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p2_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p3_0 [ ] = { <nl> 1 , 2 , 3 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_s_p3_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p3_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p4_0 [ ] = { <nl> 1 , 3 , 3 , 6 , 6 , 6 , 6 , 8 , 8 , 0 , 0 , 0 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 0 , 0 , 0 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 0 , 0 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_s_p4_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p4_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p5_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p5_0 [ ] = { <nl> 1 , 4 , 3 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 10 , <nl> 10 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , <nl> 11 , 11 , 0 , 0 , 0 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44cn1_s_p5_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p5_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p5_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p5_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 6 , 6 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 6 , 6 , 10 , 9 , 9 , 10 , 9 , 9 , 7 , 10 , 10 , 11 , 11 , <nl> 11 , 12 , 11 , 11 , 7 , 9 , 9 , 11 , 11 , 10 , 11 , 10 , 10 , 7 , 9 , 9 , <nl> static const long _vq_lengthlist__44cn1_s_p6_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p6_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p6_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p6_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p6_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p6_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , 6 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 10 , 10 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44cn1_s_p6_1 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p6_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p6_1 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p6_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 11 , 11 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 10 , 11 , 11 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44cn1_s_p7_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p7_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p7_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p7_1 [ ] = { <nl> 2 , 3 , 3 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , 6 , <nl> 6 , 6 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44cn1_s_p7_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p7_1 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p7_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p8_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p8_0 [ ] = { <nl> 1 , 7 , 7 , 11 , 11 , 8 , 11 , 11 , 11 , 11 , 4 , 11 , 3 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 10 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44cn1_s_p8_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p8_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p8_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p8_0 , <nl> 1 , - 518283264 , 1627103232 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p8_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p8_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 10 , 10 , 11 , 11 , 11 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 9 , 10 , 9 , 11 , 11 , 12 , 5 , 5 , 5 , 7 , 7 , 8 , <nl> 9 , 10 , 10 , 12 , 12 , 14 , 13 , 15 , 7 , 7 , 8 , 8 , 9 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44cn1_s_p8_1 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p8_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p8_1 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p8_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_s_p8_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_s_p8_2 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_s_p8_2 [ ] = { <nl> 3 , 4 , 3 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 10 , 11 , 11 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 10 , 10 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44cn1_s_p8_2 [ ] = { <nl> <nl> static const static_codebook _44cn1_s_p8_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44cn1_s_p8_2 , <nl> + ( char * ) _vq_lengthlist__44cn1_s_p8_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_s_p8_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44cn1_s_short [ ] = { <nl> + static const char _huff_lengthlist__44cn1_s_short [ ] = { <nl> 10 , 9 , 12 , 15 , 12 , 13 , 16 , 14 , 16 , 7 , 1 , 5 , 14 , 7 , 10 , 13 , <nl> 16 , 16 , 9 , 4 , 6 , 16 , 8 , 11 , 16 , 16 , 16 , 14 , 4 , 7 , 16 , 9 , <nl> 12 , 14 , 16 , 16 , 10 , 5 , 7 , 14 , 9 , 12 , 14 , 15 , 15 , 13 , 8 , 9 , <nl> static const long _huff_lengthlist__44cn1_s_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44cn1_s_short = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44cn1_s_short , <nl> + ( char * ) _huff_lengthlist__44cn1_s_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44cn1_sm_long [ ] = { <nl> + static const char _huff_lengthlist__44cn1_sm_long [ ] = { <nl> 3 , 3 , 8 , 8 , 8 , 8 , 10 , 12 , 14 , 3 , 2 , 6 , 7 , 7 , 8 , 10 , <nl> 12 , 16 , 7 , 6 , 7 , 9 , 8 , 10 , 12 , 14 , 16 , 8 , 6 , 8 , 4 , 5 , <nl> 7 , 9 , 11 , 13 , 7 , 6 , 8 , 5 , 6 , 7 , 9 , 11 , 14 , 8 , 8 , 10 , <nl> static const long _huff_lengthlist__44cn1_sm_long [ ] = { <nl> <nl> static const static_codebook _huff_book__44cn1_sm_long = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44cn1_sm_long , <nl> + ( char * ) _huff_lengthlist__44cn1_sm_long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p1_0 [ ] = { <nl> 1 , 4 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_sm_p1_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p1_0 = { <nl> 8 , 6561 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p1_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p2_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 5 , 5 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_sm_p2_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p2_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p3_0 [ ] = { <nl> 1 , 3 , 4 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 4 , 4 , 7 , 7 , 0 , 0 , <nl> 0 , 0 , 0 , 4 , 5 , 7 , 7 , 0 , 0 , 0 , 0 , 0 , 6 , 7 , 8 , 8 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 8 , 8 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_sm_p3_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p3_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p4_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p4_0 [ ] = { <nl> 1 , 4 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 0 , 5 , 5 , 7 , 7 , 8 , 7 , <nl> 9 , 9 , 0 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 0 , 7 , 7 , 8 , 8 , <nl> 8 , 8 , 10 , 10 , 0 , 0 , 0 , 8 , 8 , 8 , 8 , 10 , 10 , 0 , 0 , 0 , <nl> static const long _vq_lengthlist__44cn1_sm_p4_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p4_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p4_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p4_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p5_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p5_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 0 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 0 , 6 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44cn1_sm_p5_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p5_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p5_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p5_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p6_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 6 , 7 , 6 , 6 , 4 , 7 , 6 , 10 , 9 , 9 , 11 , <nl> 9 , 9 , 4 , 6 , 7 , 10 , 9 , 9 , 11 , 9 , 9 , 7 , 10 , 10 , 10 , 11 , <nl> 11 , 11 , 11 , 10 , 6 , 9 , 9 , 11 , 10 , 10 , 11 , 10 , 10 , 6 , 9 , 9 , <nl> static const long _vq_lengthlist__44cn1_sm_p6_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p6_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p6_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p6_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p6_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 7 , 7 , 7 , 7 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 10 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 10 , 10 , 10 , 7 , <nl> static const long _vq_lengthlist__44cn1_sm_p6_1 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p6_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p6_1 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p6_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p7_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 9 , 9 , 10 , 10 , 7 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 10 , 9 , 11 , 10 , 7 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 10 , 11 , 11 , 0 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44cn1_sm_p7_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p7_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p7_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p7_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p7_1 [ ] = { <nl> 2 , 4 , 4 , 4 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , 5 , 5 , 5 , 5 , 6 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44cn1_sm_p7_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p7_1 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p7_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p8_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p8_0 [ ] = { <nl> 1 , 4 , 4 , 12 , 11 , 13 , 13 , 14 , 14 , 4 , 7 , 7 , 11 , 13 , 14 , 14 , <nl> 14 , 14 , 3 , 8 , 3 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 10 , 12 , 14 , 14 , <nl> 14 , 14 , 14 , 14 , 14 , 14 , 5 , 14 , 8 , 14 , 14 , 14 , 14 , 14 , 12 , 14 , <nl> static const long _vq_lengthlist__44cn1_sm_p8_0 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p8_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p8_0 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p8_0 , <nl> 1 , - 516186112 , 1627103232 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p8_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p8_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 10 , 11 , 11 , 11 , 6 , 5 , 5 , <nl> 7 , 7 , 8 , 8 , 10 , 10 , 10 , 11 , 11 , 11 , 6 , 5 , 5 , 7 , 7 , 8 , <nl> 8 , 10 , 10 , 11 , 12 , 12 , 12 , 14 , 7 , 7 , 7 , 8 , 9 , 9 , 11 , 11 , <nl> static const long _vq_lengthlist__44cn1_sm_p8_1 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p8_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p8_1 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p8_1 , <nl> 1 , - 522616832 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44cn1_sm_p8_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44cn1_sm_p8_2 [ ] = { <nl> + static const char _vq_lengthlist__44cn1_sm_p8_2 [ ] = { <nl> 3 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 10 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44cn1_sm_p8_2 [ ] = { <nl> <nl> static const static_codebook _44cn1_sm_p8_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44cn1_sm_p8_2 , <nl> + ( char * ) _vq_lengthlist__44cn1_sm_p8_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44cn1_sm_p8_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44cn1_sm_short [ ] = { <nl> + static const char _huff_lengthlist__44cn1_sm_short [ ] = { <nl> 5 , 6 , 12 , 14 , 12 , 14 , 16 , 17 , 18 , 4 , 2 , 5 , 11 , 7 , 10 , 12 , <nl> 14 , 15 , 9 , 4 , 5 , 11 , 7 , 10 , 13 , 15 , 18 , 15 , 6 , 7 , 5 , 6 , <nl> 8 , 11 , 13 , 16 , 11 , 5 , 6 , 5 , 5 , 6 , 9 , 13 , 15 , 12 , 5 , 7 , <nl> static const long _huff_lengthlist__44cn1_sm_short [ ] = { <nl> <nl> static const static_codebook _huff_book__44cn1_sm_short = { <nl> 2 , 81 , <nl> - ( long * ) _huff_lengthlist__44cn1_sm_short , <nl> + ( char * ) _huff_lengthlist__44cn1_sm_short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> deleted file mode 100644 <nl> index 272ab1a28c6 . . 00000000000 <nl> mmm a / drivers / vorbis / books / floor / Makefile . am <nl> ppp / dev / null <nl> <nl> - # # Process this file with automake to produce Makefile . in <nl> - <nl> - EXTRA_DIST = floor_books . h <nl> deleted file mode 100644 <nl> index 6148dc21f1d . . 00000000000 <nl> mmm a / drivers / vorbis / books / floor / Makefile . in <nl> ppp / dev / null <nl> <nl> - # Makefile . in generated by automake 1 . 10 . 2 from Makefile . am . <nl> - # @ configure_input @ <nl> - <nl> - # Copyright ( C ) 1994 , 1995 , 1996 , 1997 , 1998 , 1999 , 2000 , 2001 , 2002 , <nl> - # 2003 , 2004 , 2005 , 2006 , 2007 , 2008 Free Software Foundation , Inc . <nl> - # This Makefile . in is free software ; the Free Software Foundation <nl> - # gives unlimited permission to copy and / or distribute it , <nl> - # with or without modifications , as long as this notice is preserved . <nl> - <nl> - # This program is distributed in the hope that it will be useful , <nl> - # but WITHOUT ANY WARRANTY , to the extent permitted by law ; without <nl> - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A <nl> - # PARTICULAR PURPOSE . <nl> - <nl> - @ SET_MAKE @ <nl> - VPATH = @ srcdir @ <nl> - pkgdatadir = $ ( datadir ) / @ PACKAGE @ <nl> - pkglibdir = $ ( libdir ) / @ PACKAGE @ <nl> - pkgincludedir = $ ( includedir ) / @ PACKAGE @ <nl> - am__cd = CDPATH = " $ $ { ZSH_VERSION + . } $ ( PATH_SEPARATOR ) " & & cd <nl> - install_sh_DATA = $ ( install_sh ) - c - m 644 <nl> - install_sh_PROGRAM = $ ( install_sh ) - c <nl> - install_sh_SCRIPT = $ ( install_sh ) - c <nl> - INSTALL_HEADER = $ ( INSTALL_DATA ) <nl> - transform = $ ( program_transform_name ) <nl> - NORMAL_INSTALL = : <nl> - PRE_INSTALL = : <nl> - POST_INSTALL = : <nl> - NORMAL_UNINSTALL = : <nl> - PRE_UNINSTALL = : <nl> - POST_UNINSTALL = : <nl> - build_triplet = @ build @ <nl> - host_triplet = @ host @ <nl> - target_triplet = @ target @ <nl> - subdir = lib / books / floor <nl> - DIST_COMMON = $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . in <nl> - ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> - am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / add_cflags . m4 \ <nl> - $ ( top_srcdir ) / m4 / ogg . m4 $ ( top_srcdir ) / m4 / pkg . m4 \ <nl> - $ ( top_srcdir ) / configure . ac <nl> - am__configure_deps = $ ( am__aclocal_m4_deps ) $ ( CONFIGURE_DEPENDENCIES ) \ <nl> - $ ( ACLOCAL_M4 ) <nl> - mkinstalldirs = $ ( install_sh ) - d <nl> - CONFIG_HEADER = $ ( top_builddir ) / config . h <nl> - CONFIG_CLEAN_FILES = <nl> - SOURCES = <nl> - DIST_SOURCES = <nl> - DISTFILES = $ ( DIST_COMMON ) $ ( DIST_SOURCES ) $ ( TEXINFOS ) $ ( EXTRA_DIST ) <nl> - ACLOCAL = @ ACLOCAL @ <nl> - ACLOCAL_AMFLAGS = @ ACLOCAL_AMFLAGS @ <nl> - ALLOCA = @ ALLOCA @ <nl> - AMTAR = @ AMTAR @ <nl> - AR = @ AR @ <nl> - AS = @ AS @ <nl> - AUTOCONF = @ AUTOCONF @ <nl> - AUTOHEADER = @ AUTOHEADER @ <nl> - AUTOMAKE = @ AUTOMAKE @ <nl> - AWK = @ AWK @ <nl> - CC = @ CC @ <nl> - CCDEPMODE = @ CCDEPMODE @ <nl> - CFLAGS = @ CFLAGS @ <nl> - CPP = @ CPP @ <nl> - CPPFLAGS = @ CPPFLAGS @ <nl> - CYGPATH_W = @ CYGPATH_W @ <nl> - DEBUG = @ DEBUG @ <nl> - DEFS = @ DEFS @ <nl> - DEPDIR = @ DEPDIR @ <nl> - DLLTOOL = @ DLLTOOL @ <nl> - DSYMUTIL = @ DSYMUTIL @ <nl> - DUMPBIN = @ DUMPBIN @ <nl> - ECHO_C = @ ECHO_C @ <nl> - ECHO_N = @ ECHO_N @ <nl> - ECHO_T = @ ECHO_T @ <nl> - EGREP = @ EGREP @ <nl> - EXEEXT = @ EXEEXT @ <nl> - FGREP = @ FGREP @ <nl> - GREP = @ GREP @ <nl> - HAVE_DOXYGEN = @ HAVE_DOXYGEN @ <nl> - HTLATEX = @ HTLATEX @ <nl> - INSTALL = @ INSTALL @ <nl> - INSTALL_DATA = @ INSTALL_DATA @ <nl> - INSTALL_PROGRAM = @ INSTALL_PROGRAM @ <nl> - INSTALL_SCRIPT = @ INSTALL_SCRIPT @ <nl> - INSTALL_STRIP_PROGRAM = @ INSTALL_STRIP_PROGRAM @ <nl> - LD = @ LD @ <nl> - LDFLAGS = @ LDFLAGS @ <nl> - LIBOBJS = @ LIBOBJS @ <nl> - LIBS = @ LIBS @ <nl> - LIBTOOL = @ LIBTOOL @ <nl> - LIBTOOL_DEPS = @ LIBTOOL_DEPS @ <nl> - LIPO = @ LIPO @ <nl> - LN_S = @ LN_S @ <nl> - LTLIBOBJS = @ LTLIBOBJS @ <nl> - MAINT = @ MAINT @ <nl> - MAKEINFO = @ MAKEINFO @ <nl> - MKDIR_P = @ MKDIR_P @ <nl> - NM = @ NM @ <nl> - NMEDIT = @ NMEDIT @ <nl> - OBJDUMP = @ OBJDUMP @ <nl> - OBJEXT = @ OBJEXT @ <nl> - OGG_CFLAGS = @ OGG_CFLAGS @ <nl> - OGG_LIBS = @ OGG_LIBS @ <nl> - OTOOL = @ OTOOL @ <nl> - OTOOL64 = @ OTOOL64 @ <nl> - PACKAGE = @ PACKAGE @ <nl> - PACKAGE_BUGREPORT = @ PACKAGE_BUGREPORT @ <nl> - PACKAGE_NAME = @ PACKAGE_NAME @ <nl> - PACKAGE_STRING = @ PACKAGE_STRING @ <nl> - PACKAGE_TARNAME = @ PACKAGE_TARNAME @ <nl> - PACKAGE_VERSION = @ PACKAGE_VERSION @ <nl> - PATH_SEPARATOR = @ PATH_SEPARATOR @ <nl> - PDFLATEX = @ PDFLATEX @ <nl> - PKG_CONFIG = @ PKG_CONFIG @ <nl> - PROFILE = @ PROFILE @ <nl> - RANLIB = @ RANLIB @ <nl> - SED = @ SED @ <nl> - SET_MAKE = @ SET_MAKE @ <nl> - SHELL = @ SHELL @ <nl> - STRIP = @ STRIP @ <nl> - VERSION = @ VERSION @ <nl> - VE_LIB_AGE = @ VE_LIB_AGE @ <nl> - VE_LIB_CURRENT = @ VE_LIB_CURRENT @ <nl> - VE_LIB_REVISION = @ VE_LIB_REVISION @ <nl> - VF_LIB_AGE = @ VF_LIB_AGE @ <nl> - VF_LIB_CURRENT = @ VF_LIB_CURRENT @ <nl> - VF_LIB_REVISION = @ VF_LIB_REVISION @ <nl> - VORBIS_LIBS = @ VORBIS_LIBS @ <nl> - V_LIB_AGE = @ V_LIB_AGE @ <nl> - V_LIB_CURRENT = @ V_LIB_CURRENT @ <nl> - V_LIB_REVISION = @ V_LIB_REVISION @ <nl> - abs_builddir = @ abs_builddir @ <nl> - abs_srcdir = @ abs_srcdir @ <nl> - abs_top_builddir = @ abs_top_builddir @ <nl> - abs_top_srcdir = @ abs_top_srcdir @ <nl> - ac_ct_CC = @ ac_ct_CC @ <nl> - ac_ct_DUMPBIN = @ ac_ct_DUMPBIN @ <nl> - am__include = @ am__include @ <nl> - am__leading_dot = @ am__leading_dot @ <nl> - am__quote = @ am__quote @ <nl> - am__tar = @ am__tar @ <nl> - am__untar = @ am__untar @ <nl> - bindir = @ bindir @ <nl> - build = @ build @ <nl> - build_alias = @ build_alias @ <nl> - build_cpu = @ build_cpu @ <nl> - build_os = @ build_os @ <nl> - build_vendor = @ build_vendor @ <nl> - builddir = @ builddir @ <nl> - datadir = @ datadir @ <nl> - datarootdir = @ datarootdir @ <nl> - docdir = @ docdir @ <nl> - dvidir = @ dvidir @ <nl> - exec_prefix = @ exec_prefix @ <nl> - host = @ host @ <nl> - host_alias = @ host_alias @ <nl> - host_cpu = @ host_cpu @ <nl> - host_os = @ host_os @ <nl> - host_vendor = @ host_vendor @ <nl> - htmldir = @ htmldir @ <nl> - includedir = @ includedir @ <nl> - infodir = @ infodir @ <nl> - install_sh = @ install_sh @ <nl> - libdir = @ libdir @ <nl> - libexecdir = @ libexecdir @ <nl> - localedir = @ localedir @ <nl> - localstatedir = @ localstatedir @ <nl> - lt_ECHO = @ lt_ECHO @ <nl> - mandir = @ mandir @ <nl> - mkdir_p = @ mkdir_p @ <nl> - oldincludedir = @ oldincludedir @ <nl> - pdfdir = @ pdfdir @ <nl> - prefix = @ prefix @ <nl> - program_transform_name = @ program_transform_name @ <nl> - psdir = @ psdir @ <nl> - pthread_lib = @ pthread_lib @ <nl> - sbindir = @ sbindir @ <nl> - sharedstatedir = @ sharedstatedir @ <nl> - srcdir = @ srcdir @ <nl> - sysconfdir = @ sysconfdir @ <nl> - target = @ target @ <nl> - target_alias = @ target_alias @ <nl> - target_cpu = @ target_cpu @ <nl> - target_os = @ target_os @ <nl> - target_vendor = @ target_vendor @ <nl> - top_builddir = @ top_builddir @ <nl> - top_srcdir = @ top_srcdir @ <nl> - EXTRA_DIST = floor_books . h <nl> - all : all - am <nl> - <nl> - . SUFFIXES : <nl> - $ ( srcdir ) / Makefile . in : @ MAINTAINER_MODE_TRUE @ $ ( srcdir ) / Makefile . am $ ( am__configure_deps ) <nl> - @ for dep in $ ? ; do \ <nl> - case ' $ ( am__configure_deps ) ' in \ <nl> - * $ $ dep * ) \ <nl> - ( cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ) \ <nl> - & & { if test - f $ @ ; then exit 0 ; else break ; fi ; } ; \ <nl> - exit 1 ; ; \ <nl> - esac ; \ <nl> - done ; \ <nl> - echo ' cd $ ( top_srcdir ) & & $ ( AUTOMAKE ) - - gnu lib / books / floor / Makefile ' ; \ <nl> - cd $ ( top_srcdir ) & & \ <nl> - $ ( AUTOMAKE ) - - gnu lib / books / floor / Makefile <nl> - . PRECIOUS : Makefile <nl> - Makefile : $ ( srcdir ) / Makefile . in $ ( top_builddir ) / config . status <nl> - @ case ' $ ? ' in \ <nl> - * config . status * ) \ <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ; ; \ <nl> - * ) \ <nl> - echo ' cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ' ; \ <nl> - cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ; ; \ <nl> - esac ; <nl> - <nl> - $ ( top_builddir ) / config . status : $ ( top_srcdir ) / configure $ ( CONFIG_STATUS_DEPENDENCIES ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - $ ( top_srcdir ) / configure : @ MAINTAINER_MODE_TRUE @ $ ( am__configure_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - $ ( ACLOCAL_M4 ) : @ MAINTAINER_MODE_TRUE @ $ ( am__aclocal_m4_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - mostlyclean - libtool : <nl> - - rm - f * . lo <nl> - <nl> - clean - libtool : <nl> - - rm - rf . libs _libs <nl> - tags : TAGS <nl> - TAGS : <nl> - <nl> - ctags : CTAGS <nl> - CTAGS : <nl> - <nl> - <nl> - distdir : $ ( DISTFILES ) <nl> - @ srcdirstrip = ` echo " $ ( srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - topsrcdirstrip = ` echo " $ ( top_srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - list = ' $ ( DISTFILES ) ' ; \ <nl> - dist_files = ` for file in $ $ list ; do echo $ $ file ; done | \ <nl> - sed - e " s | ^ $ $ srcdirstrip / | | ; t " \ <nl> - - e " s | ^ $ $ topsrcdirstrip / | $ ( top_builddir ) / | ; t " ` ; \ <nl> - case $ $ dist_files in \ <nl> - * / * ) $ ( MKDIR_P ) ` echo " $ $ dist_files " | \ <nl> - sed ' / \ / / ! d ; s | ^ | $ ( distdir ) / | ; s , / [ ^ / ] * $ $ , , ' | \ <nl> - sort - u ` ; ; \ <nl> - esac ; \ <nl> - for file in $ $ dist_files ; do \ <nl> - if test - f $ $ file | | test - d $ $ file ; then d = . ; else d = $ ( srcdir ) ; fi ; \ <nl> - if test - d $ $ d / $ $ file ; then \ <nl> - dir = ` echo " / $ $ file " | sed - e ' s , / [ ^ / ] * $ $ , , ' ` ; \ <nl> - if test - d $ ( srcdir ) / $ $ file & & test $ $ d ! = $ ( srcdir ) ; then \ <nl> - cp - pR $ ( srcdir ) / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - fi ; \ <nl> - cp - pR $ $ d / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - else \ <nl> - test - f $ ( distdir ) / $ $ file \ <nl> - | | cp - p $ $ d / $ $ file $ ( distdir ) / $ $ file \ <nl> - | | exit 1 ; \ <nl> - fi ; \ <nl> - done <nl> - check - am : all - am <nl> - check : check - am <nl> - all - am : Makefile <nl> - installdirs : <nl> - install : install - am <nl> - install - exec : install - exec - am <nl> - install - data : install - data - am <nl> - uninstall : uninstall - am <nl> - <nl> - install - am : all - am <nl> - @ $ ( MAKE ) $ ( AM_MAKEFLAGS ) install - exec - am install - data - am <nl> - <nl> - installcheck : installcheck - am <nl> - install - strip : <nl> - $ ( MAKE ) $ ( AM_MAKEFLAGS ) INSTALL_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " \ <nl> - install_sh_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " INSTALL_STRIP_FLAG = - s \ <nl> - ` test - z ' $ ( STRIP ) ' | | \ <nl> - echo " INSTALL_PROGRAM_ENV = STRIPPROG = ' $ ( STRIP ) ' " ` install <nl> - mostlyclean - generic : <nl> - <nl> - clean - generic : <nl> - <nl> - distclean - generic : <nl> - - test - z " $ ( CONFIG_CLEAN_FILES ) " | | rm - f $ ( CONFIG_CLEAN_FILES ) <nl> - <nl> - maintainer - clean - generic : <nl> - @ echo " This command is intended for maintainers to use " <nl> - @ echo " it deletes files that may require special tools to rebuild . " <nl> - clean : clean - am <nl> - <nl> - clean - am : clean - generic clean - libtool mostlyclean - am <nl> - <nl> - distclean : distclean - am <nl> - - rm - f Makefile <nl> - distclean - am : clean - am distclean - generic <nl> - <nl> - dvi : dvi - am <nl> - <nl> - dvi - am : <nl> - <nl> - html : html - am <nl> - <nl> - info : info - am <nl> - <nl> - info - am : <nl> - <nl> - install - data - am : <nl> - <nl> - install - dvi : install - dvi - am <nl> - <nl> - install - exec - am : <nl> - <nl> - install - html : install - html - am <nl> - <nl> - install - info : install - info - am <nl> - <nl> - install - man : <nl> - <nl> - install - pdf : install - pdf - am <nl> - <nl> - install - ps : install - ps - am <nl> - <nl> - installcheck - am : <nl> - <nl> - maintainer - clean : maintainer - clean - am <nl> - - rm - f Makefile <nl> - maintainer - clean - am : distclean - am maintainer - clean - generic <nl> - <nl> - mostlyclean : mostlyclean - am <nl> - <nl> - mostlyclean - am : mostlyclean - generic mostlyclean - libtool <nl> - <nl> - pdf : pdf - am <nl> - <nl> - pdf - am : <nl> - <nl> - ps : ps - am <nl> - <nl> - ps - am : <nl> - <nl> - uninstall - am : <nl> - <nl> - . MAKE : install - am install - strip <nl> - <nl> - . PHONY : all all - am check check - am clean clean - generic clean - libtool \ <nl> - distclean distclean - generic distclean - libtool distdir dvi \ <nl> - dvi - am html html - am info info - am install install - am \ <nl> - install - data install - data - am install - dvi install - dvi - am \ <nl> - install - exec install - exec - am install - html install - html - am \ <nl> - install - info install - info - am install - man install - pdf \ <nl> - install - pdf - am install - ps install - ps - am install - strip \ <nl> - installcheck installcheck - am installdirs maintainer - clean \ <nl> - maintainer - clean - generic mostlyclean mostlyclean - generic \ <nl> - mostlyclean - libtool pdf pdf - am ps ps - am uninstall uninstall - am <nl> - <nl> - # Tell versions [ 3 . 59 , 3 . 63 ) of GNU make to not export all variables . <nl> - # Otherwise a system limit ( for SysV at least ) may be exceeded . <nl> - . NOEXPORT : <nl> mmm a / drivers / vorbis / books / floor / floor_books . h <nl> ppp b / drivers / vorbis / books / floor / floor_books . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : static codebooks autogenerated by huff / huffbuld <nl> - last modified : $ Id : floor_books . h 16939 2010 - 03 - 01 08 : 38 : 14Z xiphmont $ <nl> + last modified : $ Id : floor_books . h 19057 2014 - 01 - 22 12 : 32 : 31Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> # include " codebook . h " <nl> <nl> - static const long _huff_lengthlist_line_256x7_0sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_0sub1 [ ] = { <nl> 0 , 2 , 3 , 3 , 3 , 3 , 4 , 3 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x7_0sub1 = { <nl> 1 , 9 , <nl> - ( long * ) _huff_lengthlist_line_256x7_0sub1 , <nl> + ( char * ) _huff_lengthlist_line_256x7_0sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_0sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_0sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 4 , 3 , 4 , 3 , 5 , 3 , <nl> 6 , 3 , 6 , 4 , 6 , 4 , 7 , 5 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x7_0sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_256x7_0sub2 , <nl> + ( char * ) _huff_lengthlist_line_256x7_0sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_0sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_0sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 5 , 2 , 5 , 3 , 5 , 3 , <nl> 6 , 3 , 6 , 4 , 7 , 6 , 7 , 8 , 7 , 9 , 8 , 9 , 9 , 9 , 10 , 9 , <nl> static const long _huff_lengthlist_line_256x7_0sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x7_0sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_256x7_0sub3 , <nl> + ( char * ) _huff_lengthlist_line_256x7_0sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_1sub1 [ ] = { <nl> 0 , 3 , 3 , 3 , 3 , 2 , 4 , 3 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x7_1sub1 = { <nl> 1 , 9 , <nl> - ( long * ) _huff_lengthlist_line_256x7_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_256x7_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_1sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_1sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 3 , 3 , 4 , 3 , 4 , 4 , <nl> 5 , 4 , 6 , 5 , 6 , 7 , 6 , 8 , 8 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x7_1sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_256x7_1sub2 , <nl> + ( char * ) _huff_lengthlist_line_256x7_1sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_1sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_1sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 2 , 4 , 3 , 6 , 3 , 7 , <nl> 3 , 8 , 5 , 8 , 6 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> static const long _huff_lengthlist_line_256x7_1sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x7_1sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_256x7_1sub3 , <nl> + ( char * ) _huff_lengthlist_line_256x7_1sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_class0 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_class0 [ ] = { <nl> 7 , 5 , 5 , 9 , 9 , 6 , 6 , 9 , 12 , 8 , 7 , 8 , 11 , 8 , 9 , 15 , <nl> 6 , 3 , 3 , 7 , 7 , 4 , 3 , 6 , 9 , 6 , 5 , 6 , 8 , 6 , 8 , 15 , <nl> 8 , 5 , 5 , 9 , 8 , 5 , 4 , 6 , 10 , 7 , 5 , 5 , 11 , 8 , 7 , 15 , <nl> static const long _huff_lengthlist_line_256x7_class0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x7_class0 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_256x7_class0 , <nl> + ( char * ) _huff_lengthlist_line_256x7_class0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x7_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_256x7_class1 [ ] = { <nl> 5 , 6 , 8 , 15 , 6 , 9 , 10 , 15 , 10 , 11 , 12 , 15 , 15 , 15 , 15 , 15 , <nl> 4 , 6 , 7 , 15 , 6 , 7 , 8 , 15 , 9 , 8 , 9 , 15 , 15 , 15 , 15 , 15 , <nl> 6 , 8 , 9 , 15 , 7 , 7 , 8 , 15 , 10 , 9 , 10 , 15 , 15 , 15 , 15 , 15 , <nl> static const long _huff_lengthlist_line_256x7_class1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x7_class1 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_256x7_class1 , <nl> + ( char * ) _huff_lengthlist_line_256x7_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_0sub0 [ ] = { <nl> 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 6 , 5 , 6 , 6 , 6 , 6 , 5 , 6 , 6 , 7 , 6 , 7 , 6 , 7 , 6 , <nl> 7 , 6 , 8 , 7 , 8 , 7 , 8 , 7 , 8 , 7 , 8 , 7 , 9 , 7 , 9 , 7 , <nl> static const long _huff_lengthlist_line_512x17_0sub0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_0sub0 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_512x17_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_512x17_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_1sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_1sub0 [ ] = { <nl> 2 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 6 , 7 , 6 , 7 , 6 , 8 , 7 , 8 , 7 , 8 , 7 , 8 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_512x17_1sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_512x17_1sub0 , <nl> + ( char * ) _huff_lengthlist_line_512x17_1sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_1sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 4 , 3 , 5 , 3 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 6 , 5 , <nl> static const long _huff_lengthlist_line_512x17_1sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_1sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_512x17_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_512x17_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_2sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_2sub1 [ ] = { <nl> 0 , 4 , 5 , 4 , 4 , 4 , 5 , 4 , 4 , 4 , 5 , 4 , 5 , 4 , 5 , 3 , <nl> 5 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_512x17_2sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_512x17_2sub1 , <nl> + ( char * ) _huff_lengthlist_line_512x17_2sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_2sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_2sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 4 , 3 , 4 , 3 , 4 , 4 , 5 , 4 , 5 , 4 , 6 , 4 , 6 , 5 , <nl> 6 , 5 , 7 , 5 , 7 , 6 , 8 , 6 , 8 , 6 , 8 , 7 , 8 , 7 , 9 , 7 , <nl> static const long _huff_lengthlist_line_512x17_2sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_2sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_512x17_2sub2 , <nl> + ( char * ) _huff_lengthlist_line_512x17_2sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_2sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_2sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_512x17_2sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_2sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_512x17_2sub3 , <nl> + ( char * ) _huff_lengthlist_line_512x17_2sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_3sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_3sub1 [ ] = { <nl> 0 , 4 , 4 , 4 , 4 , 4 , 4 , 3 , 4 , 4 , 4 , 4 , 4 , 5 , 4 , 5 , <nl> 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_512x17_3sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_512x17_3sub1 , <nl> + ( char * ) _huff_lengthlist_line_512x17_3sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_3sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_3sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 2 , 3 , 3 , 4 , 3 , 5 , 4 , 6 , 4 , 6 , 5 , 7 , 6 , 7 , <nl> 6 , 8 , 6 , 8 , 7 , 9 , 8 , 10 , 8 , 12 , 9 , 13 , 10 , 15 , 10 , 15 , <nl> static const long _huff_lengthlist_line_512x17_3sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_3sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_512x17_3sub2 , <nl> + ( char * ) _huff_lengthlist_line_512x17_3sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_3sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_3sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_512x17_3sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_3sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_512x17_3sub3 , <nl> + ( char * ) _huff_lengthlist_line_512x17_3sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_class1 [ ] = { <nl> 1 , 2 , 3 , 6 , 5 , 4 , 7 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_512x17_class1 = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist_line_512x17_class1 , <nl> + ( char * ) _huff_lengthlist_line_512x17_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_class2 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_class2 [ ] = { <nl> 3 , 3 , 3 , 14 , 5 , 4 , 4 , 11 , 8 , 6 , 6 , 10 , 17 , 12 , 11 , 17 , <nl> 6 , 5 , 5 , 15 , 5 , 3 , 4 , 11 , 8 , 5 , 5 , 8 , 16 , 9 , 10 , 14 , <nl> 10 , 8 , 9 , 17 , 8 , 6 , 6 , 13 , 10 , 7 , 7 , 10 , 16 , 11 , 13 , 14 , <nl> static const long _huff_lengthlist_line_512x17_class2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_class2 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_512x17_class2 , <nl> + ( char * ) _huff_lengthlist_line_512x17_class2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_512x17_class3 [ ] = { <nl> + static const char _huff_lengthlist_line_512x17_class3 [ ] = { <nl> 2 , 4 , 6 , 17 , 4 , 5 , 7 , 17 , 8 , 7 , 10 , 17 , 17 , 17 , 17 , 17 , <nl> 3 , 4 , 6 , 15 , 3 , 3 , 6 , 15 , 7 , 6 , 9 , 17 , 17 , 17 , 17 , 17 , <nl> 6 , 8 , 10 , 17 , 6 , 6 , 8 , 16 , 9 , 8 , 10 , 17 , 17 , 15 , 16 , 17 , <nl> static const long _huff_lengthlist_line_512x17_class3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_512x17_class3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_512x17_class3 , <nl> + ( char * ) _huff_lengthlist_line_512x17_class3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x4_class0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x4_class0 [ ] = { <nl> 7 , 7 , 7 , 11 , 6 , 6 , 7 , 11 , 7 , 6 , 6 , 10 , 12 , 10 , 10 , 13 , <nl> 7 , 7 , 8 , 11 , 7 , 7 , 7 , 11 , 7 , 6 , 7 , 10 , 11 , 10 , 10 , 13 , <nl> 10 , 10 , 9 , 12 , 9 , 9 , 9 , 11 , 8 , 8 , 8 , 11 , 13 , 11 , 10 , 14 , <nl> static const long _huff_lengthlist_line_128x4_class0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x4_class0 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_128x4_class0 , <nl> + ( char * ) _huff_lengthlist_line_128x4_class0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x4_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x4_0sub0 [ ] = { <nl> 2 , 2 , 2 , 2 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x4_0sub0 = { <nl> 1 , 4 , <nl> - ( long * ) _huff_lengthlist_line_128x4_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_128x4_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x4_0sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x4_0sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 3 , 2 , 3 , 2 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x4_0sub1 = { <nl> 1 , 10 , <nl> - ( long * ) _huff_lengthlist_line_128x4_0sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x4_0sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x4_0sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x4_0sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 3 , 4 , 3 , 4 , 3 , <nl> 4 , 4 , 5 , 4 , 5 , 4 , 6 , 5 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x4_0sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_128x4_0sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x4_0sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x4_0sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x4_0sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 4 , 3 , 5 , 3 , 5 , 3 , <nl> 5 , 4 , 6 , 5 , 6 , 5 , 7 , 6 , 6 , 7 , 7 , 9 , 9 , 11 , 11 , 16 , <nl> static const long _huff_lengthlist_line_128x4_0sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x4_0sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x4_0sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x4_0sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4_class0 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4_class0 [ ] = { <nl> 6 , 7 , 7 , 12 , 6 , 6 , 7 , 12 , 7 , 6 , 6 , 10 , 15 , 12 , 11 , 13 , <nl> 7 , 7 , 8 , 13 , 7 , 7 , 8 , 12 , 7 , 7 , 7 , 11 , 12 , 12 , 11 , 13 , <nl> 10 , 9 , 9 , 11 , 9 , 9 , 9 , 10 , 10 , 8 , 8 , 12 , 14 , 12 , 12 , 14 , <nl> static const long _huff_lengthlist_line_256x4_class0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x4_class0 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_256x4_class0 , <nl> + ( char * ) _huff_lengthlist_line_256x4_class0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4_0sub0 [ ] = { <nl> 2 , 2 , 2 , 2 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x4_0sub0 = { <nl> 1 , 4 , <nl> - ( long * ) _huff_lengthlist_line_256x4_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_256x4_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4_0sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4_0sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 2 , 2 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x4_0sub1 = { <nl> 1 , 10 , <nl> - ( long * ) _huff_lengthlist_line_256x4_0sub1 , <nl> + ( char * ) _huff_lengthlist_line_256x4_0sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4_0sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4_0sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 4 , 3 , 4 , 3 , 4 , 3 , <nl> 5 , 3 , 5 , 4 , 5 , 4 , 6 , 4 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x4_0sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_256x4_0sub2 , <nl> + ( char * ) _huff_lengthlist_line_256x4_0sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4_0sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4_0sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 2 , 4 , 3 , 5 , 3 , 5 , 3 , <nl> 6 , 4 , 7 , 4 , 7 , 5 , 7 , 6 , 7 , 6 , 7 , 8 , 10 , 13 , 13 , 13 , <nl> static const long _huff_lengthlist_line_256x4_0sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x4_0sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_256x4_0sub3 , <nl> + ( char * ) _huff_lengthlist_line_256x4_0sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_class0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_class0 [ ] = { <nl> 10 , 7 , 8 , 13 , 9 , 6 , 7 , 11 , 10 , 8 , 8 , 12 , 17 , 17 , 17 , 17 , <nl> 7 , 5 , 5 , 9 , 6 , 4 , 4 , 8 , 8 , 5 , 5 , 8 , 16 , 14 , 13 , 16 , <nl> 7 , 5 , 5 , 7 , 6 , 3 , 3 , 5 , 8 , 5 , 4 , 7 , 14 , 12 , 12 , 15 , <nl> static const long _huff_lengthlist_line_128x7_class0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x7_class0 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x7_class0 , <nl> + ( char * ) _huff_lengthlist_line_128x7_class0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_class1 [ ] = { <nl> 8 , 13 , 17 , 17 , 8 , 11 , 17 , 17 , 11 , 13 , 17 , 17 , 17 , 17 , 17 , 17 , <nl> 6 , 10 , 16 , 17 , 6 , 10 , 15 , 17 , 8 , 10 , 16 , 17 , 17 , 17 , 17 , 17 , <nl> 9 , 13 , 15 , 17 , 8 , 11 , 17 , 17 , 10 , 12 , 17 , 17 , 17 , 17 , 17 , 17 , <nl> static const long _huff_lengthlist_line_128x7_class1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x7_class1 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_128x7_class1 , <nl> + ( char * ) _huff_lengthlist_line_128x7_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_0sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_0sub1 [ ] = { <nl> 0 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x7_0sub1 = { <nl> 1 , 9 , <nl> - ( long * ) _huff_lengthlist_line_128x7_0sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x7_0sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_0sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_0sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , <nl> 5 , 4 , 5 , 4 , 5 , 4 , 6 , 4 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x7_0sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_128x7_0sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x7_0sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_0sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_0sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 5 , 3 , 5 , 3 , 5 , 4 , <nl> 5 , 4 , 5 , 5 , 5 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> static const long _huff_lengthlist_line_128x7_0sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x7_0sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x7_0sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x7_0sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_1sub1 [ ] = { <nl> 0 , 3 , 3 , 2 , 3 , 3 , 4 , 3 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x7_1sub1 = { <nl> 1 , 9 , <nl> - ( long * ) _huff_lengthlist_line_128x7_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x7_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_1sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_1sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 4 , 3 , 6 , 3 , 6 , 3 , <nl> 6 , 3 , 7 , 3 , 8 , 4 , 9 , 4 , 9 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x7_1sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_128x7_1sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x7_1sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x7_1sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x7_1sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 7 , 2 , 7 , 3 , 8 , 4 , <nl> 9 , 5 , 9 , 8 , 10 , 11 , 11 , 12 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , <nl> static const long _huff_lengthlist_line_128x7_1sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x7_1sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x7_1sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x7_1sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_class1 [ ] = { <nl> 1 , 6 , 3 , 7 , 2 , 4 , 5 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x11_class1 = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist_line_128x11_class1 , <nl> + ( char * ) _huff_lengthlist_line_128x11_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_class2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_class2 [ ] = { <nl> 1 , 6 , 12 , 16 , 4 , 12 , 15 , 16 , 9 , 15 , 16 , 16 , 16 , 16 , 16 , 16 , <nl> 2 , 5 , 11 , 16 , 5 , 11 , 13 , 16 , 9 , 13 , 16 , 16 , 16 , 16 , 16 , 16 , <nl> 4 , 8 , 12 , 16 , 5 , 9 , 12 , 16 , 9 , 13 , 15 , 16 , 16 , 16 , 16 , 16 , <nl> static const long _huff_lengthlist_line_128x11_class2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_class2 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x11_class2 , <nl> + ( char * ) _huff_lengthlist_line_128x11_class2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_class3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_class3 [ ] = { <nl> 7 , 6 , 9 , 17 , 7 , 6 , 8 , 17 , 12 , 9 , 11 , 16 , 16 , 16 , 16 , 16 , <nl> 5 , 4 , 7 , 16 , 5 , 3 , 6 , 14 , 9 , 6 , 8 , 15 , 16 , 16 , 16 , 16 , <nl> 5 , 4 , 6 , 13 , 3 , 2 , 4 , 11 , 7 , 4 , 6 , 13 , 16 , 11 , 10 , 14 , <nl> static const long _huff_lengthlist_line_128x11_class3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_class3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x11_class3 , <nl> + ( char * ) _huff_lengthlist_line_128x11_class3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_0sub0 [ ] = { <nl> 5 , 5 , 5 , 5 , 5 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 6 , 6 , 6 , 7 , 6 , <nl> 7 , 6 , 7 , 6 , 7 , 6 , 7 , 6 , 7 , 6 , 8 , 6 , 8 , 6 , 8 , 7 , <nl> static const long _huff_lengthlist_line_128x11_0sub0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_0sub0 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x11_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_128x11_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_1sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_1sub0 [ ] = { <nl> 2 , 5 , 5 , 5 , 5 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 6 , 5 , 6 , 5 , 6 , 5 , 7 , 6 , 7 , 6 , 7 , 6 , 8 , 6 , 8 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x11_1sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_128x11_1sub0 , <nl> + ( char * ) _huff_lengthlist_line_128x11_1sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_1sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 5 , 3 , 5 , 3 , 6 , 4 , 6 , 4 , 7 , 4 , 7 , 4 , 7 , 4 , 8 , 4 , <nl> static const long _huff_lengthlist_line_128x11_1sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_1sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x11_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x11_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_2sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_2sub1 [ ] = { <nl> 0 , 4 , 5 , 4 , 5 , 4 , 5 , 3 , 5 , 3 , 5 , 3 , 5 , 4 , 4 , 4 , <nl> 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x11_2sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_128x11_2sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x11_2sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_2sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_2sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 5 , 4 , 5 , 4 , 6 , 5 , 7 , <nl> 5 , 7 , 6 , 8 , 6 , 8 , 6 , 9 , 7 , 9 , 7 , 10 , 7 , 9 , 8 , 11 , <nl> static const long _huff_lengthlist_line_128x11_2sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_2sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_128x11_2sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x11_2sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_2sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_2sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_128x11_2sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_2sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x11_2sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x11_2sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_3sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_3sub1 [ ] = { <nl> 0 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 4 , <nl> 5 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x11_3sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_128x11_3sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x11_3sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_3sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_3sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 3 , 5 , 4 , 6 , 4 , 6 , 4 , 7 , 4 , 7 , 4 , 8 , 4 , <nl> 8 , 4 , 9 , 4 , 9 , 4 , 10 , 4 , 10 , 5 , 10 , 5 , 11 , 5 , 12 , 6 , <nl> static const long _huff_lengthlist_line_128x11_3sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_3sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_128x11_3sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x11_3sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x11_3sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x11_3sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_128x11_3sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x11_3sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x11_3sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x11_3sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_class1 [ ] = { <nl> 1 , 3 , 4 , 7 , 2 , 5 , 6 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x17_class1 = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist_line_128x17_class1 , <nl> + ( char * ) _huff_lengthlist_line_128x17_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_class2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_class2 [ ] = { <nl> 1 , 4 , 10 , 19 , 3 , 8 , 13 , 19 , 7 , 12 , 19 , 19 , 19 , 19 , 19 , 19 , <nl> 2 , 6 , 11 , 19 , 8 , 13 , 19 , 19 , 9 , 11 , 19 , 19 , 19 , 19 , 19 , 19 , <nl> 6 , 7 , 13 , 19 , 9 , 13 , 19 , 19 , 10 , 13 , 18 , 18 , 18 , 18 , 18 , 18 , <nl> static const long _huff_lengthlist_line_128x17_class2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_class2 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x17_class2 , <nl> + ( char * ) _huff_lengthlist_line_128x17_class2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_class3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_class3 [ ] = { <nl> 3 , 6 , 10 , 17 , 4 , 8 , 11 , 20 , 8 , 10 , 11 , 20 , 20 , 20 , 20 , 20 , <nl> 2 , 4 , 8 , 18 , 4 , 6 , 8 , 17 , 7 , 8 , 10 , 20 , 20 , 17 , 20 , 20 , <nl> 3 , 5 , 8 , 17 , 3 , 4 , 6 , 17 , 8 , 8 , 10 , 17 , 17 , 12 , 16 , 20 , <nl> static const long _huff_lengthlist_line_128x17_class3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_class3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_128x17_class3 , <nl> + ( char * ) _huff_lengthlist_line_128x17_class3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_0sub0 [ ] = { <nl> 5 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> 7 , 5 , 7 , 5 , 7 , 5 , 7 , 5 , 7 , 5 , 7 , 5 , 8 , 5 , 8 , 5 , <nl> 8 , 5 , 8 , 5 , 8 , 6 , 8 , 6 , 8 , 6 , 9 , 6 , 9 , 6 , 9 , 6 , <nl> static const long _huff_lengthlist_line_128x17_0sub0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_0sub0 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x17_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_128x17_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_1sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_1sub0 [ ] = { <nl> 2 , 5 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 5 , 7 , 6 , 7 , 6 , 7 , 6 , 8 , 6 , 9 , 7 , 9 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x17_1sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_128x17_1sub0 , <nl> + ( char * ) _huff_lengthlist_line_128x17_1sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_1sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 4 , 3 , 5 , 3 , 5 , 3 , 6 , 3 , 6 , 4 , 6 , 4 , 7 , 4 , 7 , 5 , <nl> static const long _huff_lengthlist_line_128x17_1sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_1sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x17_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x17_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_2sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_2sub1 [ ] = { <nl> 0 , 4 , 5 , 4 , 6 , 4 , 8 , 3 , 9 , 3 , 9 , 2 , 9 , 3 , 8 , 4 , <nl> 9 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x17_2sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_128x17_2sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x17_2sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_2sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_2sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 1 , 5 , 3 , 5 , 3 , 5 , 4 , 7 , 5 , 10 , 7 , 10 , 7 , <nl> 12 , 10 , 14 , 10 , 14 , 9 , 14 , 11 , 14 , 14 , 14 , 13 , 13 , 13 , 13 , 13 , <nl> static const long _huff_lengthlist_line_128x17_2sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_2sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_128x17_2sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x17_2sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_2sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_2sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_128x17_2sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_2sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x17_2sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x17_2sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_3sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_3sub1 [ ] = { <nl> 0 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 3 , 5 , 3 , 5 , 4 , 6 , 4 , <nl> 6 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_128x17_3sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_128x17_3sub1 , <nl> + ( char * ) _huff_lengthlist_line_128x17_3sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_3sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_3sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 5 , 3 , 6 , 3 , 6 , 4 , 7 , 4 , 7 , 4 , 7 , 4 , 8 , 4 , <nl> 8 , 4 , 8 , 4 , 8 , 4 , 9 , 4 , 9 , 5 , 10 , 5 , 10 , 7 , 10 , 8 , <nl> static const long _huff_lengthlist_line_128x17_3sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_3sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_128x17_3sub2 , <nl> + ( char * ) _huff_lengthlist_line_128x17_3sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_128x17_3sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_128x17_3sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_128x17_3sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_128x17_3sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_128x17_3sub3 , <nl> + ( char * ) _huff_lengthlist_line_128x17_3sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_class1 [ ] = { <nl> 2 , 10 , 8 , 14 , 7 , 12 , 11 , 14 , 1 , 5 , 3 , 7 , 4 , 9 , 7 , 13 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_1024x27_class1 = { <nl> 1 , 16 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_class1 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_class2 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_class2 [ ] = { <nl> 1 , 4 , 2 , 6 , 3 , 7 , 5 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_1024x27_class2 = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_class2 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_class2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_class3 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_class3 [ ] = { <nl> 1 , 5 , 7 , 21 , 5 , 8 , 9 , 21 , 10 , 9 , 12 , 20 , 20 , 16 , 20 , 20 , <nl> 4 , 8 , 9 , 20 , 6 , 8 , 9 , 20 , 11 , 11 , 13 , 20 , 20 , 15 , 17 , 20 , <nl> 9 , 11 , 14 , 20 , 8 , 10 , 15 , 20 , 11 , 13 , 15 , 20 , 20 , 20 , 20 , 20 , <nl> static const long _huff_lengthlist_line_1024x27_class3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_class3 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_class3 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_class3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_class4 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_class4 [ ] = { <nl> 2 , 3 , 7 , 13 , 4 , 4 , 7 , 15 , 8 , 6 , 9 , 17 , 21 , 16 , 15 , 21 , <nl> 2 , 5 , 7 , 11 , 5 , 5 , 7 , 14 , 9 , 7 , 10 , 16 , 17 , 15 , 16 , 21 , <nl> 4 , 7 , 10 , 17 , 7 , 7 , 9 , 15 , 11 , 9 , 11 , 16 , 21 , 18 , 15 , 21 , <nl> static const long _huff_lengthlist_line_1024x27_class4 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_class4 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_class4 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_class4 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_0sub0 [ ] = { <nl> 5 , 5 , 5 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 7 , 5 , 7 , 5 , 7 , 5 , 7 , 5 , <nl> 8 , 6 , 8 , 6 , 8 , 6 , 9 , 6 , 9 , 6 , 10 , 6 , 10 , 6 , 11 , 6 , <nl> static const long _huff_lengthlist_line_1024x27_0sub0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_0sub0 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_1sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_1sub0 [ ] = { <nl> 2 , 5 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> 6 , 5 , 7 , 5 , 7 , 6 , 8 , 6 , 8 , 6 , 8 , 6 , 9 , 6 , 9 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_1024x27_1sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_1sub0 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_1sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_1sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 8 , 5 , 8 , 4 , 9 , 4 , 9 , 4 , 9 , 4 , 9 , 4 , 9 , 4 , 9 , 4 , <nl> static const long _huff_lengthlist_line_1024x27_1sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_1sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_2sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_2sub0 [ ] = { <nl> 1 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> 6 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 9 , 8 , 10 , 9 , 10 , 9 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_1024x27_2sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_2sub0 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_2sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_2sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_2sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 4 , 3 , 4 , 3 , 4 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 6 , 5 , 6 , 5 , <nl> static const long _huff_lengthlist_line_1024x27_2sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_2sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_2sub1 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_2sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_3sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_3sub1 [ ] = { <nl> 0 , 4 , 5 , 4 , 5 , 3 , 5 , 3 , 5 , 3 , 5 , 4 , 4 , 4 , 4 , 5 , <nl> 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_1024x27_3sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_3sub1 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_3sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_3sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_3sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 3 , 3 , 4 , 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 6 , <nl> 5 , 7 , 5 , 8 , 6 , 8 , 6 , 9 , 7 , 10 , 7 , 10 , 8 , 10 , 8 , 11 , <nl> static const long _huff_lengthlist_line_1024x27_3sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_3sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_3sub2 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_3sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_3sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_3sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_1024x27_3sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_3sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_3sub3 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_3sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_4sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_4sub1 [ ] = { <nl> 0 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 3 , 5 , 3 , 5 , 3 , 5 , 4 , <nl> 5 , 4 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_1024x27_4sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_4sub1 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_4sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_4sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_4sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 4 , 2 , 4 , 2 , 5 , 3 , 5 , 4 , 6 , 6 , 6 , 7 , 7 , 8 , <nl> 7 , 8 , 7 , 8 , 7 , 9 , 8 , 9 , 8 , 9 , 8 , 10 , 8 , 11 , 9 , 12 , <nl> static const long _huff_lengthlist_line_1024x27_4sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_4sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_4sub2 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_4sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_1024x27_4sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_1024x27_4sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_1024x27_4sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_1024x27_4sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_1024x27_4sub3 , <nl> + ( char * ) _huff_lengthlist_line_1024x27_4sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_class1 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_class1 [ ] = { <nl> 2 , 6 , 8 , 9 , 7 , 11 , 13 , 13 , 1 , 3 , 5 , 5 , 6 , 6 , 12 , 10 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_2048x27_class1 = { <nl> 1 , 16 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_class1 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_class1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_class2 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_class2 [ ] = { <nl> 1 , 2 , 3 , 6 , 4 , 7 , 5 , 7 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_2048x27_class2 = { <nl> 1 , 8 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_class2 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_class2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_class3 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_class3 [ ] = { <nl> 3 , 3 , 6 , 16 , 5 , 5 , 7 , 16 , 9 , 8 , 11 , 16 , 16 , 16 , 16 , 16 , <nl> 5 , 5 , 8 , 16 , 5 , 5 , 7 , 16 , 8 , 7 , 9 , 16 , 16 , 16 , 16 , 16 , <nl> 9 , 9 , 12 , 16 , 6 , 8 , 11 , 16 , 9 , 10 , 11 , 16 , 16 , 16 , 16 , 16 , <nl> static const long _huff_lengthlist_line_2048x27_class3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_class3 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_class3 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_class3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_class4 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_class4 [ ] = { <nl> 2 , 4 , 7 , 13 , 4 , 5 , 7 , 15 , 8 , 7 , 10 , 16 , 16 , 14 , 16 , 16 , <nl> 2 , 4 , 7 , 16 , 3 , 4 , 7 , 14 , 8 , 8 , 10 , 16 , 16 , 16 , 15 , 16 , <nl> 6 , 8 , 11 , 16 , 7 , 7 , 9 , 16 , 11 , 9 , 13 , 16 , 16 , 16 , 15 , 16 , <nl> static const long _huff_lengthlist_line_2048x27_class4 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_class4 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_class4 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_class4 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_0sub0 [ ] = { <nl> 5 , 5 , 5 , 5 , 5 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , 6 , 5 , <nl> 6 , 5 , 7 , 5 , 7 , 5 , 7 , 5 , 8 , 5 , 8 , 5 , 8 , 5 , 9 , 5 , <nl> 9 , 6 , 10 , 6 , 10 , 6 , 11 , 6 , 11 , 6 , 11 , 6 , 11 , 6 , 11 , 6 , <nl> static const long _huff_lengthlist_line_2048x27_0sub0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_0sub0 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_1sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_1sub0 [ ] = { <nl> 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 7 , 6 , 7 , 6 , 7 , 6 , 7 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_2048x27_1sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_1sub0 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_1sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_1sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_1sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 6 , 5 , 7 , 5 , 7 , 4 , 7 , 4 , 8 , 4 , 8 , 4 , 8 , 4 , 8 , 3 , <nl> static const long _huff_lengthlist_line_2048x27_1sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_1sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_1sub1 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_1sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_2sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_2sub0 [ ] = { <nl> 2 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_2048x27_2sub0 = { <nl> 1 , 32 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_2sub0 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_2sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_2sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_2sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 3 , 4 , 3 , 4 , 3 , 4 , 4 , 5 , 4 , 5 , 5 , 5 , 6 , 6 , 6 , 7 , <nl> static const long _huff_lengthlist_line_2048x27_2sub1 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_2sub1 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_2sub1 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_2sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_3sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_3sub1 [ ] = { <nl> 0 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , <nl> 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_2048x27_3sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_3sub1 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_3sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_3sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_3sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 6 , <nl> 6 , 7 , 6 , 7 , 6 , 8 , 6 , 9 , 7 , 9 , 7 , 9 , 9 , 11 , 9 , 12 , <nl> static const long _huff_lengthlist_line_2048x27_3sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_3sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_3sub2 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_3sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_3sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_3sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_2048x27_3sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_3sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_3sub3 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_3sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_4sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_4sub1 [ ] = { <nl> 0 , 3 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 5 , 4 , 5 , 4 , 5 , 4 , <nl> 4 , 5 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_2048x27_4sub1 = { <nl> 1 , 18 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_4sub1 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_4sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_4sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_4sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 3 , 2 , 4 , 3 , 4 , 4 , 4 , 5 , 5 , 6 , 5 , 6 , 5 , 7 , <nl> 6 , 6 , 6 , 7 , 7 , 7 , 8 , 9 , 9 , 9 , 12 , 10 , 11 , 10 , 10 , 12 , <nl> static const long _huff_lengthlist_line_2048x27_4sub2 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_4sub2 = { <nl> 1 , 50 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_4sub2 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_4sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_2048x27_4sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_2048x27_4sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> static const long _huff_lengthlist_line_2048x27_4sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_2048x27_4sub3 = { <nl> 1 , 128 , <nl> - ( long * ) _huff_lengthlist_line_2048x27_4sub3 , <nl> + ( char * ) _huff_lengthlist_line_2048x27_4sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4low_class0 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4low_class0 [ ] = { <nl> 4 , 5 , 6 , 11 , 5 , 5 , 6 , 10 , 7 , 7 , 6 , 6 , 14 , 13 , 9 , 9 , <nl> 6 , 6 , 6 , 10 , 6 , 6 , 6 , 9 , 8 , 7 , 7 , 9 , 14 , 12 , 8 , 11 , <nl> 8 , 7 , 7 , 11 , 8 , 8 , 7 , 11 , 9 , 9 , 7 , 9 , 13 , 11 , 9 , 13 , <nl> static const long _huff_lengthlist_line_256x4low_class0 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x4low_class0 = { <nl> 1 , 256 , <nl> - ( long * ) _huff_lengthlist_line_256x4low_class0 , <nl> + ( char * ) _huff_lengthlist_line_256x4low_class0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4low_0sub0 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4low_0sub0 [ ] = { <nl> 1 , 3 , 2 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x4low_0sub0 = { <nl> 1 , 4 , <nl> - ( long * ) _huff_lengthlist_line_256x4low_0sub0 , <nl> + ( char * ) _huff_lengthlist_line_256x4low_0sub0 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4low_0sub1 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4low_0sub1 [ ] = { <nl> 0 , 0 , 0 , 0 , 2 , 3 , 2 , 3 , 3 , 3 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x4low_0sub1 = { <nl> 1 , 10 , <nl> - ( long * ) _huff_lengthlist_line_256x4low_0sub1 , <nl> + ( char * ) _huff_lengthlist_line_256x4low_0sub1 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4low_0sub2 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4low_0sub2 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 3 , 3 , 4 , 3 , 4 , <nl> 4 , 4 , 4 , 4 , 5 , 5 , 5 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _huff_book_line_256x4low_0sub2 = { <nl> 1 , 25 , <nl> - ( long * ) _huff_lengthlist_line_256x4low_0sub2 , <nl> + ( char * ) _huff_lengthlist_line_256x4low_0sub2 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist_line_256x4low_0sub3 [ ] = { <nl> + static const char _huff_lengthlist_line_256x4low_0sub3 [ ] = { <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , <nl> 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 3 , 4 , 2 , 4 , 3 , 5 , 4 , <nl> 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 6 , 9 , <nl> static const long _huff_lengthlist_line_256x4low_0sub3 [ ] = { <nl> <nl> static const static_codebook _huff_book_line_256x4low_0sub3 = { <nl> 1 , 64 , <nl> - ( long * ) _huff_lengthlist_line_256x4low_0sub3 , <nl> + ( char * ) _huff_lengthlist_line_256x4low_0sub3 , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> deleted file mode 100644 <nl> index 93ff417c8f1 . . 00000000000 <nl> mmm a / drivers / vorbis / books / uncoupled / Makefile . am <nl> ppp / dev / null <nl> <nl> - # # Process this file with automake to produce Makefile . in <nl> - <nl> - EXTRA_DIST = res_books_uncoupled . h <nl> deleted file mode 100644 <nl> index 34362f1454d . . 00000000000 <nl> mmm a / drivers / vorbis / books / uncoupled / Makefile . in <nl> ppp / dev / null <nl> <nl> - # Makefile . in generated by automake 1 . 10 . 2 from Makefile . am . <nl> - # @ configure_input @ <nl> - <nl> - # Copyright ( C ) 1994 , 1995 , 1996 , 1997 , 1998 , 1999 , 2000 , 2001 , 2002 , <nl> - # 2003 , 2004 , 2005 , 2006 , 2007 , 2008 Free Software Foundation , Inc . <nl> - # This Makefile . in is free software ; the Free Software Foundation <nl> - # gives unlimited permission to copy and / or distribute it , <nl> - # with or without modifications , as long as this notice is preserved . <nl> - <nl> - # This program is distributed in the hope that it will be useful , <nl> - # but WITHOUT ANY WARRANTY , to the extent permitted by law ; without <nl> - # even the implied warranty of MERCHANTABILITY or FITNESS FOR A <nl> - # PARTICULAR PURPOSE . <nl> - <nl> - @ SET_MAKE @ <nl> - VPATH = @ srcdir @ <nl> - pkgdatadir = $ ( datadir ) / @ PACKAGE @ <nl> - pkglibdir = $ ( libdir ) / @ PACKAGE @ <nl> - pkgincludedir = $ ( includedir ) / @ PACKAGE @ <nl> - am__cd = CDPATH = " $ $ { ZSH_VERSION + . } $ ( PATH_SEPARATOR ) " & & cd <nl> - install_sh_DATA = $ ( install_sh ) - c - m 644 <nl> - install_sh_PROGRAM = $ ( install_sh ) - c <nl> - install_sh_SCRIPT = $ ( install_sh ) - c <nl> - INSTALL_HEADER = $ ( INSTALL_DATA ) <nl> - transform = $ ( program_transform_name ) <nl> - NORMAL_INSTALL = : <nl> - PRE_INSTALL = : <nl> - POST_INSTALL = : <nl> - NORMAL_UNINSTALL = : <nl> - PRE_UNINSTALL = : <nl> - POST_UNINSTALL = : <nl> - build_triplet = @ build @ <nl> - host_triplet = @ host @ <nl> - target_triplet = @ target @ <nl> - subdir = lib / books / uncoupled <nl> - DIST_COMMON = $ ( srcdir ) / Makefile . am $ ( srcdir ) / Makefile . in <nl> - ACLOCAL_M4 = $ ( top_srcdir ) / aclocal . m4 <nl> - am__aclocal_m4_deps = $ ( top_srcdir ) / m4 / add_cflags . m4 \ <nl> - $ ( top_srcdir ) / m4 / ogg . m4 $ ( top_srcdir ) / m4 / pkg . m4 \ <nl> - $ ( top_srcdir ) / configure . ac <nl> - am__configure_deps = $ ( am__aclocal_m4_deps ) $ ( CONFIGURE_DEPENDENCIES ) \ <nl> - $ ( ACLOCAL_M4 ) <nl> - mkinstalldirs = $ ( install_sh ) - d <nl> - CONFIG_HEADER = $ ( top_builddir ) / config . h <nl> - CONFIG_CLEAN_FILES = <nl> - SOURCES = <nl> - DIST_SOURCES = <nl> - DISTFILES = $ ( DIST_COMMON ) $ ( DIST_SOURCES ) $ ( TEXINFOS ) $ ( EXTRA_DIST ) <nl> - ACLOCAL = @ ACLOCAL @ <nl> - ACLOCAL_AMFLAGS = @ ACLOCAL_AMFLAGS @ <nl> - ALLOCA = @ ALLOCA @ <nl> - AMTAR = @ AMTAR @ <nl> - AR = @ AR @ <nl> - AS = @ AS @ <nl> - AUTOCONF = @ AUTOCONF @ <nl> - AUTOHEADER = @ AUTOHEADER @ <nl> - AUTOMAKE = @ AUTOMAKE @ <nl> - AWK = @ AWK @ <nl> - CC = @ CC @ <nl> - CCDEPMODE = @ CCDEPMODE @ <nl> - CFLAGS = @ CFLAGS @ <nl> - CPP = @ CPP @ <nl> - CPPFLAGS = @ CPPFLAGS @ <nl> - CYGPATH_W = @ CYGPATH_W @ <nl> - DEBUG = @ DEBUG @ <nl> - DEFS = @ DEFS @ <nl> - DEPDIR = @ DEPDIR @ <nl> - DLLTOOL = @ DLLTOOL @ <nl> - DSYMUTIL = @ DSYMUTIL @ <nl> - DUMPBIN = @ DUMPBIN @ <nl> - ECHO_C = @ ECHO_C @ <nl> - ECHO_N = @ ECHO_N @ <nl> - ECHO_T = @ ECHO_T @ <nl> - EGREP = @ EGREP @ <nl> - EXEEXT = @ EXEEXT @ <nl> - FGREP = @ FGREP @ <nl> - GREP = @ GREP @ <nl> - HAVE_DOXYGEN = @ HAVE_DOXYGEN @ <nl> - HTLATEX = @ HTLATEX @ <nl> - INSTALL = @ INSTALL @ <nl> - INSTALL_DATA = @ INSTALL_DATA @ <nl> - INSTALL_PROGRAM = @ INSTALL_PROGRAM @ <nl> - INSTALL_SCRIPT = @ INSTALL_SCRIPT @ <nl> - INSTALL_STRIP_PROGRAM = @ INSTALL_STRIP_PROGRAM @ <nl> - LD = @ LD @ <nl> - LDFLAGS = @ LDFLAGS @ <nl> - LIBOBJS = @ LIBOBJS @ <nl> - LIBS = @ LIBS @ <nl> - LIBTOOL = @ LIBTOOL @ <nl> - LIBTOOL_DEPS = @ LIBTOOL_DEPS @ <nl> - LIPO = @ LIPO @ <nl> - LN_S = @ LN_S @ <nl> - LTLIBOBJS = @ LTLIBOBJS @ <nl> - MAINT = @ MAINT @ <nl> - MAKEINFO = @ MAKEINFO @ <nl> - MKDIR_P = @ MKDIR_P @ <nl> - NM = @ NM @ <nl> - NMEDIT = @ NMEDIT @ <nl> - OBJDUMP = @ OBJDUMP @ <nl> - OBJEXT = @ OBJEXT @ <nl> - OGG_CFLAGS = @ OGG_CFLAGS @ <nl> - OGG_LIBS = @ OGG_LIBS @ <nl> - OTOOL = @ OTOOL @ <nl> - OTOOL64 = @ OTOOL64 @ <nl> - PACKAGE = @ PACKAGE @ <nl> - PACKAGE_BUGREPORT = @ PACKAGE_BUGREPORT @ <nl> - PACKAGE_NAME = @ PACKAGE_NAME @ <nl> - PACKAGE_STRING = @ PACKAGE_STRING @ <nl> - PACKAGE_TARNAME = @ PACKAGE_TARNAME @ <nl> - PACKAGE_VERSION = @ PACKAGE_VERSION @ <nl> - PATH_SEPARATOR = @ PATH_SEPARATOR @ <nl> - PDFLATEX = @ PDFLATEX @ <nl> - PKG_CONFIG = @ PKG_CONFIG @ <nl> - PROFILE = @ PROFILE @ <nl> - RANLIB = @ RANLIB @ <nl> - SED = @ SED @ <nl> - SET_MAKE = @ SET_MAKE @ <nl> - SHELL = @ SHELL @ <nl> - STRIP = @ STRIP @ <nl> - VERSION = @ VERSION @ <nl> - VE_LIB_AGE = @ VE_LIB_AGE @ <nl> - VE_LIB_CURRENT = @ VE_LIB_CURRENT @ <nl> - VE_LIB_REVISION = @ VE_LIB_REVISION @ <nl> - VF_LIB_AGE = @ VF_LIB_AGE @ <nl> - VF_LIB_CURRENT = @ VF_LIB_CURRENT @ <nl> - VF_LIB_REVISION = @ VF_LIB_REVISION @ <nl> - VORBIS_LIBS = @ VORBIS_LIBS @ <nl> - V_LIB_AGE = @ V_LIB_AGE @ <nl> - V_LIB_CURRENT = @ V_LIB_CURRENT @ <nl> - V_LIB_REVISION = @ V_LIB_REVISION @ <nl> - abs_builddir = @ abs_builddir @ <nl> - abs_srcdir = @ abs_srcdir @ <nl> - abs_top_builddir = @ abs_top_builddir @ <nl> - abs_top_srcdir = @ abs_top_srcdir @ <nl> - ac_ct_CC = @ ac_ct_CC @ <nl> - ac_ct_DUMPBIN = @ ac_ct_DUMPBIN @ <nl> - am__include = @ am__include @ <nl> - am__leading_dot = @ am__leading_dot @ <nl> - am__quote = @ am__quote @ <nl> - am__tar = @ am__tar @ <nl> - am__untar = @ am__untar @ <nl> - bindir = @ bindir @ <nl> - build = @ build @ <nl> - build_alias = @ build_alias @ <nl> - build_cpu = @ build_cpu @ <nl> - build_os = @ build_os @ <nl> - build_vendor = @ build_vendor @ <nl> - builddir = @ builddir @ <nl> - datadir = @ datadir @ <nl> - datarootdir = @ datarootdir @ <nl> - docdir = @ docdir @ <nl> - dvidir = @ dvidir @ <nl> - exec_prefix = @ exec_prefix @ <nl> - host = @ host @ <nl> - host_alias = @ host_alias @ <nl> - host_cpu = @ host_cpu @ <nl> - host_os = @ host_os @ <nl> - host_vendor = @ host_vendor @ <nl> - htmldir = @ htmldir @ <nl> - includedir = @ includedir @ <nl> - infodir = @ infodir @ <nl> - install_sh = @ install_sh @ <nl> - libdir = @ libdir @ <nl> - libexecdir = @ libexecdir @ <nl> - localedir = @ localedir @ <nl> - localstatedir = @ localstatedir @ <nl> - lt_ECHO = @ lt_ECHO @ <nl> - mandir = @ mandir @ <nl> - mkdir_p = @ mkdir_p @ <nl> - oldincludedir = @ oldincludedir @ <nl> - pdfdir = @ pdfdir @ <nl> - prefix = @ prefix @ <nl> - program_transform_name = @ program_transform_name @ <nl> - psdir = @ psdir @ <nl> - pthread_lib = @ pthread_lib @ <nl> - sbindir = @ sbindir @ <nl> - sharedstatedir = @ sharedstatedir @ <nl> - srcdir = @ srcdir @ <nl> - sysconfdir = @ sysconfdir @ <nl> - target = @ target @ <nl> - target_alias = @ target_alias @ <nl> - target_cpu = @ target_cpu @ <nl> - target_os = @ target_os @ <nl> - target_vendor = @ target_vendor @ <nl> - top_builddir = @ top_builddir @ <nl> - top_srcdir = @ top_srcdir @ <nl> - EXTRA_DIST = res_books_uncoupled . h <nl> - all : all - am <nl> - <nl> - . SUFFIXES : <nl> - $ ( srcdir ) / Makefile . in : @ MAINTAINER_MODE_TRUE @ $ ( srcdir ) / Makefile . am $ ( am__configure_deps ) <nl> - @ for dep in $ ? ; do \ <nl> - case ' $ ( am__configure_deps ) ' in \ <nl> - * $ $ dep * ) \ <nl> - ( cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ) \ <nl> - & & { if test - f $ @ ; then exit 0 ; else break ; fi ; } ; \ <nl> - exit 1 ; ; \ <nl> - esac ; \ <nl> - done ; \ <nl> - echo ' cd $ ( top_srcdir ) & & $ ( AUTOMAKE ) - - gnu lib / books / uncoupled / Makefile ' ; \ <nl> - cd $ ( top_srcdir ) & & \ <nl> - $ ( AUTOMAKE ) - - gnu lib / books / uncoupled / Makefile <nl> - . PRECIOUS : Makefile <nl> - Makefile : $ ( srcdir ) / Makefile . in $ ( top_builddir ) / config . status <nl> - @ case ' $ ? ' in \ <nl> - * config . status * ) \ <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh ; ; \ <nl> - * ) \ <nl> - echo ' cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ' ; \ <nl> - cd $ ( top_builddir ) & & $ ( SHELL ) . / config . status $ ( subdir ) / $ @ $ ( am__depfiles_maybe ) ; ; \ <nl> - esac ; <nl> - <nl> - $ ( top_builddir ) / config . status : $ ( top_srcdir ) / configure $ ( CONFIG_STATUS_DEPENDENCIES ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - $ ( top_srcdir ) / configure : @ MAINTAINER_MODE_TRUE @ $ ( am__configure_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - $ ( ACLOCAL_M4 ) : @ MAINTAINER_MODE_TRUE @ $ ( am__aclocal_m4_deps ) <nl> - cd $ ( top_builddir ) & & $ ( MAKE ) $ ( AM_MAKEFLAGS ) am - - refresh <nl> - <nl> - mostlyclean - libtool : <nl> - - rm - f * . lo <nl> - <nl> - clean - libtool : <nl> - - rm - rf . libs _libs <nl> - tags : TAGS <nl> - TAGS : <nl> - <nl> - ctags : CTAGS <nl> - CTAGS : <nl> - <nl> - <nl> - distdir : $ ( DISTFILES ) <nl> - @ srcdirstrip = ` echo " $ ( srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - topsrcdirstrip = ` echo " $ ( top_srcdir ) " | sed ' s / [ ] . [ ^ $ $ \ \ * ] / \ \ \ \ & / g ' ` ; \ <nl> - list = ' $ ( DISTFILES ) ' ; \ <nl> - dist_files = ` for file in $ $ list ; do echo $ $ file ; done | \ <nl> - sed - e " s | ^ $ $ srcdirstrip / | | ; t " \ <nl> - - e " s | ^ $ $ topsrcdirstrip / | $ ( top_builddir ) / | ; t " ` ; \ <nl> - case $ $ dist_files in \ <nl> - * / * ) $ ( MKDIR_P ) ` echo " $ $ dist_files " | \ <nl> - sed ' / \ / / ! d ; s | ^ | $ ( distdir ) / | ; s , / [ ^ / ] * $ $ , , ' | \ <nl> - sort - u ` ; ; \ <nl> - esac ; \ <nl> - for file in $ $ dist_files ; do \ <nl> - if test - f $ $ file | | test - d $ $ file ; then d = . ; else d = $ ( srcdir ) ; fi ; \ <nl> - if test - d $ $ d / $ $ file ; then \ <nl> - dir = ` echo " / $ $ file " | sed - e ' s , / [ ^ / ] * $ $ , , ' ` ; \ <nl> - if test - d $ ( srcdir ) / $ $ file & & test $ $ d ! = $ ( srcdir ) ; then \ <nl> - cp - pR $ ( srcdir ) / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - fi ; \ <nl> - cp - pR $ $ d / $ $ file $ ( distdir ) $ $ dir | | exit 1 ; \ <nl> - else \ <nl> - test - f $ ( distdir ) / $ $ file \ <nl> - | | cp - p $ $ d / $ $ file $ ( distdir ) / $ $ file \ <nl> - | | exit 1 ; \ <nl> - fi ; \ <nl> - done <nl> - check - am : all - am <nl> - check : check - am <nl> - all - am : Makefile <nl> - installdirs : <nl> - install : install - am <nl> - install - exec : install - exec - am <nl> - install - data : install - data - am <nl> - uninstall : uninstall - am <nl> - <nl> - install - am : all - am <nl> - @ $ ( MAKE ) $ ( AM_MAKEFLAGS ) install - exec - am install - data - am <nl> - <nl> - installcheck : installcheck - am <nl> - install - strip : <nl> - $ ( MAKE ) $ ( AM_MAKEFLAGS ) INSTALL_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " \ <nl> - install_sh_PROGRAM = " $ ( INSTALL_STRIP_PROGRAM ) " INSTALL_STRIP_FLAG = - s \ <nl> - ` test - z ' $ ( STRIP ) ' | | \ <nl> - echo " INSTALL_PROGRAM_ENV = STRIPPROG = ' $ ( STRIP ) ' " ` install <nl> - mostlyclean - generic : <nl> - <nl> - clean - generic : <nl> - <nl> - distclean - generic : <nl> - - test - z " $ ( CONFIG_CLEAN_FILES ) " | | rm - f $ ( CONFIG_CLEAN_FILES ) <nl> - <nl> - maintainer - clean - generic : <nl> - @ echo " This command is intended for maintainers to use " <nl> - @ echo " it deletes files that may require special tools to rebuild . " <nl> - clean : clean - am <nl> - <nl> - clean - am : clean - generic clean - libtool mostlyclean - am <nl> - <nl> - distclean : distclean - am <nl> - - rm - f Makefile <nl> - distclean - am : clean - am distclean - generic <nl> - <nl> - dvi : dvi - am <nl> - <nl> - dvi - am : <nl> - <nl> - html : html - am <nl> - <nl> - info : info - am <nl> - <nl> - info - am : <nl> - <nl> - install - data - am : <nl> - <nl> - install - dvi : install - dvi - am <nl> - <nl> - install - exec - am : <nl> - <nl> - install - html : install - html - am <nl> - <nl> - install - info : install - info - am <nl> - <nl> - install - man : <nl> - <nl> - install - pdf : install - pdf - am <nl> - <nl> - install - ps : install - ps - am <nl> - <nl> - installcheck - am : <nl> - <nl> - maintainer - clean : maintainer - clean - am <nl> - - rm - f Makefile <nl> - maintainer - clean - am : distclean - am maintainer - clean - generic <nl> - <nl> - mostlyclean : mostlyclean - am <nl> - <nl> - mostlyclean - am : mostlyclean - generic mostlyclean - libtool <nl> - <nl> - pdf : pdf - am <nl> - <nl> - pdf - am : <nl> - <nl> - ps : ps - am <nl> - <nl> - ps - am : <nl> - <nl> - uninstall - am : <nl> - <nl> - . MAKE : install - am install - strip <nl> - <nl> - . PHONY : all all - am check check - am clean clean - generic clean - libtool \ <nl> - distclean distclean - generic distclean - libtool distdir dvi \ <nl> - dvi - am html html - am info info - am install install - am \ <nl> - install - data install - data - am install - dvi install - dvi - am \ <nl> - install - exec install - exec - am install - html install - html - am \ <nl> - install - info install - info - am install - man install - pdf \ <nl> - install - pdf - am install - ps install - ps - am install - strip \ <nl> - installcheck installcheck - am installdirs maintainer - clean \ <nl> - maintainer - clean - generic mostlyclean mostlyclean - generic \ <nl> - mostlyclean - libtool pdf pdf - am ps ps - am uninstall uninstall - am <nl> - <nl> - # Tell versions [ 3 . 59 , 3 . 63 ) of GNU make to not export all variables . <nl> - # Otherwise a system limit ( for SysV at least ) may be exceeded . <nl> - . NOEXPORT : <nl> mmm a / drivers / vorbis / books / uncoupled / res_books_uncoupled . h <nl> ppp b / drivers / vorbis / books / uncoupled / res_books_uncoupled . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : static codebooks autogenerated by huff / huffbuld <nl> - last modified : $ Id : res_books_uncoupled . h 17022 2010 - 03 - 25 03 : 45 : 42Z xiphmont $ <nl> + last modified : $ Id : res_books_uncoupled . h 19057 2014 - 01 - 22 12 : 32 : 31Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static const long _vq_quantlist__16u0__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 10 , 10 , 8 , <nl> 10 , 11 , 5 , 8 , 8 , 8 , 10 , 10 , 8 , 10 , 10 , 4 , 9 , 9 , 9 , 12 , <nl> 11 , 8 , 11 , 11 , 8 , 12 , 11 , 10 , 12 , 14 , 10 , 13 , 13 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__16u0__p1_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u0__p1_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p2_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 7 , 7 , 7 , 8 , 9 , 7 , <nl> 8 , 9 , 5 , 7 , 7 , 7 , 9 , 8 , 7 , 9 , 7 , 4 , 7 , 7 , 7 , 9 , <nl> 9 , 7 , 8 , 8 , 6 , 9 , 8 , 7 , 8 , 11 , 9 , 11 , 10 , 6 , 8 , 9 , <nl> static const long _vq_lengthlist__16u0__p2_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u0__p2_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p3_0 [ ] = { <nl> 1 , 5 , 5 , 7 , 7 , 6 , 7 , 7 , 8 , 8 , 6 , 7 , 8 , 8 , 8 , 8 , <nl> 9 , 9 , 11 , 11 , 8 , 9 , 9 , 11 , 11 , 6 , 9 , 8 , 10 , 10 , 8 , 10 , <nl> 10 , 11 , 11 , 8 , 10 , 10 , 11 , 11 , 10 , 11 , 10 , 13 , 12 , 9 , 11 , 10 , <nl> static const long _vq_lengthlist__16u0__p3_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16u0__p3_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p4_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 6 , 6 , 6 , 9 , 9 , 6 , 6 , 6 , 9 , 9 , 9 , <nl> 10 , 9 , 11 , 11 , 9 , 9 , 9 , 11 , 11 , 6 , 7 , 7 , 10 , 10 , 7 , 7 , <nl> 8 , 10 , 10 , 7 , 7 , 8 , 10 , 10 , 10 , 10 , 10 , 11 , 12 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__16u0__p4_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16u0__p4_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , <nl> 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 9 , 9 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 10 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 11 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__16u0__p5_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16u0__p5_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 10 , 10 , 12 , 12 , 13 , 13 , 18 , 17 , 3 , 6 , 6 , <nl> 9 , 9 , 11 , 11 , 13 , 13 , 14 , 14 , 18 , 17 , 3 , 6 , 6 , 9 , 9 , 11 , <nl> 11 , 13 , 13 , 14 , 14 , 17 , 18 , 7 , 9 , 9 , 11 , 11 , 13 , 13 , 14 , 14 , <nl> static const long _vq_lengthlist__16u0__p6_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16u0__p6_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p6_1 [ ] = { <nl> 1 , 4 , 5 , 6 , 6 , 4 , 6 , 6 , 6 , 6 , 4 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 6 , 7 , 7 , 6 , 6 , 6 , 7 , 7 , <nl> } ; <nl> <nl> static const static_codebook _16u0__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__16u0__p6_1 , <nl> + ( char * ) _vq_lengthlist__16u0__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__16u0__p7_0 [ ] = { <nl> <nl> static const static_codebook _16u0__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u0__p7_0 , <nl> + ( char * ) _vq_lengthlist__16u0__p7_0 , <nl> 1 , - 518803456 , 1628680192 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p7_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p7_1 [ ] = { <nl> 1 , 5 , 5 , 6 , 5 , 9 , 10 , 11 , 11 , 10 , 10 , 10 , 10 , 10 , 10 , 5 , <nl> 8 , 8 , 8 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 5 , 8 , <nl> 9 , 9 , 9 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 5 , 10 , 8 , <nl> static const long _vq_lengthlist__16u0__p7_1 [ ] = { <nl> <nl> static const static_codebook _16u0__p7_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16u0__p7_1 , <nl> + ( char * ) _vq_lengthlist__16u0__p7_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__16u0__p7_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u0__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__16u0__p7_2 [ ] = { <nl> 1 , 6 , 6 , 7 , 8 , 7 , 7 , 10 , 9 , 10 , 9 , 11 , 10 , 9 , 11 , 10 , <nl> 9 , 9 , 9 , 9 , 10 , 6 , 8 , 7 , 9 , 9 , 8 , 8 , 10 , 10 , 9 , 11 , <nl> 11 , 12 , 12 , 10 , 9 , 11 , 9 , 12 , 10 , 9 , 6 , 9 , 8 , 9 , 12 , 8 , <nl> static const long _vq_lengthlist__16u0__p7_2 [ ] = { <nl> <nl> static const static_codebook _16u0__p7_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__16u0__p7_2 , <nl> + ( char * ) _vq_lengthlist__16u0__p7_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16u0__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16u0__single [ ] = { <nl> + static const char _huff_lengthlist__16u0__single [ ] = { <nl> 3 , 5 , 8 , 7 , 14 , 8 , 9 , 19 , 5 , 2 , 5 , 5 , 9 , 6 , 9 , 19 , <nl> 8 , 4 , 5 , 7 , 8 , 9 , 13 , 19 , 7 , 4 , 6 , 5 , 9 , 6 , 9 , 19 , <nl> 12 , 8 , 7 , 9 , 10 , 11 , 13 , 19 , 8 , 5 , 8 , 6 , 9 , 6 , 7 , 19 , <nl> static const long _huff_lengthlist__16u0__single [ ] = { <nl> <nl> static const static_codebook _huff_book__16u0__single = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__16u0__single , <nl> + ( char * ) _huff_lengthlist__16u0__single , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16u1__long [ ] = { <nl> + static const char _huff_lengthlist__16u1__long [ ] = { <nl> 3 , 6 , 10 , 8 , 12 , 8 , 14 , 8 , 14 , 19 , 5 , 3 , 5 , 5 , 7 , 6 , <nl> 11 , 7 , 16 , 19 , 7 , 5 , 6 , 7 , 7 , 9 , 11 , 12 , 19 , 19 , 6 , 4 , <nl> 7 , 5 , 7 , 6 , 10 , 7 , 18 , 18 , 8 , 6 , 7 , 7 , 7 , 7 , 8 , 9 , <nl> static const long _huff_lengthlist__16u1__long [ ] = { <nl> <nl> static const static_codebook _huff_book__16u1__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16u1__long , <nl> + ( char * ) _huff_lengthlist__16u1__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__16u1__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 7 , 7 , 10 , 10 , 7 , <nl> 9 , 10 , 5 , 7 , 8 , 7 , 10 , 9 , 7 , 10 , 10 , 5 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 7 , 10 , 10 , 10 , 11 , 12 , 10 , 12 , 13 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__16u1__p1_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u1__p1_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p2_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 6 , 7 , 8 , 6 , <nl> 7 , 8 , 5 , 6 , 6 , 6 , 8 , 7 , 6 , 8 , 7 , 5 , 6 , 6 , 6 , 8 , <nl> 8 , 6 , 8 , 8 , 6 , 8 , 8 , 7 , 7 , 10 , 8 , 9 , 9 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__16u1__p2_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u1__p2_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p3_0 [ ] = { <nl> 1 , 5 , 5 , 8 , 8 , 6 , 7 , 7 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 9 , <nl> 10 , 9 , 11 , 11 , 9 , 9 , 10 , 11 , 11 , 6 , 8 , 8 , 10 , 10 , 8 , 9 , <nl> 10 , 11 , 11 , 8 , 9 , 10 , 11 , 11 , 10 , 11 , 11 , 12 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__16u1__p3_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16u1__p3_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 6 , 6 , 7 , 9 , 9 , 6 , 6 , 6 , 9 , 9 , 9 , <nl> 10 , 9 , 11 , 11 , 9 , 9 , 10 , 11 , 11 , 6 , 7 , 7 , 10 , 9 , 7 , 7 , <nl> 8 , 9 , 10 , 7 , 7 , 8 , 10 , 10 , 10 , 10 , 10 , 10 , 12 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__16u1__p4_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16u1__p4_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , <nl> 10 , 10 , 4 , 5 , 6 , 8 , 8 , 8 , 8 , 10 , 10 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 11 , 11 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__16u1__p5_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16u1__p5_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p6_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p6_0 [ ] = { <nl> 3 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 4 , 4 , 4 , 6 , 6 , 8 , 8 , <nl> 9 , 9 , 4 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 9 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 10 , 7 , 8 , 7 , <nl> static const long _vq_lengthlist__16u1__p6_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p6_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16u1__p6_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p6_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p7_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 8 , 8 , 4 , 8 , 8 , 5 , 11 , 9 , 8 , 12 , 11 , 8 , <nl> 12 , 11 , 5 , 10 , 11 , 8 , 11 , 12 , 8 , 11 , 12 , 4 , 11 , 11 , 11 , 14 , <nl> 13 , 10 , 13 , 13 , 8 , 14 , 13 , 12 , 14 , 16 , 12 , 16 , 15 , 8 , 14 , 14 , <nl> static const long _vq_lengthlist__16u1__p7_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u1__p7_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 4 , 6 , 5 , 7 , 7 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 4 , 5 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__16u1__p7_1 [ ] = { <nl> <nl> static const static_codebook _16u1__p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16u1__p7_1 , <nl> + ( char * ) _vq_lengthlist__16u1__p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p8_0 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p8_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p8_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 5 , 8 , 8 , 10 , 10 , 12 , 12 , 4 , 7 , 7 , 8 , 8 , <nl> 9 , 9 , 12 , 11 , 14 , 13 , 4 , 7 , 7 , 7 , 8 , 9 , 10 , 11 , 11 , 13 , <nl> 12 , 5 , 8 , 8 , 9 , 9 , 11 , 11 , 12 , 13 , 15 , 14 , 5 , 7 , 8 , 9 , <nl> static const long _vq_lengthlist__16u1__p8_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p8_0 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16u1__p8_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p8_0 , <nl> 1 , - 524582912 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p8_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p8_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p8_1 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p8_1 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 4 , 6 , 6 , 7 , 7 , <nl> 8 , 7 , 8 , 8 , 8 , 8 , 4 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 9 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__16u1__p8_1 [ ] = { <nl> <nl> static const static_codebook _16u1__p8_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16u1__p8_1 , <nl> + ( char * ) _vq_lengthlist__16u1__p8_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p8_1 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p9_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p9_0 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p9_0 [ ] = { <nl> 1 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__16u1__p9_0 [ ] = { <nl> <nl> static const static_codebook _16u1__p9_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16u1__p9_0 , <nl> + ( char * ) _vq_lengthlist__16u1__p9_0 , <nl> 1 , - 514071552 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p9_0 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p9_1 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p9_1 [ ] = { <nl> 1 , 6 , 5 , 9 , 9 , 10 , 10 , 6 , 7 , 9 , 9 , 10 , 10 , 10 , 10 , 5 , <nl> 10 , 8 , 10 , 8 , 10 , 10 , 8 , 8 , 10 , 9 , 10 , 10 , 10 , 10 , 5 , 8 , <nl> 9 , 10 , 10 , 10 , 10 , 8 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__16u1__p9_1 [ ] = { <nl> <nl> static const static_codebook _16u1__p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16u1__p9_1 , <nl> + ( char * ) _vq_lengthlist__16u1__p9_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p9_1 , <nl> 0 <nl> static const long _vq_quantlist__16u1__p9_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u1__p9_2 [ ] = { <nl> + static const char _vq_lengthlist__16u1__p9_2 [ ] = { <nl> 1 , 6 , 6 , 7 , 8 , 8 , 11 , 10 , 9 , 9 , 11 , 9 , 10 , 9 , 11 , 11 , <nl> 9 , 6 , 7 , 6 , 11 , 8 , 11 , 9 , 10 , 10 , 11 , 9 , 11 , 10 , 10 , 10 , <nl> 11 , 9 , 5 , 7 , 7 , 8 , 8 , 10 , 11 , 8 , 8 , 11 , 9 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__16u1__p9_2 [ ] = { <nl> <nl> static const static_codebook _16u1__p9_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__16u1__p9_2 , <nl> + ( char * ) _vq_lengthlist__16u1__p9_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16u1__p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16u1__short [ ] = { <nl> + static const char _huff_lengthlist__16u1__short [ ] = { <nl> 5 , 7 , 10 , 9 , 11 , 10 , 15 , 11 , 13 , 16 , 6 , 4 , 6 , 6 , 7 , 7 , <nl> 10 , 9 , 12 , 16 , 10 , 6 , 5 , 6 , 6 , 7 , 10 , 11 , 16 , 16 , 9 , 6 , <nl> 7 , 6 , 7 , 7 , 10 , 8 , 14 , 16 , 11 , 6 , 5 , 4 , 5 , 6 , 8 , 9 , <nl> static const long _huff_lengthlist__16u1__short [ ] = { <nl> <nl> static const static_codebook _huff_book__16u1__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16u1__short , <nl> + ( char * ) _huff_lengthlist__16u1__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16u2__long [ ] = { <nl> + static const char _huff_lengthlist__16u2__long [ ] = { <nl> 5 , 8 , 10 , 10 , 10 , 11 , 11 , 12 , 14 , 18 , 7 , 5 , 5 , 6 , 8 , 9 , <nl> 10 , 12 , 14 , 17 , 9 , 5 , 4 , 5 , 6 , 8 , 10 , 11 , 13 , 19 , 9 , 5 , <nl> 4 , 4 , 5 , 6 , 9 , 10 , 12 , 17 , 8 , 6 , 5 , 4 , 4 , 5 , 7 , 10 , <nl> static const long _huff_lengthlist__16u2__long [ ] = { <nl> <nl> static const static_codebook _huff_book__16u2__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16u2__long , <nl> + ( char * ) _huff_lengthlist__16u2__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__16u2_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p1_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 8 , 9 , 9 , 5 , 7 , 7 , 8 , 9 , <nl> 9 , 7 , 9 , 9 , 7 , 9 , 9 , 9 , 10 , 11 , 9 , 10 , 10 , 7 , 9 , 9 , <nl> static const long _vq_lengthlist__16u2_p1_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u2_p1_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p2_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 5 , 7 , 7 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 9 , <nl> 10 , 9 , 11 , 11 , 9 , 9 , 9 , 11 , 11 , 5 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 8 , 8 , 10 , 10 , 10 , 10 , 10 , 12 , 12 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__16u2_p2_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__16u2_p2_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p3_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 4 , 5 , 5 , 6 , 6 , 8 , 7 , <nl> 9 , 9 , 4 , 5 , 5 , 6 , 6 , 7 , 8 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 7 , 8 , 7 , <nl> static const long _vq_lengthlist__16u2_p3_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__16u2_p3_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p4_0 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 11 , <nl> 11 , 5 , 5 , 5 , 7 , 6 , 8 , 7 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 5 , 5 , 5 , 6 , 6 , 7 , 8 , 8 , 9 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__16u2_p4_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__16u2_p4_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 7 , 9 , 9 , 7 , <nl> 9 , 10 , 5 , 8 , 8 , 7 , 10 , 9 , 7 , 10 , 9 , 5 , 8 , 8 , 8 , 11 , <nl> 10 , 8 , 10 , 10 , 7 , 10 , 10 , 9 , 9 , 12 , 10 , 12 , 12 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__16u2_p5_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__16u2_p5_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p5_1 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 5 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 5 , 6 , 6 , 6 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__16u2_p5_1 [ ] = { <nl> <nl> static const static_codebook _16u2_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16u2_p5_1 , <nl> + ( char * ) _vq_lengthlist__16u2_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p6_0 [ ] = { <nl> 1 , 5 , 4 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 11 , 11 , 4 , 6 , 6 , <nl> 7 , 7 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 11 , 4 , 6 , 6 , 7 , 7 , 9 , <nl> 9 , 9 , 9 , 10 , 10 , 11 , 11 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__16u2_p6_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16u2_p6_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p6_1 [ ] = { <nl> 2 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _16u2_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__16u2_p6_1 , <nl> + ( char * ) _vq_lengthlist__16u2_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p7_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 6 , 6 , <nl> 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 10 , 4 , 6 , 6 , 8 , 8 , 9 , <nl> 9 , 9 , 9 , 10 , 10 , 11 , 11 , 7 , 8 , 8 , 10 , 9 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__16u2_p7_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__16u2_p7_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p7_1 [ ] = { <nl> 2 , 5 , 5 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 5 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__16u2_p7_1 [ ] = { <nl> <nl> static const static_codebook _16u2_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__16u2_p7_1 , <nl> + ( char * ) _vq_lengthlist__16u2_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 7 , 7 , 9 , 8 , 10 , 9 , 11 , 11 , 4 , <nl> 7 , 6 , 9 , 8 , 9 , 9 , 9 , 9 , 10 , 9 , 11 , 9 , 12 , 9 , 4 , 6 , <nl> 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 11 , 11 , 12 , 7 , 9 , 8 , <nl> static const long _vq_lengthlist__16u2_p8_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16u2_p8_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p8_1 [ ] = { <nl> 3 , 5 , 5 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , 5 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__16u2_p8_1 [ ] = { <nl> <nl> static const static_codebook _16u2_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__16u2_p8_1 , <nl> + ( char * ) _vq_lengthlist__16u2_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p9_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p9_0 [ ] = { <nl> 1 , 5 , 3 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 5 , <nl> 7 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 5 , 7 , <nl> 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__16u2_p9_0 [ ] = { <nl> <nl> static const static_codebook _16u2_p9_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__16u2_p9_0 , <nl> + ( char * ) _vq_lengthlist__16u2_p9_0 , <nl> 1 , - 510036736 , 1631393792 , 4 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p9_1 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 7 , 6 , 9 , 7 , 10 , 8 , 12 , 12 , 13 , <nl> 13 , 14 , 14 , 4 , 7 , 7 , 9 , 9 , 9 , 8 , 9 , 8 , 10 , 9 , 11 , 9 , <nl> 14 , 9 , 14 , 10 , 13 , 11 , 4 , 7 , 7 , 9 , 9 , 9 , 9 , 8 , 9 , 10 , <nl> static const long _vq_lengthlist__16u2_p9_1 [ ] = { <nl> <nl> static const static_codebook _16u2_p9_1 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__16u2_p9_1 , <nl> + ( char * ) _vq_lengthlist__16u2_p9_1 , <nl> 1 , - 518287360 , 1622704128 , 5 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__16u2_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__16u2_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__16u2_p9_2 [ ] = { <nl> 2 , 3 , 4 , 4 , 4 , 5 , 5 , 6 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__16u2_p9_2 [ ] = { <nl> <nl> static const static_codebook _16u2_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__16u2_p9_2 , <nl> + ( char * ) _vq_lengthlist__16u2_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__16u2_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__16u2__short [ ] = { <nl> + static const char _huff_lengthlist__16u2__short [ ] = { <nl> 8 , 11 , 13 , 13 , 15 , 16 , 19 , 19 , 19 , 19 , 11 , 8 , 8 , 9 , 9 , 11 , <nl> 13 , 15 , 19 , 20 , 14 , 8 , 7 , 7 , 8 , 9 , 12 , 13 , 15 , 20 , 15 , 9 , <nl> 6 , 5 , 5 , 7 , 10 , 12 , 14 , 18 , 14 , 9 , 7 , 5 , 3 , 4 , 7 , 10 , <nl> static const long _huff_lengthlist__16u2__short [ ] = { <nl> <nl> static const static_codebook _huff_book__16u2__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__16u2__short , <nl> + ( char * ) _huff_lengthlist__16u2__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__8u0__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 8 , 10 , 10 , 7 , <nl> 10 , 10 , 5 , 8 , 8 , 7 , 10 , 10 , 8 , 10 , 10 , 4 , 9 , 8 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 7 , 11 , 11 , 10 , 11 , 13 , 10 , 13 , 13 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__8u0__p1_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8u0__p1_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p2_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 7 , 7 , 6 , 7 , 8 , 6 , <nl> 7 , 8 , 5 , 7 , 7 , 6 , 8 , 8 , 7 , 9 , 7 , 5 , 7 , 7 , 7 , 9 , <nl> 9 , 7 , 8 , 8 , 6 , 9 , 8 , 7 , 7 , 10 , 8 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__8u0__p2_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8u0__p2_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p3_0 [ ] = { <nl> 1 , 5 , 5 , 7 , 7 , 6 , 7 , 7 , 9 , 9 , 6 , 7 , 7 , 9 , 9 , 8 , <nl> 10 , 9 , 11 , 11 , 8 , 9 , 9 , 11 , 11 , 6 , 8 , 8 , 10 , 10 , 8 , 10 , <nl> 10 , 11 , 11 , 8 , 10 , 10 , 11 , 11 , 10 , 11 , 11 , 12 , 12 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__8u0__p3_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__8u0__p3_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p4_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 5 , 6 , 7 , 9 , 9 , 6 , 7 , 6 , 9 , 9 , 9 , <nl> 9 , 9 , 10 , 11 , 9 , 9 , 9 , 11 , 10 , 6 , 7 , 7 , 10 , 10 , 7 , 7 , <nl> 8 , 10 , 10 , 7 , 8 , 8 , 10 , 10 , 10 , 10 , 10 , 10 , 11 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__8u0__p4_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__8u0__p4_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 9 , 9 , 4 , 6 , 6 , 8 , 7 , 8 , 8 , <nl> 10 , 10 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 10 , 10 , 6 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 11 , 11 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__8u0__p5_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8u0__p5_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p6_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 9 , 9 , 11 , 11 , 12 , 12 , 16 , 16 , 3 , 6 , 6 , <nl> 9 , 9 , 11 , 11 , 12 , 12 , 13 , 14 , 18 , 16 , 3 , 6 , 7 , 9 , 9 , 11 , <nl> 11 , 13 , 12 , 14 , 14 , 17 , 16 , 7 , 9 , 9 , 11 , 11 , 12 , 12 , 14 , 14 , <nl> static const long _vq_lengthlist__8u0__p6_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__8u0__p6_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p6_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 4 , 6 , 5 , 7 , 7 , 4 , 5 , 6 , 7 , 7 , 6 , <nl> 7 , 7 , 7 , 7 , 6 , 7 , 7 , 7 , 7 , <nl> } ; <nl> <nl> static const static_codebook _8u0__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__8u0__p6_1 , <nl> + ( char * ) _vq_lengthlist__8u0__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p7_0 [ ] = { <nl> 1 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__8u0__p7_0 [ ] = { <nl> <nl> static const static_codebook _8u0__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8u0__p7_0 , <nl> + ( char * ) _vq_lengthlist__8u0__p7_0 , <nl> 1 , - 518803456 , 1628680192 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p7_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p7_1 [ ] = { <nl> 1 , 5 , 5 , 5 , 5 , 10 , 10 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 5 , <nl> 7 , 6 , 8 , 8 , 9 , 10 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 6 , 6 , <nl> 7 , 9 , 7 , 11 , 10 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 5 , 6 , 6 , <nl> static const long _vq_lengthlist__8u0__p7_1 [ ] = { <nl> <nl> static const static_codebook _8u0__p7_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__8u0__p7_1 , <nl> + ( char * ) _vq_lengthlist__8u0__p7_1 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__8u0__p7_2 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u0__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__8u0__p7_2 [ ] = { <nl> 1 , 6 , 5 , 7 , 7 , 9 , 9 , 9 , 9 , 10 , 12 , 12 , 10 , 11 , 11 , 10 , <nl> 11 , 11 , 11 , 10 , 11 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 9 , 10 , 11 , 11 , <nl> 10 , 11 , 11 , 11 , 11 , 10 , 11 , 11 , 11 , 11 , 6 , 7 , 8 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__8u0__p7_2 [ ] = { <nl> <nl> static const static_codebook _8u0__p7_2 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__8u0__p7_2 , <nl> + ( char * ) _vq_lengthlist__8u0__p7_2 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__8u0__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__8u0__single [ ] = { <nl> + static const char _huff_lengthlist__8u0__single [ ] = { <nl> 4 , 7 , 11 , 9 , 12 , 8 , 7 , 10 , 6 , 4 , 5 , 5 , 7 , 5 , 6 , 16 , <nl> 9 , 5 , 5 , 6 , 7 , 7 , 9 , 16 , 7 , 4 , 6 , 5 , 7 , 5 , 7 , 17 , <nl> 10 , 7 , 7 , 8 , 7 , 7 , 8 , 18 , 7 , 5 , 6 , 4 , 5 , 4 , 5 , 15 , <nl> static const long _huff_lengthlist__8u0__single [ ] = { <nl> <nl> static const static_codebook _huff_book__8u0__single = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__8u0__single , <nl> + ( char * ) _huff_lengthlist__8u0__single , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__8u1__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 7 , 9 , 10 , 7 , <nl> 9 , 9 , 5 , 8 , 8 , 7 , 10 , 9 , 7 , 9 , 9 , 5 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 7 , 10 , 10 , 9 , 10 , 12 , 10 , 12 , 12 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__8u1__p1_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8u1__p1_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p2_0 [ ] = { <nl> 3 , 4 , 5 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 7 , 6 , 6 , 7 , 8 , 6 , <nl> 7 , 8 , 5 , 6 , 6 , 6 , 8 , 7 , 6 , 8 , 7 , 5 , 6 , 6 , 7 , 8 , <nl> 8 , 6 , 7 , 7 , 6 , 8 , 7 , 7 , 7 , 9 , 8 , 9 , 9 , 6 , 7 , 8 , <nl> static const long _vq_lengthlist__8u1__p2_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8u1__p2_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p3_0 [ ] = { <nl> 1 , 5 , 5 , 7 , 7 , 6 , 7 , 7 , 9 , 9 , 6 , 7 , 7 , 9 , 9 , 8 , <nl> 10 , 9 , 11 , 11 , 9 , 9 , 9 , 11 , 11 , 6 , 8 , 8 , 10 , 10 , 8 , 10 , <nl> 10 , 11 , 11 , 8 , 9 , 10 , 11 , 11 , 10 , 11 , 11 , 12 , 12 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__8u1__p3_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__8u1__p3_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p4_0 [ ] = { <nl> 4 , 5 , 5 , 9 , 9 , 6 , 7 , 7 , 9 , 9 , 6 , 7 , 7 , 9 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 9 , 9 , 9 , 11 , 11 , 6 , 7 , 7 , 9 , 9 , 7 , 7 , <nl> 8 , 9 , 10 , 7 , 7 , 8 , 9 , 10 , 9 , 9 , 10 , 10 , 11 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__8u1__p4_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__8u1__p4_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 9 , 9 , 4 , 6 , 5 , 8 , 7 , 8 , 8 , <nl> 10 , 10 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 10 , 10 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 11 , 11 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__8u1__p5_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8u1__p5_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p6_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p6_0 [ ] = { <nl> 3 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 4 , 4 , 5 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 4 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__8u1__p6_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p6_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__8u1__p6_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p6_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p7_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 9 , 9 , 8 , 10 , 10 , 8 , <nl> 10 , 10 , 5 , 9 , 9 , 7 , 10 , 10 , 8 , 10 , 10 , 4 , 10 , 10 , 9 , 12 , <nl> 12 , 9 , 11 , 11 , 7 , 12 , 11 , 10 , 11 , 13 , 10 , 13 , 13 , 7 , 12 , 12 , <nl> static const long _vq_lengthlist__8u1__p7_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__8u1__p7_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 4 , 5 , 5 , 7 , 7 , <nl> 8 , 8 , 9 , 9 , 9 , 9 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , <nl> 9 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__8u1__p7_1 [ ] = { <nl> <nl> static const static_codebook _8u1__p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__8u1__p7_1 , <nl> + ( char * ) _vq_lengthlist__8u1__p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p8_0 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p8_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 10 , 10 , 11 , 11 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 11 , 11 , 13 , 12 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 11 , 11 , 12 , <nl> 12 , 6 , 7 , 7 , 9 , 9 , 11 , 11 , 12 , 12 , 13 , 13 , 6 , 7 , 7 , 9 , <nl> static const long _vq_lengthlist__8u1__p8_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p8_0 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__8u1__p8_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p8_0 , <nl> 1 , - 524582912 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p8_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p8_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p8_1 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p8_1 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 5 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__8u1__p8_1 [ ] = { <nl> <nl> static const static_codebook _8u1__p8_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__8u1__p8_1 , <nl> + ( char * ) _vq_lengthlist__8u1__p8_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p8_1 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p9_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p9_0 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p9_0 [ ] = { <nl> 1 , 4 , 4 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 3 , <nl> 11 , 8 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 3 , 9 , <nl> 9 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__8u1__p9_0 [ ] = { <nl> <nl> static const static_codebook _8u1__p9_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__8u1__p9_0 , <nl> + ( char * ) _vq_lengthlist__8u1__p9_0 , <nl> 1 , - 514071552 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p9_0 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p9_1 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 9 , 9 , 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 4 , <nl> 7 , 7 , 9 , 9 , 10 , 10 , 8 , 8 , 10 , 10 , 10 , 11 , 10 , 11 , 4 , 7 , <nl> 7 , 9 , 9 , 10 , 10 , 8 , 8 , 10 , 9 , 11 , 11 , 11 , 11 , 7 , 9 , 9 , <nl> static const long _vq_lengthlist__8u1__p9_1 [ ] = { <nl> <nl> static const static_codebook _8u1__p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__8u1__p9_1 , <nl> + ( char * ) _vq_lengthlist__8u1__p9_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p9_1 , <nl> 0 <nl> static const long _vq_quantlist__8u1__p9_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__8u1__p9_2 [ ] = { <nl> + static const char _vq_lengthlist__8u1__p9_2 [ ] = { <nl> 2 , 5 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__8u1__p9_2 [ ] = { <nl> <nl> static const static_codebook _8u1__p9_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__8u1__p9_2 , <nl> + ( char * ) _vq_lengthlist__8u1__p9_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__8u1__p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__8u1__single [ ] = { <nl> + static const char _huff_lengthlist__8u1__single [ ] = { <nl> 4 , 7 , 13 , 9 , 15 , 9 , 16 , 8 , 10 , 13 , 7 , 5 , 8 , 6 , 9 , 7 , <nl> 10 , 7 , 10 , 11 , 11 , 6 , 7 , 8 , 8 , 9 , 9 , 9 , 12 , 16 , 8 , 5 , <nl> 8 , 6 , 8 , 6 , 9 , 7 , 10 , 12 , 11 , 7 , 7 , 7 , 6 , 7 , 7 , 7 , <nl> static const long _huff_lengthlist__8u1__single [ ] = { <nl> <nl> static const static_codebook _huff_book__8u1__single = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__8u1__single , <nl> + ( char * ) _huff_lengthlist__8u1__single , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u0__long [ ] = { <nl> + static const char _huff_lengthlist__44u0__long [ ] = { <nl> 5 , 8 , 13 , 10 , 17 , 11 , 11 , 15 , 7 , 2 , 4 , 5 , 8 , 7 , 9 , 16 , <nl> 13 , 4 , 3 , 5 , 6 , 8 , 11 , 20 , 10 , 4 , 5 , 5 , 7 , 6 , 8 , 18 , <nl> 15 , 7 , 6 , 7 , 8 , 10 , 14 , 20 , 10 , 6 , 7 , 6 , 9 , 7 , 8 , 17 , <nl> static const long _huff_lengthlist__44u0__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u0__long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u0__long , <nl> + ( char * ) _huff_lengthlist__44u0__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u0__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 11 , 11 , 8 , <nl> 10 , 10 , 5 , 8 , 8 , 8 , 11 , 10 , 8 , 11 , 11 , 4 , 8 , 8 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 8 , 12 , 11 , 11 , 13 , 13 , 11 , 13 , 14 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__44u0__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u0__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p2_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 7 , 7 , 7 , 8 , 8 , 6 , <nl> 8 , 8 , 5 , 7 , 7 , 6 , 8 , 8 , 7 , 8 , 8 , 4 , 7 , 7 , 7 , 8 , <nl> 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 9 , 10 , 8 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u0__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u0__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p3_0 [ ] = { <nl> 1 , 5 , 5 , 8 , 8 , 5 , 8 , 7 , 9 , 9 , 5 , 7 , 8 , 9 , 9 , 9 , <nl> 10 , 9 , 12 , 12 , 9 , 9 , 10 , 12 , 12 , 6 , 8 , 8 , 11 , 10 , 8 , 10 , <nl> 10 , 11 , 11 , 8 , 9 , 10 , 11 , 11 , 10 , 11 , 11 , 14 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u0__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u0__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p4_0 [ ] = { <nl> 4 , 5 , 5 , 9 , 9 , 5 , 6 , 6 , 9 , 9 , 5 , 6 , 6 , 9 , 9 , 9 , <nl> 10 , 9 , 12 , 12 , 9 , 9 , 10 , 12 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 7 , <nl> 8 , 10 , 10 , 6 , 7 , 8 , 10 , 10 , 10 , 10 , 10 , 11 , 13 , 10 , 9 , 10 , <nl> static const long _vq_lengthlist__44u0__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u0__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , <nl> 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 9 , 9 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 10 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u0__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u0__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 10 , 9 , 11 , 10 , 14 , 13 , 4 , 6 , 5 , <nl> 8 , 8 , 9 , 9 , 11 , 10 , 11 , 11 , 14 , 14 , 4 , 5 , 6 , 8 , 8 , 9 , <nl> 9 , 10 , 10 , 11 , 11 , 14 , 14 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u0__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u0__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , <nl> 6 , 6 , 6 , 6 , 5 , 6 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44u0__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u0__p6_1 , <nl> + ( char * ) _vq_lengthlist__44u0__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p7_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p7_0 [ ] = { <nl> 1 , 4 , 4 , 11 , 11 , 9 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44u0__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u0__p7_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u0__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u0__p7_0 , <nl> 1 , - 518709248 , 1626677248 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p7_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p7_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 5 , 7 , 7 , <nl> 8 , 7 , 7 , 7 , 9 , 8 , 10 , 9 , 10 , 11 , 5 , 7 , 7 , 8 , 8 , 7 , <nl> 7 , 8 , 9 , 10 , 10 , 11 , 11 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 11 , 10 , <nl> static const long _vq_lengthlist__44u0__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u0__p7_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u0__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u0__p7_1 , <nl> 1 , - 523010048 , 1618608128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u0__p7_2 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u0__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44u0__p7_2 [ ] = { <nl> 2 , 5 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , 5 , 5 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 5 , 6 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 9 , 9 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , <nl> static const long _vq_lengthlist__44u0__p7_2 [ ] = { <nl> <nl> static const static_codebook _44u0__p7_2 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u0__p7_2 , <nl> + ( char * ) _vq_lengthlist__44u0__p7_2 , <nl> 1 , - 531103744 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u0__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u0__short [ ] = { <nl> + static const char _huff_lengthlist__44u0__short [ ] = { <nl> 12 , 13 , 14 , 13 , 17 , 12 , 15 , 17 , 5 , 5 , 6 , 10 , 10 , 11 , 15 , 16 , <nl> 4 , 3 , 3 , 7 , 5 , 7 , 10 , 16 , 7 , 7 , 7 , 10 , 9 , 11 , 12 , 16 , <nl> 6 , 5 , 5 , 9 , 5 , 6 , 10 , 16 , 8 , 7 , 7 , 9 , 6 , 7 , 9 , 16 , <nl> static const long _huff_lengthlist__44u0__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u0__short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u0__short , <nl> + ( char * ) _huff_lengthlist__44u0__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u1__long [ ] = { <nl> + static const char _huff_lengthlist__44u1__long [ ] = { <nl> 5 , 8 , 13 , 10 , 17 , 11 , 11 , 15 , 7 , 2 , 4 , 5 , 8 , 7 , 9 , 16 , <nl> 13 , 4 , 3 , 5 , 6 , 8 , 11 , 20 , 10 , 4 , 5 , 5 , 7 , 6 , 8 , 18 , <nl> 15 , 7 , 6 , 7 , 8 , 10 , 14 , 20 , 10 , 6 , 7 , 6 , 9 , 7 , 8 , 17 , <nl> static const long _huff_lengthlist__44u1__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u1__long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u1__long , <nl> + ( char * ) _huff_lengthlist__44u1__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u1__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 11 , 11 , 8 , <nl> 10 , 10 , 5 , 8 , 8 , 8 , 11 , 10 , 8 , 11 , 11 , 4 , 8 , 8 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 8 , 12 , 11 , 11 , 13 , 13 , 11 , 13 , 14 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__44u1__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u1__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p2_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 7 , 7 , 7 , 8 , 8 , 6 , <nl> 8 , 8 , 5 , 7 , 7 , 6 , 8 , 8 , 7 , 8 , 8 , 4 , 7 , 7 , 7 , 8 , <nl> 8 , 7 , 8 , 8 , 7 , 8 , 8 , 8 , 9 , 10 , 8 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u1__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u1__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p3_0 [ ] = { <nl> 1 , 5 , 5 , 8 , 8 , 5 , 8 , 7 , 9 , 9 , 5 , 7 , 8 , 9 , 9 , 9 , <nl> 10 , 9 , 12 , 12 , 9 , 9 , 10 , 12 , 12 , 6 , 8 , 8 , 11 , 10 , 8 , 10 , <nl> 10 , 11 , 11 , 8 , 9 , 10 , 11 , 11 , 10 , 11 , 11 , 14 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u1__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u1__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p4_0 [ ] = { <nl> 4 , 5 , 5 , 9 , 9 , 5 , 6 , 6 , 9 , 9 , 5 , 6 , 6 , 9 , 9 , 9 , <nl> 10 , 9 , 12 , 12 , 9 , 9 , 10 , 12 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 7 , <nl> 8 , 10 , 10 , 6 , 7 , 8 , 10 , 10 , 10 , 10 , 10 , 11 , 13 , 10 , 9 , 10 , <nl> static const long _vq_lengthlist__44u1__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u1__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 7 , 7 , 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , <nl> 9 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 9 , 9 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 10 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u1__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u1__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 10 , 9 , 11 , 10 , 14 , 13 , 4 , 6 , 5 , <nl> 8 , 8 , 9 , 9 , 11 , 10 , 11 , 11 , 14 , 14 , 4 , 5 , 6 , 8 , 8 , 9 , <nl> 9 , 10 , 10 , 11 , 11 , 14 , 14 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u1__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u1__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , <nl> 6 , 6 , 6 , 6 , 5 , 6 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44u1__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u1__p6_1 , <nl> + ( char * ) _vq_lengthlist__44u1__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p7_0 [ ] = { <nl> 6 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p7_0 [ ] = { <nl> 1 , 3 , 2 , 9 , 9 , 7 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u1__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u1__p7_0 = { <nl> 2 , 49 , <nl> - ( long * ) _vq_lengthlist__44u1__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u1__p7_0 , <nl> 1 , - 518017024 , 1626677248 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p7_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p7_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 5 , 7 , 7 , <nl> 8 , 7 , 7 , 7 , 9 , 8 , 10 , 9 , 10 , 11 , 5 , 7 , 7 , 8 , 8 , 7 , <nl> 7 , 8 , 9 , 10 , 10 , 11 , 11 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 11 , 10 , <nl> static const long _vq_lengthlist__44u1__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u1__p7_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u1__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u1__p7_1 , <nl> 1 , - 523010048 , 1618608128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u1__p7_2 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u1__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44u1__p7_2 [ ] = { <nl> 2 , 5 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , 5 , 5 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 5 , 6 , 5 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 9 , 9 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , <nl> static const long _vq_lengthlist__44u1__p7_2 [ ] = { <nl> <nl> static const static_codebook _44u1__p7_2 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u1__p7_2 , <nl> + ( char * ) _vq_lengthlist__44u1__p7_2 , <nl> 1 , - 531103744 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u1__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u1__short [ ] = { <nl> + static const char _huff_lengthlist__44u1__short [ ] = { <nl> 12 , 13 , 14 , 13 , 17 , 12 , 15 , 17 , 5 , 5 , 6 , 10 , 10 , 11 , 15 , 16 , <nl> 4 , 3 , 3 , 7 , 5 , 7 , 10 , 16 , 7 , 7 , 7 , 10 , 9 , 11 , 12 , 16 , <nl> 6 , 5 , 5 , 9 , 5 , 6 , 10 , 16 , 8 , 7 , 7 , 9 , 6 , 7 , 9 , 16 , <nl> static const long _huff_lengthlist__44u1__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u1__short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u1__short , <nl> + ( char * ) _huff_lengthlist__44u1__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u2__long [ ] = { <nl> + static const char _huff_lengthlist__44u2__long [ ] = { <nl> 5 , 9 , 14 , 12 , 15 , 13 , 10 , 13 , 7 , 4 , 5 , 6 , 8 , 7 , 8 , 12 , <nl> 13 , 4 , 3 , 5 , 5 , 6 , 9 , 15 , 12 , 6 , 5 , 6 , 6 , 6 , 7 , 14 , <nl> 14 , 7 , 4 , 6 , 4 , 6 , 8 , 15 , 12 , 6 , 6 , 5 , 5 , 5 , 6 , 14 , <nl> static const long _huff_lengthlist__44u2__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u2__long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u2__long , <nl> + ( char * ) _huff_lengthlist__44u2__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u2__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 11 , 11 , 8 , <nl> 10 , 11 , 5 , 8 , 8 , 8 , 11 , 10 , 8 , 11 , 11 , 4 , 8 , 8 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 8 , 11 , 11 , 11 , 13 , 14 , 11 , 13 , 13 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__44u2__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u2__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p2_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 7 , 8 , 8 , 6 , <nl> 8 , 8 , 5 , 6 , 6 , 6 , 8 , 7 , 7 , 8 , 8 , 5 , 6 , 6 , 7 , 8 , <nl> 8 , 6 , 8 , 8 , 6 , 8 , 8 , 8 , 9 , 10 , 8 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u2__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u2__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p3_0 [ ] = { <nl> 2 , 4 , 4 , 7 , 8 , 5 , 7 , 7 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 12 , 11 , 8 , 9 , 9 , 11 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 9 , <nl> 9 , 11 , 11 , 7 , 9 , 9 , 10 , 11 , 10 , 11 , 11 , 13 , 13 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__44u2__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u2__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 9 , 9 , 9 , 11 , 11 , 5 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 7 , 8 , 10 , 10 , 10 , 10 , 10 , 11 , 12 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44u2__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u2__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 4 , 6 , 5 , 8 , 8 , 8 , 8 , <nl> 10 , 10 , 4 , 5 , 6 , 8 , 8 , 8 , 8 , 10 , 10 , 7 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 11 , 11 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u2__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u2__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 10 , 10 , 11 , 11 , 14 , 13 , 4 , 6 , 5 , <nl> 8 , 8 , 9 , 9 , 11 , 10 , 12 , 11 , 15 , 14 , 4 , 5 , 6 , 8 , 8 , 9 , <nl> 9 , 11 , 11 , 11 , 11 , 14 , 14 , 6 , 8 , 8 , 10 , 9 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44u2__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u2__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 6 , 5 , 4 , 5 , 5 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44u2__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u2__p6_1 , <nl> + ( char * ) _vq_lengthlist__44u2__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p7_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p7_0 [ ] = { <nl> 1 , 3 , 2 , 12 , 12 , 12 , 12 , 12 , 12 , 4 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> 12 , 12 , 5 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44u2__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u2__p7_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u2__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u2__p7_0 , <nl> 1 , - 516612096 , 1626677248 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p7_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p7_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 6 , 7 , 6 , 8 , 7 , 9 , 7 , 9 , 8 , 4 , 7 , 6 , <nl> 8 , 8 , 9 , 8 , 10 , 9 , 10 , 10 , 11 , 11 , 4 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 9 , 10 , 11 , 11 , 11 , 11 , 6 , 8 , 8 , 10 , 10 , 10 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u2__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u2__p7_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u2__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u2__p7_1 , <nl> 1 , - 523010048 , 1618608128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u2__p7_2 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u2__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44u2__p7_2 [ ] = { <nl> 2 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , 8 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 5 , 6 , 6 , 7 , 7 , 8 , <nl> 7 , 8 , 8 , 8 , 8 , 8 , 8 , 6 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u2__p7_2 [ ] = { <nl> <nl> static const static_codebook _44u2__p7_2 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u2__p7_2 , <nl> + ( char * ) _vq_lengthlist__44u2__p7_2 , <nl> 1 , - 531103744 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u2__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u2__short [ ] = { <nl> + static const char _huff_lengthlist__44u2__short [ ] = { <nl> 13 , 15 , 17 , 17 , 15 , 15 , 12 , 17 , 11 , 9 , 7 , 10 , 10 , 9 , 12 , 17 , <nl> 10 , 6 , 3 , 6 , 5 , 7 , 10 , 17 , 15 , 10 , 6 , 9 , 8 , 9 , 11 , 17 , <nl> 15 , 8 , 4 , 7 , 3 , 5 , 9 , 16 , 16 , 10 , 5 , 8 , 4 , 5 , 8 , 16 , <nl> static const long _huff_lengthlist__44u2__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u2__short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u2__short , <nl> + ( char * ) _huff_lengthlist__44u2__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u3__long [ ] = { <nl> + static const char _huff_lengthlist__44u3__long [ ] = { <nl> 6 , 9 , 13 , 12 , 14 , 11 , 10 , 13 , 8 , 4 , 5 , 7 , 8 , 7 , 8 , 12 , <nl> 11 , 4 , 3 , 5 , 5 , 7 , 9 , 14 , 11 , 6 , 5 , 6 , 6 , 6 , 7 , 13 , <nl> 13 , 7 , 5 , 6 , 4 , 5 , 7 , 14 , 11 , 7 , 6 , 6 , 5 , 5 , 6 , 13 , <nl> static const long _huff_lengthlist__44u3__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u3__long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u3__long , <nl> + ( char * ) _huff_lengthlist__44u3__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u3__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 10 , 11 , 8 , <nl> 10 , 11 , 5 , 8 , 8 , 8 , 11 , 10 , 8 , 11 , 11 , 4 , 8 , 8 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 8 , 11 , 11 , 11 , 13 , 14 , 11 , 14 , 14 , 8 , 11 , 11 , <nl> static const long _vq_lengthlist__44u3__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u3__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p2_0 [ ] = { <nl> 2 , 5 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 7 , 8 , 8 , 6 , <nl> 8 , 8 , 5 , 6 , 6 , 6 , 8 , 8 , 7 , 8 , 8 , 5 , 7 , 6 , 7 , 8 , <nl> 8 , 6 , 8 , 8 , 7 , 8 , 8 , 8 , 9 , 10 , 8 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u3__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u3__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p3_0 [ ] = { <nl> 2 , 4 , 4 , 7 , 7 , 5 , 7 , 7 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 12 , 12 , 8 , 9 , 9 , 11 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 9 , <nl> 9 , 11 , 11 , 7 , 9 , 9 , 10 , 11 , 10 , 11 , 11 , 13 , 13 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__44u3__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u3__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 9 , 9 , 9 , 11 , 11 , 5 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 7 , 8 , 10 , 10 , 9 , 10 , 10 , 11 , 12 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44u3__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u3__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , <nl> 10 , 10 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 10 , 10 , 6 , 7 , 7 , 8 , 8 , <nl> 9 , 9 , 11 , 10 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u3__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u3__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 10 , 11 , 13 , 14 , 4 , 6 , 5 , <nl> 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 14 , 14 , 4 , 6 , 6 , 8 , 8 , 9 , <nl> 9 , 10 , 10 , 11 , 11 , 14 , 14 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u3__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u3__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 6 , 5 , 4 , 5 , 5 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44u3__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u3__p6_1 , <nl> + ( char * ) _vq_lengthlist__44u3__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p7_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p7_0 [ ] = { <nl> 1 , 3 , 3 , 10 , 10 , 10 , 10 , 10 , 10 , 4 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 4 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44u3__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u3__p7_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u3__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u3__p7_0 , <nl> 1 , - 515907584 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p7_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p7_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 6 , 8 , 7 , 9 , 8 , 10 , 9 , 11 , 11 , 4 , <nl> 7 , 7 , 8 , 7 , 9 , 9 , 10 , 10 , 11 , 11 , 11 , 11 , 12 , 12 , 4 , 7 , <nl> 7 , 7 , 7 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 12 , 11 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u3__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u3__p7_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u3__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u3__p7_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u3__p7_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u3__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44u3__p7_2 [ ] = { <nl> 2 , 5 , 5 , 7 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 10 , 10 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44u3__p7_2 [ ] = { <nl> <nl> static const static_codebook _44u3__p7_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44u3__p7_2 , <nl> + ( char * ) _vq_lengthlist__44u3__p7_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u3__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u3__short [ ] = { <nl> + static const char _huff_lengthlist__44u3__short [ ] = { <nl> 14 , 14 , 14 , 15 , 13 , 15 , 12 , 16 , 10 , 8 , 7 , 9 , 9 , 8 , 12 , 16 , <nl> 10 , 5 , 4 , 6 , 5 , 6 , 9 , 16 , 14 , 8 , 6 , 8 , 7 , 8 , 10 , 16 , <nl> 14 , 7 , 4 , 6 , 3 , 5 , 8 , 16 , 15 , 9 , 5 , 7 , 4 , 4 , 7 , 16 , <nl> static const long _huff_lengthlist__44u3__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u3__short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u3__short , <nl> + ( char * ) _huff_lengthlist__44u3__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u4__long [ ] = { <nl> + static const char _huff_lengthlist__44u4__long [ ] = { <nl> 3 , 8 , 12 , 12 , 13 , 12 , 11 , 13 , 5 , 4 , 6 , 7 , 8 , 8 , 9 , 13 , <nl> 9 , 5 , 4 , 5 , 5 , 7 , 9 , 13 , 9 , 6 , 5 , 6 , 6 , 7 , 8 , 12 , <nl> 12 , 7 , 5 , 6 , 4 , 5 , 8 , 13 , 11 , 7 , 6 , 6 , 5 , 5 , 6 , 12 , <nl> static const long _huff_lengthlist__44u4__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u4__long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u4__long , <nl> + ( char * ) _huff_lengthlist__44u4__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u4__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 10 , 11 , 8 , <nl> 10 , 11 , 5 , 8 , 8 , 8 , 11 , 10 , 8 , 11 , 11 , 4 , 8 , 8 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 8 , 11 , 11 , 11 , 13 , 14 , 11 , 15 , 14 , 8 , 11 , 11 , <nl> static const long _vq_lengthlist__44u4__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u4__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p2_0 [ ] = { <nl> 2 , 5 , 5 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 7 , 8 , 8 , 6 , <nl> 8 , 8 , 5 , 6 , 6 , 6 , 8 , 8 , 7 , 8 , 8 , 5 , 7 , 6 , 6 , 8 , <nl> 8 , 6 , 8 , 8 , 6 , 8 , 8 , 8 , 9 , 10 , 8 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u4__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u4__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p3_0 [ ] = { <nl> 2 , 4 , 4 , 8 , 8 , 5 , 7 , 7 , 9 , 9 , 5 , 7 , 7 , 9 , 9 , 8 , <nl> 10 , 9 , 12 , 12 , 8 , 9 , 10 , 12 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 9 , <nl> 9 , 11 , 11 , 7 , 9 , 9 , 11 , 11 , 10 , 12 , 11 , 14 , 14 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__44u4__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u4__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 9 , <nl> 9 , 9 , 11 , 11 , 8 , 9 , 9 , 11 , 11 , 5 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 7 , 8 , 10 , 10 , 9 , 10 , 10 , 11 , 12 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44u4__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u4__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 7 , 9 , 9 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , <nl> 10 , 9 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 10 , 10 , 6 , 7 , 7 , 8 , 8 , <nl> 9 , 9 , 11 , 10 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 11 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u4__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u4__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 11 , 10 , 13 , 13 , 4 , 6 , 5 , <nl> 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 14 , 14 , 4 , 6 , 6 , 8 , 8 , 9 , <nl> 9 , 10 , 10 , 11 , 11 , 14 , 14 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44u4__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u4__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 6 , 5 , 4 , 5 , 5 , 5 , 6 , 5 , <nl> 6 , 5 , 6 , 6 , 5 , 5 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44u4__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u4__p6_1 , <nl> + ( char * ) _vq_lengthlist__44u4__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p7_0 [ ] = { <nl> 1 , 3 , 3 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 3 , 12 , 11 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 4 , 11 , 10 , 12 , 12 , 12 , <nl> 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , 12 , <nl> static const long _vq_lengthlist__44u4__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u4__p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u4__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u4__p7_0 , <nl> 1 , - 514332672 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p7_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p7_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 7 , 7 , 9 , 8 , 10 , 8 , 10 , 9 , 11 , 11 , 4 , <nl> 7 , 6 , 8 , 7 , 9 , 9 , 10 , 10 , 11 , 10 , 11 , 10 , 12 , 10 , 4 , 6 , <nl> 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 11 , 11 , 12 , 12 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44u4__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u4__p7_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u4__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u4__p7_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u4__p7_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u4__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44u4__p7_2 [ ] = { <nl> 2 , 5 , 5 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44u4__p7_2 [ ] = { <nl> <nl> static const static_codebook _44u4__p7_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44u4__p7_2 , <nl> + ( char * ) _vq_lengthlist__44u4__p7_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u4__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u4__short [ ] = { <nl> + static const char _huff_lengthlist__44u4__short [ ] = { <nl> 14 , 17 , 15 , 17 , 16 , 14 , 13 , 16 , 10 , 7 , 7 , 10 , 13 , 10 , 15 , 16 , <nl> 9 , 4 , 4 , 6 , 5 , 7 , 9 , 16 , 12 , 8 , 7 , 8 , 8 , 8 , 11 , 16 , <nl> 14 , 7 , 4 , 6 , 3 , 5 , 8 , 15 , 13 , 8 , 5 , 7 , 4 , 5 , 7 , 16 , <nl> static const long _huff_lengthlist__44u4__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u4__short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44u4__short , <nl> + ( char * ) _huff_lengthlist__44u4__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u5__long [ ] = { <nl> + static const char _huff_lengthlist__44u5__long [ ] = { <nl> 3 , 8 , 13 , 12 , 14 , 12 , 16 , 11 , 13 , 14 , 5 , 4 , 5 , 6 , 7 , 8 , <nl> 10 , 9 , 12 , 15 , 10 , 5 , 5 , 5 , 6 , 8 , 9 , 9 , 13 , 15 , 10 , 5 , <nl> 5 , 6 , 6 , 7 , 8 , 8 , 11 , 13 , 12 , 7 , 5 , 6 , 4 , 6 , 7 , 7 , <nl> static const long _huff_lengthlist__44u5__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u5__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u5__long , <nl> + ( char * ) _huff_lengthlist__44u5__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u5__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 8 , 10 , 10 , 7 , <nl> 9 , 10 , 5 , 8 , 8 , 7 , 10 , 9 , 8 , 10 , 10 , 5 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 8 , 10 , 10 , 10 , 12 , 13 , 10 , 13 , 13 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44u5__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u5__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p2_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 6 , 8 , 8 , 6 , <nl> 7 , 8 , 5 , 6 , 6 , 6 , 8 , 7 , 6 , 8 , 8 , 5 , 6 , 6 , 6 , 8 , <nl> 8 , 6 , 8 , 8 , 6 , 8 , 8 , 8 , 9 , 9 , 8 , 9 , 9 , 6 , 8 , 7 , <nl> static const long _vq_lengthlist__44u5__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u5__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p3_0 [ ] = { <nl> 2 , 4 , 5 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 8 , <nl> 10 , 9 , 13 , 12 , 8 , 9 , 10 , 12 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 9 , <nl> 9 , 11 , 11 , 6 , 8 , 9 , 11 , 11 , 10 , 11 , 11 , 14 , 14 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__44u5__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u5__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 6 , 7 , 6 , 9 , 9 , 6 , 6 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 11 , 11 , 8 , 9 , 9 , 11 , 11 , 6 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 6 , 7 , 8 , 9 , 10 , 9 , 10 , 10 , 11 , 12 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u5__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u5__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 8 , 8 , 10 , 10 , 4 , 5 , 5 , 8 , 7 , 8 , 8 , <nl> 11 , 10 , 3 , 5 , 5 , 7 , 8 , 8 , 8 , 10 , 11 , 6 , 8 , 7 , 10 , 9 , <nl> 10 , 10 , 11 , 11 , 6 , 7 , 8 , 9 , 9 , 9 , 10 , 11 , 12 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u5__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u5__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p6_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p6_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 4 , 5 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 4 , 4 , 5 , 6 , 6 , 7 , 7 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u5__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p6_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u5__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p6_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p7_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 9 , 9 , 8 , 11 , 10 , 7 , <nl> 11 , 10 , 5 , 9 , 9 , 7 , 10 , 10 , 8 , 10 , 11 , 4 , 9 , 9 , 9 , 12 , <nl> 12 , 9 , 12 , 12 , 8 , 12 , 12 , 11 , 12 , 12 , 10 , 12 , 13 , 7 , 12 , 12 , <nl> static const long _vq_lengthlist__44u5__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u5__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p7_1 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 4 , 5 , 5 , 7 , 7 , <nl> 8 , 8 , 9 , 8 , 8 , 9 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 9 , 9 , 8 , <nl> 9 , 6 , 7 , 7 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , 9 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44u5__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u5__p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u5__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u5__p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p8_0 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 10 , 10 , 11 , 11 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 6 , 8 , 7 , 9 , 9 , 10 , 10 , 11 , 11 , 13 , 12 , 6 , 8 , 8 , 9 , <nl> static const long _vq_lengthlist__44u5__p8_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p8_0 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u5__p8_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p8_0 , <nl> 1 , - 524582912 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p8_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p8_1 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 5 , 7 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 5 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 6 , 6 , 7 , 7 , <nl> static const long _vq_lengthlist__44u5__p8_1 [ ] = { <nl> <nl> static const static_codebook _44u5__p8_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u5__p8_1 , <nl> + ( char * ) _vq_lengthlist__44u5__p8_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p9_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p9_0 [ ] = { <nl> 1 , 3 , 2 , 12 , 10 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 4 , 9 , 9 , <nl> 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 5 , 10 , 9 , 13 , 13 , 13 , <nl> 13 , 13 , 13 , 13 , 13 , 13 , 13 , 12 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , 13 , <nl> static const long _vq_lengthlist__44u5__p9_0 [ ] = { <nl> <nl> static const static_codebook _44u5__p9_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u5__p9_0 , <nl> + ( char * ) _vq_lengthlist__44u5__p9_0 , <nl> 1 , - 514332672 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 8 , 7 , 8 , 7 , 9 , 8 , 9 , 9 , 4 , <nl> 7 , 6 , 9 , 8 , 10 , 10 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 8 , 5 , 6 , <nl> 6 , 8 , 9 , 10 , 10 , 9 , 9 , 9 , 10 , 10 , 10 , 10 , 11 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u5__p9_1 [ ] = { <nl> <nl> static const static_codebook _44u5__p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u5__p9_1 , <nl> + ( char * ) _vq_lengthlist__44u5__p9_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44u5__p9_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u5__p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44u5__p9_2 [ ] = { <nl> 2 , 5 , 5 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44u5__p9_2 [ ] = { <nl> <nl> static const static_codebook _44u5__p9_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44u5__p9_2 , <nl> + ( char * ) _vq_lengthlist__44u5__p9_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u5__p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u5__short [ ] = { <nl> + static const char _huff_lengthlist__44u5__short [ ] = { <nl> 4 , 10 , 17 , 13 , 17 , 13 , 17 , 17 , 17 , 17 , 3 , 6 , 8 , 9 , 11 , 9 , <nl> 15 , 12 , 16 , 17 , 6 , 5 , 5 , 7 , 7 , 8 , 10 , 11 , 17 , 17 , 7 , 8 , <nl> 7 , 9 , 9 , 10 , 13 , 13 , 17 , 17 , 8 , 6 , 5 , 7 , 4 , 7 , 5 , 8 , <nl> static const long _huff_lengthlist__44u5__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u5__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u5__short , <nl> + ( char * ) _huff_lengthlist__44u5__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u6__long [ ] = { <nl> + static const char _huff_lengthlist__44u6__long [ ] = { <nl> 3 , 9 , 14 , 13 , 14 , 13 , 16 , 12 , 13 , 14 , 5 , 4 , 6 , 6 , 8 , 9 , <nl> 11 , 10 , 12 , 15 , 10 , 5 , 5 , 6 , 6 , 8 , 10 , 10 , 13 , 16 , 10 , 6 , <nl> 6 , 6 , 6 , 8 , 9 , 9 , 12 , 14 , 13 , 7 , 6 , 6 , 4 , 6 , 6 , 7 , <nl> static const long _huff_lengthlist__44u6__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u6__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u6__long , <nl> + ( char * ) _huff_lengthlist__44u6__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u6__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 8 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 8 , 10 , 10 , 7 , <nl> 9 , 10 , 5 , 8 , 8 , 7 , 10 , 9 , 8 , 10 , 10 , 5 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 8 , 10 , 10 , 10 , 12 , 13 , 10 , 13 , 13 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44u6__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u6__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p2_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 6 , 8 , 8 , 6 , <nl> 7 , 8 , 5 , 6 , 6 , 6 , 8 , 7 , 6 , 8 , 8 , 5 , 6 , 6 , 6 , 8 , <nl> 8 , 6 , 8 , 8 , 6 , 8 , 8 , 8 , 9 , 9 , 8 , 9 , 9 , 6 , 7 , 7 , <nl> static const long _vq_lengthlist__44u6__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u6__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p3_0 [ ] = { <nl> 2 , 5 , 4 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 13 , 12 , 8 , 9 , 10 , 12 , 13 , 5 , 7 , 7 , 10 , 9 , 7 , 9 , <nl> 9 , 11 , 11 , 7 , 8 , 9 , 11 , 11 , 10 , 11 , 11 , 14 , 14 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__44u6__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u6__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 6 , 7 , 6 , 9 , 9 , 6 , 6 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 11 , 11 , 8 , 9 , 9 , 11 , 11 , 6 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 7 , 8 , 9 , 10 , 9 , 10 , 10 , 11 , 11 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u6__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u6__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 8 , 8 , 10 , 10 , 4 , 5 , 5 , 8 , 7 , 8 , 8 , <nl> 11 , 11 , 3 , 5 , 5 , 7 , 8 , 8 , 8 , 11 , 11 , 6 , 8 , 7 , 9 , 9 , <nl> 10 , 9 , 12 , 11 , 6 , 7 , 8 , 9 , 9 , 9 , 10 , 11 , 12 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u6__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u6__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p6_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p6_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 4 , 5 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 4 , 4 , 5 , 6 , 6 , 7 , 8 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 7 , 8 , 7 , <nl> static const long _vq_lengthlist__44u6__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p6_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u6__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p6_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p7_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 9 , 8 , 7 , 10 , 10 , 8 , <nl> 10 , 10 , 5 , 8 , 9 , 7 , 10 , 10 , 7 , 10 , 9 , 4 , 8 , 8 , 9 , 11 , <nl> 11 , 8 , 11 , 11 , 7 , 11 , 11 , 10 , 10 , 13 , 10 , 13 , 13 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__44u6__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u6__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p7_1 [ ] = { <nl> 3 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 4 , 5 , 5 , 7 , 6 , <nl> 8 , 8 , 8 , 8 , 8 , 8 , 4 , 5 , 5 , 6 , 7 , 8 , 8 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u6__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u6__p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u6__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u6__p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p8_0 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 10 , 10 , 11 , 11 , 4 , 6 , 6 , 7 , 7 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 6 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 6 , 8 , 8 , 9 , <nl> static const long _vq_lengthlist__44u6__p8_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p8_0 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u6__p8_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p8_0 , <nl> 1 , - 524582912 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p8_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p8_1 [ ] = { <nl> 3 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 5 , 7 , 7 , <nl> 7 , 7 , 8 , 7 , 8 , 8 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 8 , <nl> 8 , 6 , 7 , 7 , 7 , 7 , 8 , 7 , 8 , 8 , 8 , 8 , 6 , 6 , 7 , 7 , <nl> static const long _vq_lengthlist__44u6__p8_1 [ ] = { <nl> <nl> static const static_codebook _44u6__p8_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u6__p8_1 , <nl> + ( char * ) _vq_lengthlist__44u6__p8_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p9_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p9_0 [ ] = { <nl> 1 , 3 , 2 , 9 , 8 , 15 , 15 , 15 , 15 , 15 , 15 , 15 , 15 , 15 , 15 , 4 , <nl> 8 , 9 , 13 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 5 , 8 , <nl> 9 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 14 , 11 , 14 , 14 , <nl> static const long _vq_lengthlist__44u6__p9_0 [ ] = { <nl> <nl> static const static_codebook _44u6__p9_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u6__p9_0 , <nl> + ( char * ) _vq_lengthlist__44u6__p9_0 , <nl> 1 , - 514071552 , 1627381760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p9_1 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 9 , 8 , 8 , 9 , 8 , 9 , 8 , 9 , 9 , 4 , <nl> 7 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 4 , 7 , <nl> 6 , 9 , 9 , 10 , 10 , 9 , 9 , 10 , 10 , 10 , 10 , 11 , 11 , 7 , 9 , 8 , <nl> static const long _vq_lengthlist__44u6__p9_1 [ ] = { <nl> <nl> static const static_codebook _44u6__p9_1 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u6__p9_1 , <nl> + ( char * ) _vq_lengthlist__44u6__p9_1 , <nl> 1 , - 522338304 , 1620115456 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44u6__p9_2 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u6__p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44u6__p9_2 [ ] = { <nl> 3 , 5 , 5 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 8 , 8 , 9 , 9 , <nl> 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44u6__p9_2 [ ] = { <nl> <nl> static const static_codebook _44u6__p9_2 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44u6__p9_2 , <nl> + ( char * ) _vq_lengthlist__44u6__p9_2 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u6__p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u6__short [ ] = { <nl> + static const char _huff_lengthlist__44u6__short [ ] = { <nl> 4 , 11 , 16 , 13 , 17 , 13 , 17 , 16 , 17 , 17 , 4 , 7 , 9 , 9 , 13 , 10 , <nl> 16 , 12 , 16 , 17 , 7 , 6 , 5 , 7 , 8 , 9 , 12 , 12 , 16 , 17 , 6 , 9 , <nl> 7 , 9 , 10 , 10 , 15 , 15 , 17 , 17 , 6 , 7 , 5 , 7 , 5 , 7 , 7 , 10 , <nl> static const long _huff_lengthlist__44u6__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u6__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u6__short , <nl> + ( char * ) _huff_lengthlist__44u6__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u7__long [ ] = { <nl> + static const char _huff_lengthlist__44u7__long [ ] = { <nl> 3 , 9 , 14 , 13 , 15 , 14 , 16 , 13 , 13 , 14 , 5 , 5 , 7 , 7 , 8 , 9 , <nl> 11 , 10 , 12 , 15 , 10 , 6 , 5 , 6 , 6 , 9 , 10 , 10 , 13 , 16 , 10 , 6 , <nl> 6 , 6 , 6 , 8 , 9 , 9 , 12 , 15 , 14 , 7 , 6 , 6 , 5 , 6 , 6 , 8 , <nl> static const long _huff_lengthlist__44u7__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u7__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u7__long , <nl> + ( char * ) _huff_lengthlist__44u7__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u7__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p1_0 [ ] = { <nl> 1 , 4 , 4 , 4 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 8 , 10 , 10 , 7 , <nl> 10 , 10 , 5 , 8 , 8 , 7 , 10 , 10 , 8 , 10 , 10 , 5 , 8 , 8 , 8 , 11 , <nl> 10 , 8 , 10 , 10 , 8 , 10 , 10 , 10 , 12 , 13 , 10 , 13 , 13 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44u7__p1_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u7__p1_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p2_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 6 , 6 , 6 , 8 , 8 , 6 , <nl> 7 , 8 , 5 , 6 , 6 , 6 , 8 , 7 , 6 , 8 , 8 , 5 , 6 , 6 , 6 , 8 , <nl> 7 , 6 , 8 , 8 , 6 , 8 , 8 , 8 , 9 , 9 , 8 , 9 , 9 , 6 , 8 , 7 , <nl> static const long _vq_lengthlist__44u7__p2_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u7__p2_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p3_0 [ ] = { <nl> 2 , 5 , 4 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 13 , 12 , 8 , 9 , 10 , 12 , 13 , 5 , 7 , 7 , 10 , 9 , 7 , 9 , <nl> 9 , 11 , 11 , 6 , 8 , 9 , 11 , 11 , 10 , 11 , 11 , 14 , 14 , 9 , 10 , 11 , <nl> static const long _vq_lengthlist__44u7__p3_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u7__p3_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p4_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 6 , 7 , 6 , 9 , 9 , 6 , 6 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 11 , 11 , 8 , 9 , 9 , 10 , 11 , 6 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 6 , 7 , 8 , 9 , 10 , 9 , 10 , 10 , 12 , 12 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u7__p4_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u7__p4_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p5_0 [ ] = { <nl> 2 , 3 , 3 , 6 , 6 , 7 , 8 , 10 , 10 , 4 , 5 , 5 , 8 , 7 , 8 , 8 , <nl> 11 , 11 , 3 , 5 , 5 , 7 , 7 , 8 , 9 , 11 , 11 , 6 , 8 , 7 , 9 , 9 , <nl> 10 , 10 , 12 , 12 , 6 , 7 , 8 , 9 , 10 , 10 , 10 , 12 , 12 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u7__p5_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u7__p5_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p6_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p6_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 4 , 5 , 4 , 6 , 6 , 8 , 7 , <nl> 9 , 9 , 4 , 4 , 5 , 6 , 6 , 7 , 7 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 7 , 8 , 7 , <nl> static const long _vq_lengthlist__44u7__p6_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p6_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u7__p6_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p6_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p7_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p7_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 9 , 8 , 8 , 9 , 9 , 7 , <nl> 10 , 10 , 5 , 8 , 9 , 7 , 9 , 10 , 8 , 9 , 9 , 4 , 9 , 9 , 9 , 11 , <nl> 10 , 8 , 10 , 10 , 7 , 11 , 10 , 10 , 10 , 12 , 10 , 12 , 12 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44u7__p7_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p7_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u7__p7_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p7_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p7_1 [ ] = { <nl> 3 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 4 , 5 , 5 , 6 , 6 , <nl> 8 , 7 , 8 , 8 , 8 , 8 , 4 , 5 , 5 , 6 , 6 , 7 , 8 , 8 , 8 , 8 , <nl> 8 , 6 , 7 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 6 , 6 , 7 , 7 , <nl> static const long _vq_lengthlist__44u7__p7_1 [ ] = { <nl> <nl> static const static_codebook _44u7__p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u7__p7_1 , <nl> + ( char * ) _vq_lengthlist__44u7__p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p8_0 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p8_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 10 , 10 , 11 , 11 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 11 , 10 , 12 , 12 , 5 , 6 , 5 , 7 , 7 , 9 , 9 , 10 , 11 , 12 , <nl> 12 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 13 , 13 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44u7__p8_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p8_0 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u7__p8_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p8_0 , <nl> 1 , - 524582912 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p8_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p8_1 [ ] = { <nl> 4 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u7__p8_1 [ ] = { <nl> <nl> static const static_codebook _44u7__p8_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u7__p8_1 , <nl> + ( char * ) _vq_lengthlist__44u7__p8_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p9_0 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p9_0 [ ] = { <nl> 1 , 3 , 3 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 4 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 4 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 , <nl> static const long _vq_lengthlist__44u7__p9_0 [ ] = { <nl> <nl> static const static_codebook _44u7__p9_0 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u7__p9_0 , <nl> + ( char * ) _vq_lengthlist__44u7__p9_0 , <nl> 1 , - 512171520 , 1630791680 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p9_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p9_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 5 , 8 , 6 , 9 , 8 , 10 , 9 , 11 , 10 , 4 , 6 , 6 , <nl> 8 , 8 , 9 , 9 , 11 , 10 , 11 , 11 , 11 , 11 , 4 , 6 , 6 , 8 , 8 , 10 , <nl> 9 , 11 , 11 , 11 , 11 , 11 , 12 , 6 , 8 , 8 , 10 , 10 , 11 , 11 , 12 , 12 , <nl> static const long _vq_lengthlist__44u7__p9_1 [ ] = { <nl> <nl> static const static_codebook _44u7__p9_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u7__p9_1 , <nl> + ( char * ) _vq_lengthlist__44u7__p9_1 , <nl> 1 , - 518889472 , 1622704128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44u7__p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u7__p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44u7__p9_2 [ ] = { <nl> 2 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44u7__p9_2 [ ] = { <nl> <nl> static const static_codebook _44u7__p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44u7__p9_2 , <nl> + ( char * ) _vq_lengthlist__44u7__p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44u7__p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u7__short [ ] = { <nl> + static const char _huff_lengthlist__44u7__short [ ] = { <nl> 5 , 12 , 17 , 16 , 16 , 17 , 17 , 17 , 17 , 17 , 4 , 7 , 11 , 11 , 12 , 9 , <nl> 17 , 10 , 17 , 17 , 7 , 7 , 8 , 9 , 7 , 9 , 11 , 10 , 15 , 17 , 7 , 9 , <nl> 10 , 11 , 10 , 12 , 14 , 12 , 16 , 17 , 7 , 8 , 5 , 7 , 4 , 7 , 7 , 8 , <nl> static const long _huff_lengthlist__44u7__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u7__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u7__short , <nl> + ( char * ) _huff_lengthlist__44u7__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u8__long [ ] = { <nl> + static const char _huff_lengthlist__44u8__long [ ] = { <nl> 3 , 9 , 13 , 14 , 14 , 15 , 14 , 14 , 15 , 15 , 5 , 4 , 6 , 8 , 10 , 12 , <nl> 12 , 14 , 15 , 15 , 9 , 5 , 4 , 5 , 8 , 10 , 11 , 13 , 16 , 16 , 10 , 7 , <nl> 4 , 3 , 5 , 7 , 9 , 11 , 13 , 13 , 10 , 9 , 7 , 4 , 4 , 6 , 8 , 10 , <nl> static const long _huff_lengthlist__44u8__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u8__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u8__long , <nl> + ( char * ) _huff_lengthlist__44u8__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u8__short [ ] = { <nl> + static const char _huff_lengthlist__44u8__short [ ] = { <nl> 6 , 14 , 18 , 18 , 17 , 17 , 17 , 17 , 17 , 17 , 4 , 7 , 9 , 9 , 10 , 13 , <nl> 15 , 17 , 17 , 17 , 6 , 7 , 5 , 6 , 8 , 11 , 16 , 17 , 16 , 17 , 5 , 7 , <nl> 5 , 4 , 6 , 10 , 14 , 17 , 17 , 17 , 6 , 6 , 6 , 5 , 7 , 10 , 13 , 16 , <nl> static const long _huff_lengthlist__44u8__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u8__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u8__short , <nl> + ( char * ) _huff_lengthlist__44u8__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u8_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p1_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 8 , 9 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 8 , 9 , 9 , 5 , 7 , 7 , 7 , 9 , <nl> 9 , 7 , 9 , 9 , 7 , 9 , 9 , 9 , 10 , 11 , 9 , 11 , 10 , 7 , 9 , 9 , <nl> static const long _vq_lengthlist__44u8_p1_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u8_p1_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p2_0 [ ] = { <nl> 4 , 5 , 5 , 8 , 8 , 5 , 7 , 6 , 9 , 9 , 5 , 6 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 11 , 11 , 8 , 9 , 9 , 11 , 11 , 5 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 8 , 8 , 10 , 10 , 9 , 10 , 10 , 12 , 12 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44u8_p2_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u8_p2_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p3_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 9 , 9 , 4 , 5 , 4 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 4 , 4 , 5 , 6 , 6 , 7 , 7 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 10 , 10 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u8_p3_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u8_p3_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p4_0 [ ] = { <nl> 4 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 10 , 10 , 11 , 11 , 11 , <nl> 11 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , <nl> 12 , 12 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44u8_p4_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44u8_p4_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 8 , 9 , 9 , 7 , <nl> 9 , 9 , 5 , 8 , 8 , 7 , 9 , 9 , 8 , 9 , 9 , 5 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 7 , 10 , 10 , 9 , 10 , 12 , 9 , 12 , 11 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44u8_p5_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u8_p5_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p5_1 [ ] = { <nl> 4 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 5 , 5 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 5 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 8 , 8 , <nl> 8 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 6 , 6 , 6 , 7 , <nl> static const long _vq_lengthlist__44u8_p5_1 [ ] = { <nl> <nl> static const static_codebook _44u8_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u8_p5_1 , <nl> + ( char * ) _vq_lengthlist__44u8_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p6_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 6 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 6 , 6 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 7 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , <nl> static const long _vq_lengthlist__44u8_p6_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u8_p6_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p6_1 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44u8_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u8_p6_1 , <nl> + ( char * ) _vq_lengthlist__44u8_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p7_0 [ ] = { <nl> 1 , 4 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 10 , 10 , 11 , 11 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 9 , 9 , 11 , 10 , 12 , 11 , 5 , 6 , 6 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 11 , 11 , 12 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44u8_p7_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u8_p7_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p7_1 [ ] = { <nl> 4 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u8_p7_1 [ ] = { <nl> <nl> static const static_codebook _44u8_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u8_p7_1 , <nl> + ( char * ) _vq_lengthlist__44u8_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 8 , 7 , 9 , 8 , 10 , 9 , 11 , 10 , 4 , <nl> 6 , 6 , 8 , 8 , 10 , 9 , 9 , 9 , 10 , 10 , 11 , 10 , 12 , 10 , 4 , 6 , <nl> 6 , 8 , 8 , 10 , 10 , 9 , 9 , 10 , 10 , 11 , 11 , 11 , 12 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u8_p8_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u8_p8_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p8_1 [ ] = { <nl> 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44u8_p8_1 [ ] = { <nl> <nl> static const static_codebook _44u8_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44u8_p8_1 , <nl> + ( char * ) _vq_lengthlist__44u8_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p9_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p9_0 [ ] = { <nl> 1 , 3 , 3 , 9 , 9 , 9 , 9 , 9 , 9 , 4 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 5 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> static const long _vq_lengthlist__44u8_p9_0 [ ] = { <nl> <nl> static const static_codebook _44u8_p9_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u8_p9_0 , <nl> + ( char * ) _vq_lengthlist__44u8_p9_0 , <nl> 1 , - 511895552 , 1631393792 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p9_1 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 7 , 8 , 6 , 9 , 7 , 10 , 8 , 11 , 10 , 11 , <nl> 11 , 11 , 11 , 4 , 7 , 6 , 9 , 9 , 10 , 9 , 9 , 9 , 10 , 10 , 11 , 10 , <nl> 11 , 10 , 11 , 11 , 13 , 11 , 4 , 7 , 7 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u8_p9_1 [ ] = { <nl> <nl> static const static_codebook _44u8_p9_1 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__44u8_p9_1 , <nl> + ( char * ) _vq_lengthlist__44u8_p9_1 , <nl> 1 , - 518287360 , 1622704128 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44u8_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u8_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44u8_p9_2 [ ] = { <nl> 2 , 3 , 4 , 5 , 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u8_p9_2 [ ] = { <nl> <nl> static const static_codebook _44u8_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44u8_p9_2 , <nl> + ( char * ) _vq_lengthlist__44u8_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44u8_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u9__long [ ] = { <nl> + static const char _huff_lengthlist__44u9__long [ ] = { <nl> 3 , 9 , 13 , 13 , 14 , 15 , 14 , 14 , 15 , 15 , 5 , 5 , 9 , 10 , 12 , 12 , <nl> 13 , 14 , 16 , 15 , 10 , 6 , 6 , 6 , 8 , 11 , 12 , 13 , 16 , 15 , 11 , 7 , <nl> 5 , 3 , 5 , 8 , 10 , 12 , 15 , 15 , 10 , 10 , 7 , 4 , 3 , 5 , 8 , 10 , <nl> static const long _huff_lengthlist__44u9__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44u9__long = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u9__long , <nl> + ( char * ) _huff_lengthlist__44u9__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44u9__short [ ] = { <nl> + static const char _huff_lengthlist__44u9__short [ ] = { <nl> 9 , 16 , 18 , 18 , 17 , 17 , 17 , 17 , 17 , 17 , 5 , 8 , 11 , 12 , 11 , 12 , <nl> 17 , 17 , 16 , 16 , 6 , 6 , 8 , 8 , 9 , 10 , 14 , 15 , 16 , 16 , 6 , 7 , <nl> 7 , 4 , 6 , 9 , 13 , 16 , 16 , 16 , 6 , 6 , 7 , 4 , 5 , 8 , 11 , 15 , <nl> static const long _huff_lengthlist__44u9__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44u9__short = { <nl> 2 , 100 , <nl> - ( long * ) _huff_lengthlist__44u9__short , <nl> + ( char * ) _huff_lengthlist__44u9__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44u9_p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p1_0 [ ] = { <nl> 1 , 5 , 5 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , <nl> 9 , 9 , 5 , 7 , 7 , 7 , 9 , 9 , 7 , 9 , 9 , 5 , 7 , 7 , 7 , 9 , <nl> 9 , 7 , 9 , 9 , 8 , 9 , 9 , 9 , 10 , 11 , 9 , 11 , 11 , 7 , 9 , 9 , <nl> static const long _vq_lengthlist__44u9_p1_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u9_p1_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p2_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p2_0 [ ] = { <nl> 3 , 5 , 5 , 8 , 8 , 5 , 7 , 7 , 9 , 9 , 6 , 7 , 7 , 9 , 9 , 8 , <nl> 9 , 9 , 11 , 10 , 8 , 9 , 9 , 11 , 11 , 6 , 7 , 7 , 9 , 9 , 7 , 8 , <nl> 8 , 10 , 10 , 7 , 8 , 8 , 9 , 10 , 9 , 10 , 10 , 11 , 11 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u9_p2_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p2_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44u9_p2_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p2_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p3_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p3_0 [ ] = { <nl> 3 , 4 , 4 , 5 , 5 , 7 , 7 , 8 , 8 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , <nl> 9 , 9 , 4 , 4 , 5 , 6 , 6 , 7 , 7 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , <nl> 8 , 8 , 9 , 9 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u9_p3_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p3_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44u9_p3_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p3_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p4_0 [ ] = { <nl> 16 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p4_0 [ ] = { <nl> 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , <nl> 11 , 5 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> 11 , 11 , 5 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u9_p4_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p4_0 = { <nl> 2 , 289 , <nl> - ( long * ) _vq_lengthlist__44u9_p4_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p4_0 , <nl> 1 , - 529530880 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p5_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p5_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 7 , 7 , 5 , 7 , 7 , 5 , 8 , 8 , 8 , 9 , 9 , 7 , <nl> 9 , 9 , 5 , 8 , 8 , 7 , 9 , 9 , 8 , 9 , 9 , 5 , 8 , 8 , 8 , 10 , <nl> 10 , 8 , 10 , 10 , 7 , 10 , 10 , 9 , 10 , 12 , 9 , 11 , 11 , 7 , 10 , 10 , <nl> static const long _vq_lengthlist__44u9_p5_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p5_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44u9_p5_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p5_0 , <nl> 1 , - 529137664 , 1618345984 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p5_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p5_1 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p5_1 [ ] = { <nl> 5 , 5 , 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 5 , 6 , 6 , 6 , 6 , <nl> 7 , 7 , 7 , 7 , 8 , 7 , 5 , 6 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 8 , 8 , 6 , 6 , 6 , 7 , <nl> static const long _vq_lengthlist__44u9_p5_1 [ ] = { <nl> <nl> static const static_codebook _44u9_p5_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u9_p5_1 , <nl> + ( char * ) _vq_lengthlist__44u9_p5_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p5_1 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p6_0 [ ] = { <nl> 2 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 6 , 5 , <nl> 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 10 , 4 , 5 , 6 , 7 , 7 , 8 , <nl> 8 , 8 , 8 , 9 , 9 , 10 , 10 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44u9_p6_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u9_p6_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p6_1 [ ] = { <nl> 4 , 4 , 4 , 5 , 5 , 4 , 5 , 4 , 5 , 5 , 4 , 4 , 5 , 5 , 5 , 5 , <nl> 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , 5 , <nl> } ; <nl> <nl> static const static_codebook _44u9_p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44u9_p6_1 , <nl> + ( char * ) _vq_lengthlist__44u9_p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p7_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p7_0 [ ] = { <nl> 1 , 4 , 5 , 6 , 6 , 7 , 7 , 8 , 9 , 10 , 10 , 11 , 11 , 5 , 6 , 6 , <nl> 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 5 , 6 , 6 , 7 , 7 , 8 , <nl> 8 , 9 , 9 , 10 , 10 , 11 , 11 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , <nl> static const long _vq_lengthlist__44u9_p7_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p7_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44u9_p7_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p7_0 , <nl> 1 , - 523206656 , 1618345984 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p7_1 [ ] = { <nl> 10 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p7_1 [ ] = { <nl> 5 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 6 , 6 , 6 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 6 , 6 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 6 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u9_p7_1 [ ] = { <nl> <nl> static const static_codebook _44u9_p7_1 = { <nl> 2 , 121 , <nl> - ( long * ) _vq_lengthlist__44u9_p7_1 , <nl> + ( char * ) _vq_lengthlist__44u9_p7_1 , <nl> 1 , - 531365888 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p8_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p8_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p8_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 10 , 9 , 11 , 10 , 4 , <nl> 6 , 6 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 10 , 11 , 10 , 12 , 10 , 4 , 6 , <nl> 6 , 8 , 8 , 9 , 10 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 7 , 8 , 8 , <nl> static const long _vq_lengthlist__44u9_p8_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p8_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u9_p8_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p8_0 , <nl> 1 , - 520986624 , 1620377600 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p8_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p8_1 [ ] = { <nl> 20 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p8_1 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p8_1 [ ] = { <nl> 4 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , 8 , 8 , 8 , 8 , 9 , 9 , <nl> 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 9 , 6 , 6 , 6 , 7 , 7 , 8 , <nl> static const long _vq_lengthlist__44u9_p8_1 [ ] = { <nl> <nl> static const static_codebook _44u9_p8_1 = { <nl> 2 , 441 , <nl> - ( long * ) _vq_lengthlist__44u9_p8_1 , <nl> + ( char * ) _vq_lengthlist__44u9_p8_1 , <nl> 1 , - 529268736 , 1611661312 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p8_1 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p9_0 [ ] = { <nl> 14 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p9_0 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p9_0 [ ] = { <nl> 1 , 3 , 3 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 4 , <nl> 10 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 4 , 10 , <nl> 10 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44u9_p9_0 [ ] = { <nl> <nl> static const static_codebook _44u9_p9_0 = { <nl> 2 , 225 , <nl> - ( long * ) _vq_lengthlist__44u9_p9_0 , <nl> + ( char * ) _vq_lengthlist__44u9_p9_0 , <nl> 1 , - 510036736 , 1631393792 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p9_0 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p9_1 [ ] = { <nl> 18 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p9_1 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p9_1 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 7 , 8 , 7 , 9 , 8 , 10 , 9 , 10 , 10 , 11 , <nl> 11 , 12 , 12 , 4 , 7 , 6 , 9 , 9 , 10 , 9 , 9 , 8 , 10 , 10 , 11 , 10 , <nl> 12 , 10 , 13 , 12 , 13 , 12 , 4 , 6 , 6 , 9 , 9 , 9 , 9 , 9 , 9 , 10 , <nl> static const long _vq_lengthlist__44u9_p9_1 [ ] = { <nl> <nl> static const static_codebook _44u9_p9_1 = { <nl> 2 , 361 , <nl> - ( long * ) _vq_lengthlist__44u9_p9_1 , <nl> + ( char * ) _vq_lengthlist__44u9_p9_1 , <nl> 1 , - 518287360 , 1622704128 , 5 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p9_1 , <nl> 0 <nl> static const long _vq_quantlist__44u9_p9_2 [ ] = { <nl> 48 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44u9_p9_2 [ ] = { <nl> + static const char _vq_lengthlist__44u9_p9_2 [ ] = { <nl> 2 , 4 , 4 , 5 , 4 , 5 , 5 , 5 , 5 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , <nl> 6 , 6 , 6 , 7 , 6 , 7 , 6 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , 7 , <nl> static const long _vq_lengthlist__44u9_p9_2 [ ] = { <nl> <nl> static const static_codebook _44u9_p9_2 = { <nl> 1 , 49 , <nl> - ( long * ) _vq_lengthlist__44u9_p9_2 , <nl> + ( char * ) _vq_lengthlist__44u9_p9_2 , <nl> 1 , - 526909440 , 1611661312 , 6 , 0 , <nl> ( long * ) _vq_quantlist__44u9_p9_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44un1__long [ ] = { <nl> + static const char _huff_lengthlist__44un1__long [ ] = { <nl> 5 , 6 , 12 , 9 , 14 , 9 , 9 , 19 , 6 , 1 , 5 , 5 , 8 , 7 , 9 , 19 , <nl> 12 , 4 , 4 , 7 , 7 , 9 , 11 , 18 , 9 , 5 , 6 , 6 , 8 , 7 , 8 , 17 , <nl> 14 , 8 , 7 , 8 , 8 , 10 , 12 , 18 , 9 , 6 , 8 , 6 , 8 , 6 , 8 , 18 , <nl> static const long _huff_lengthlist__44un1__long [ ] = { <nl> <nl> static const static_codebook _huff_book__44un1__long = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44un1__long , <nl> + ( char * ) _huff_lengthlist__44un1__long , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> static const long _vq_quantlist__44un1__p1_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p1_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p1_0 [ ] = { <nl> 1 , 4 , 4 , 5 , 8 , 7 , 5 , 7 , 8 , 5 , 8 , 8 , 8 , 10 , 11 , 8 , <nl> 10 , 11 , 5 , 8 , 8 , 8 , 11 , 10 , 8 , 11 , 10 , 4 , 9 , 9 , 8 , 11 , <nl> 11 , 8 , 11 , 11 , 8 , 12 , 11 , 10 , 12 , 14 , 11 , 13 , 13 , 7 , 11 , 11 , <nl> static const long _vq_lengthlist__44un1__p1_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p1_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44un1__p1_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p1_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p1_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p2_0 [ ] = { <nl> 2 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p2_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p2_0 [ ] = { <nl> 2 , 4 , 4 , 5 , 6 , 6 , 5 , 6 , 6 , 5 , 7 , 7 , 7 , 8 , 8 , 6 , <nl> 7 , 9 , 5 , 7 , 7 , 6 , 8 , 7 , 7 , 9 , 8 , 4 , 7 , 7 , 7 , 9 , <nl> 8 , 7 , 8 , 8 , 7 , 9 , 8 , 8 , 8 , 10 , 9 , 10 , 10 , 6 , 8 , 8 , <nl> static const long _vq_lengthlist__44un1__p2_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p2_0 = { <nl> 4 , 81 , <nl> - ( long * ) _vq_lengthlist__44un1__p2_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p2_0 , <nl> 1 , - 535822336 , 1611661312 , 2 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p2_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p3_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p3_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p3_0 [ ] = { <nl> 1 , 5 , 5 , 8 , 8 , 5 , 8 , 7 , 9 , 9 , 5 , 7 , 8 , 9 , 9 , 9 , <nl> 10 , 9 , 12 , 12 , 9 , 9 , 10 , 11 , 12 , 6 , 8 , 8 , 10 , 10 , 8 , 10 , <nl> 10 , 11 , 11 , 8 , 9 , 10 , 11 , 11 , 10 , 11 , 11 , 13 , 13 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44un1__p3_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p3_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44un1__p3_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p3_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p3_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p4_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p4_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p4_0 [ ] = { <nl> 3 , 5 , 5 , 9 , 9 , 5 , 6 , 6 , 10 , 9 , 5 , 6 , 6 , 9 , 10 , 10 , <nl> 10 , 10 , 12 , 11 , 9 , 10 , 10 , 12 , 12 , 5 , 7 , 7 , 10 , 10 , 7 , 7 , <nl> 8 , 10 , 11 , 7 , 7 , 8 , 10 , 11 , 10 , 10 , 11 , 11 , 13 , 10 , 10 , 11 , <nl> static const long _vq_lengthlist__44un1__p4_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p4_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44un1__p4_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p4_0 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p4_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p5_0 [ ] = { <nl> 8 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p5_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p5_0 [ ] = { <nl> 1 , 4 , 4 , 7 , 7 , 8 , 8 , 9 , 9 , 4 , 6 , 5 , 8 , 7 , 8 , 8 , <nl> 10 , 9 , 4 , 6 , 6 , 8 , 8 , 8 , 8 , 10 , 10 , 7 , 8 , 7 , 9 , 9 , <nl> 9 , 9 , 11 , 10 , 7 , 8 , 8 , 9 , 9 , 9 , 9 , 10 , 11 , 8 , 8 , 8 , <nl> static const long _vq_lengthlist__44un1__p5_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p5_0 = { <nl> 2 , 81 , <nl> - ( long * ) _vq_lengthlist__44un1__p5_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p5_0 , <nl> 1 , - 531628032 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p5_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p6_0 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p6_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p6_0 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 8 , 8 , 10 , 10 , 11 , 11 , 15 , 15 , 4 , 5 , 5 , <nl> 8 , 8 , 9 , 9 , 11 , 11 , 12 , 12 , 16 , 16 , 4 , 5 , 6 , 8 , 8 , 9 , <nl> 9 , 11 , 11 , 12 , 12 , 14 , 14 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 12 , <nl> static const long _vq_lengthlist__44un1__p6_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p6_0 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44un1__p6_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p6_0 , <nl> 1 , - 526516224 , 1616117760 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p6_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p6_1 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p6_1 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p6_1 [ ] = { <nl> 2 , 4 , 4 , 5 , 5 , 4 , 5 , 5 , 5 , 5 , 4 , 5 , 5 , 6 , 5 , 5 , <nl> 6 , 5 , 6 , 6 , 5 , 6 , 6 , 6 , 6 , <nl> } ; <nl> <nl> static const static_codebook _44un1__p6_1 = { <nl> 2 , 25 , <nl> - ( long * ) _vq_lengthlist__44un1__p6_1 , <nl> + ( char * ) _vq_lengthlist__44un1__p6_1 , <nl> 1 , - 533725184 , 1611661312 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p6_1 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p7_0 [ ] = { <nl> 4 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p7_0 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p7_0 [ ] = { <nl> 1 , 5 , 3 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 8 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 10 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , 11 , <nl> static const long _vq_lengthlist__44un1__p7_0 [ ] = { <nl> <nl> static const static_codebook _44un1__p7_0 = { <nl> 4 , 625 , <nl> - ( long * ) _vq_lengthlist__44un1__p7_0 , <nl> + ( char * ) _vq_lengthlist__44un1__p7_0 , <nl> 1 , - 518709248 , 1626677248 , 3 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p7_0 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p7_1 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p7_1 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p7_1 [ ] = { <nl> 1 , 4 , 4 , 6 , 6 , 6 , 6 , 9 , 8 , 9 , 8 , 8 , 8 , 5 , 7 , 7 , <nl> 7 , 7 , 8 , 8 , 8 , 10 , 8 , 10 , 8 , 9 , 5 , 7 , 7 , 8 , 7 , 7 , <nl> 8 , 10 , 10 , 11 , 10 , 12 , 11 , 7 , 8 , 8 , 9 , 9 , 9 , 10 , 11 , 11 , <nl> static const long _vq_lengthlist__44un1__p7_1 [ ] = { <nl> <nl> static const static_codebook _44un1__p7_1 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44un1__p7_1 , <nl> + ( char * ) _vq_lengthlist__44un1__p7_1 , <nl> 1 , - 523010048 , 1618608128 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p7_1 , <nl> 0 <nl> static const long _vq_quantlist__44un1__p7_2 [ ] = { <nl> 12 , <nl> } ; <nl> <nl> - static const long _vq_lengthlist__44un1__p7_2 [ ] = { <nl> + static const char _vq_lengthlist__44un1__p7_2 [ ] = { <nl> 3 , 4 , 4 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 9 , 8 , 4 , 5 , 5 , <nl> 6 , 6 , 8 , 8 , 9 , 8 , 9 , 9 , 9 , 9 , 4 , 5 , 5 , 7 , 6 , 8 , <nl> 8 , 8 , 8 , 9 , 8 , 9 , 8 , 6 , 7 , 7 , 7 , 8 , 8 , 8 , 9 , 9 , <nl> static const long _vq_lengthlist__44un1__p7_2 [ ] = { <nl> <nl> static const static_codebook _44un1__p7_2 = { <nl> 2 , 169 , <nl> - ( long * ) _vq_lengthlist__44un1__p7_2 , <nl> + ( char * ) _vq_lengthlist__44un1__p7_2 , <nl> 1 , - 531103744 , 1611661312 , 4 , 0 , <nl> ( long * ) _vq_quantlist__44un1__p7_2 , <nl> 0 <nl> } ; <nl> <nl> - static const long _huff_lengthlist__44un1__short [ ] = { <nl> + static const char _huff_lengthlist__44un1__short [ ] = { <nl> 12 , 12 , 14 , 12 , 14 , 14 , 14 , 14 , 12 , 6 , 6 , 8 , 9 , 9 , 11 , 14 , <nl> 12 , 4 , 2 , 6 , 6 , 7 , 11 , 14 , 13 , 6 , 5 , 7 , 8 , 9 , 11 , 14 , <nl> 13 , 8 , 5 , 8 , 6 , 8 , 12 , 14 , 12 , 7 , 7 , 8 , 8 , 8 , 10 , 14 , <nl> static const long _huff_lengthlist__44un1__short [ ] = { <nl> <nl> static const static_codebook _huff_book__44un1__short = { <nl> 2 , 64 , <nl> - ( long * ) _huff_lengthlist__44un1__short , <nl> + ( char * ) _huff_lengthlist__44un1__short , <nl> 0 , 0 , 0 , 0 , 0 , <nl> NULL , <nl> 0 <nl> mmm a / drivers / vorbis / codebook . c <nl> ppp b / drivers / vorbis / codebook . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : basic codebook pack / unpack / code / decode operations <nl> - last mod : $ Id : codebook . c 17553 2010 - 10 - 21 17 : 54 : 26Z tterribe $ <nl> + last mod : $ Id : codebook . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> int vorbis_staticbook_pack ( const static_codebook * c , oggpack_buffer * opb ) { <nl> oggpack_write ( opb , c - > lengthlist [ 0 ] - 1 , 5 ) ; / * 1 to 32 * / <nl> <nl> for ( i = 1 ; i < c - > entries ; i + + ) { <nl> - long this = c - > lengthlist [ i ] ; <nl> - long last = c - > lengthlist [ i - 1 ] ; <nl> + char this = c - > lengthlist [ i ] ; <nl> + char last = c - > lengthlist [ i - 1 ] ; <nl> if ( this > last ) { <nl> for ( j = last ; j < this ; j + + ) { <nl> - oggpack_write ( opb , i - count , _ilog ( c - > entries - count ) ) ; <nl> + oggpack_write ( opb , i - count , ov_ilog ( c - > entries - count ) ) ; <nl> count = i ; <nl> } <nl> } <nl> } <nl> - oggpack_write ( opb , i - count , _ilog ( c - > entries - count ) ) ; <nl> + oggpack_write ( opb , i - count , ov_ilog ( c - > entries - count ) ) ; <nl> <nl> } else { <nl> / * length random . Again , we don ' t code the codeword itself , just <nl> static_codebook * vorbis_staticbook_unpack ( oggpack_buffer * opb ) { <nl> s - > entries = oggpack_read ( opb , 24 ) ; <nl> if ( s - > entries = = - 1 ) goto _eofout ; <nl> <nl> - if ( _ilog ( s - > dim ) + _ilog ( s - > entries ) > 24 ) goto _eofout ; <nl> + if ( ov_ilog ( s - > dim ) + ov_ilog ( s - > entries ) > 24 ) goto _eofout ; <nl> <nl> / * codeword ordering . . . . length ordered or unordered ? * / <nl> switch ( ( int ) oggpack_read ( opb , 1 ) ) { <nl> static_codebook * vorbis_staticbook_unpack ( oggpack_buffer * opb ) { <nl> s - > lengthlist = _ogg_malloc ( sizeof ( * s - > lengthlist ) * s - > entries ) ; <nl> <nl> for ( i = 0 ; i < s - > entries ; ) { <nl> - long num = oggpack_read ( opb , _ilog ( s - > entries - i ) ) ; <nl> + long num = oggpack_read ( opb , ov_ilog ( s - > entries - i ) ) ; <nl> if ( num = = - 1 ) goto _eofout ; <nl> if ( length > 32 | | num > s - > entries - i | | <nl> ( num > 0 & & ( num - 1 ) > > ( length - 1 ) > 1 ) ) { <nl> STIN long decode_packed_entry_number ( codebook * book , oggpack_buffer * b ) { <nl> hi = book - > used_entries ; <nl> } <nl> <nl> + / * Single entry codebooks use a firsttablen of 1 and a <nl> + dec_maxlength of 1 . If a single - entry codebook gets here ( due to <nl> + failure to read one bit above ) , the next look attempt will also <nl> + fail and we ' ll correctly kick out instead of trying to walk the <nl> + underformed tree * / <nl> + <nl> lok = oggpack_look ( b , read ) ; <nl> <nl> while ( lok < 0 & & read > 1 ) <nl> long vorbis_book_decode ( codebook * book , oggpack_buffer * b ) { <nl> } <nl> <nl> / * returns 0 on OK or - 1 on eof * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> + / * decode vector / dim granularity gaurding is done in the upper layer * / <nl> long vorbis_book_decodevs_add ( codebook * book , float * a , oggpack_buffer * b , int n ) { <nl> if ( book - > used_entries > 0 ) { <nl> int step = n / book - > dim ; <nl> long vorbis_book_decodevs_add ( codebook * book , float * a , oggpack_buffer * b , int n ) { <nl> return ( 0 ) ; <nl> } <nl> <nl> + / * decode vector / dim granularity gaurding is done in the upper layer * / <nl> long vorbis_book_decodev_add ( codebook * book , float * a , oggpack_buffer * b , int n ) { <nl> if ( book - > used_entries > 0 ) { <nl> int i , j , entry ; <nl> long vorbis_book_decodev_add ( codebook * book , float * a , oggpack_buffer * b , int n ) { <nl> return ( 0 ) ; <nl> } <nl> <nl> + / * unlike the others , we guard against n not being an integer number <nl> + of < dim > internally rather than in the upper layer ( called only by <nl> + floor0 ) * / <nl> long vorbis_book_decodev_set ( codebook * book , float * a , oggpack_buffer * b , int n ) { <nl> if ( book - > used_entries > 0 ) { <nl> int i , j , entry ; <nl> long vorbis_book_decodev_set ( codebook * book , float * a , oggpack_buffer * b , int n ) { <nl> entry = decode_packed_entry_number ( book , b ) ; <nl> if ( entry = = - 1 ) return ( - 1 ) ; <nl> t = book - > valuelist + entry * book - > dim ; <nl> - for ( j = 0 ; j < book - > dim ; ) <nl> + for ( j = 0 ; i < n & & j < book - > dim ; ) { <nl> a [ i + + ] = t [ j + + ] ; <nl> + } <nl> } <nl> } else { <nl> - int i , j ; <nl> + int i ; <nl> <nl> for ( i = 0 ; i < n ; ) { <nl> - for ( j = 0 ; j < book - > dim ; ) <nl> - a [ i + + ] = 0 . f ; <nl> + a [ i + + ] = 0 . f ; <nl> } <nl> } <nl> return ( 0 ) ; <nl> mmm a / drivers / vorbis / codebook . h <nl> ppp b / drivers / vorbis / codebook . h <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : basic shared codebook operations <nl> - last mod : $ Id : codebook . h 17030 2010 - 03 - 25 06 : 52 : 55Z xiphmont $ <nl> + last mod : $ Id : codebook . h 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> <nl> * / <nl> <nl> typedef struct static_codebook { <nl> - long dim ; / * codebook dimensions ( elements per vector ) * / <nl> - long entries ; / * codebook entries * / <nl> - long * lengthlist ; / * codeword lengths in bits * / <nl> + long dim ; / * codebook dimensions ( elements per vector ) * / <nl> + long entries ; / * codebook entries * / <nl> + char * lengthlist ; / * codeword lengths in bits * / <nl> <nl> / * mapping * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - int maptype ; / * 0 = none <nl> - 1 = implicitly populated values from map column <nl> - 2 = listed arbitrary values * / <nl> + int maptype ; / * 0 = none <nl> + 1 = implicitly populated values from map column <nl> + 2 = listed arbitrary values * / <nl> <nl> / * The below does a linear , single monotonic sequence mapping . * / <nl> long q_min ; / * packed 32 bit float ; quant value 0 maps to minval * / <nl> extern float * _book_logdist ( const static_codebook * b , float * vals ) ; <nl> extern float _float32_unpack ( long val ) ; <nl> extern long _float32_pack ( float val ) ; <nl> extern int _best ( codebook * book , float * a , int step ) ; <nl> - extern int _ilog ( unsigned int v ) ; <nl> extern long _book_maptype1_quantvals ( const static_codebook * b ) ; <nl> <nl> extern int vorbis_book_besterror ( codebook * book , float * a , int step , int addmul ) ; <nl> mmm a / drivers / vorbis / floor0 . c <nl> ppp b / drivers / vorbis / floor0 . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : floor backend 0 implementation <nl> - last mod : $ Id : floor0 . c 17558 2010 - 10 - 22 00 : 24 : 41Z tterribe $ <nl> + last mod : $ Id : floor0 . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static vorbis_look_floor * floor0_look ( vorbis_dsp_state * vd , <nl> vorbis_info_floor * i ) { <nl> vorbis_info_floor0 * info = ( vorbis_info_floor0 * ) i ; <nl> vorbis_look_floor0 * look = _ogg_calloc ( 1 , sizeof ( * look ) ) ; <nl> + <nl> + ( void ) vd ; <nl> + <nl> look - > m = info - > order ; <nl> look - > ln = info - > barkmap ; <nl> look - > vi = info ; <nl> static void * floor0_inverse1 ( vorbis_block * vb , vorbis_look_floor * i ) { <nl> if ( ampraw > 0 ) { / * also handles the - 1 out of data case * / <nl> long maxval = ( 1 < < info - > ampbits ) - 1 ; <nl> float amp = ( float ) ampraw / maxval * info - > ampdB ; <nl> - int booknum = oggpack_read ( & vb - > opb , _ilog ( info - > numbooks ) ) ; <nl> + int booknum = oggpack_read ( & vb - > opb , ov_ilog ( info - > numbooks ) ) ; <nl> <nl> if ( booknum ! = - 1 & & booknum < info - > numbooks ) { / * be paranoid * / <nl> codec_setup_info * ci = vb - > vd - > vi - > codec_setup ; <nl> static void * floor0_inverse1 ( vorbis_block * vb , vorbis_look_floor * i ) { <nl> vector * / <nl> float * lsp = _vorbis_block_alloc ( vb , sizeof ( * lsp ) * ( look - > m + b - > dim + 1 ) ) ; <nl> <nl> - for ( j = 0 ; j < look - > m ; j + = b - > dim ) <nl> - if ( vorbis_book_decodev_set ( b , lsp + j , & vb - > opb , b - > dim ) = = - 1 ) goto eop ; <nl> + if ( vorbis_book_decodev_set ( b , lsp , & vb - > opb , look - > m ) = = - 1 ) goto eop ; <nl> for ( j = 0 ; j < look - > m ; ) { <nl> - for ( k = 0 ; k < b - > dim ; k + + , j + + ) lsp [ j ] + = last ; <nl> + for ( k = 0 ; j < look - > m & & k < b - > dim ; k + + , j + + ) lsp [ j ] + = last ; <nl> last = lsp [ j - 1 ] ; <nl> } <nl> <nl> mmm a / drivers / vorbis / floor1 . c <nl> ppp b / drivers / vorbis / floor1 . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : floor backend 1 implementation <nl> - last mod : $ Id : floor1 . c 17555 2010 - 10 - 21 18 : 14 : 51Z tterribe $ <nl> + last mod : $ Id : floor1 . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static void floor1_free_look ( vorbis_look_floor * i ) { <nl> } <nl> } <nl> <nl> - static int ilog ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> - } <nl> - <nl> - static int ilog2 ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - if ( v ) - - v ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> - } <nl> - <nl> static void floor1_pack ( vorbis_info_floor * i , oggpack_buffer * opb ) { <nl> vorbis_info_floor1 * info = ( vorbis_info_floor1 * ) i ; <nl> int j , k ; <nl> static void floor1_pack ( vorbis_info_floor * i , oggpack_buffer * opb ) { <nl> <nl> / * save out the post list * / <nl> oggpack_write ( opb , info - > mult - 1 , 2 ) ; / * only 1 , 2 , 3 , 4 legal now * / <nl> - oggpack_write ( opb , ilog2 ( maxposit ) , 4 ) ; <nl> - rangebits = ilog2 ( maxposit ) ; <nl> + / * maxposit cannot legally be less than 1 ; this is encode - side , we <nl> + can assume our setup is OK * / <nl> + oggpack_write ( opb , ov_ilog ( maxposit - 1 ) , 4 ) ; <nl> + rangebits = ov_ilog ( maxposit - 1 ) ; <nl> <nl> for ( j = 0 , k = 0 ; j < info - > partitions ; j + + ) { <nl> count + = info - > class_dim [ info - > partitionclass [ j ] ] ; <nl> static vorbis_info_floor * floor1_unpack ( vorbis_info * vi , oggpack_buffer * opb ) { <nl> <nl> for ( j = 0 , k = 0 ; j < info - > partitions ; j + + ) { <nl> count + = info - > class_dim [ info - > partitionclass [ j ] ] ; <nl> + if ( count > VIF_POSIT ) goto err_out ; <nl> for ( ; k < count ; k + + ) { <nl> int t = info - > postlist [ k + 2 ] = oggpack_read ( opb , rangebits ) ; <nl> if ( t < 0 | | t > = ( 1 < < rangebits ) ) <nl> static vorbis_look_floor * floor1_look ( vorbis_dsp_state * vd , <nl> vorbis_look_floor1 * look = _ogg_calloc ( 1 , sizeof ( * look ) ) ; <nl> int i , j , n = 0 ; <nl> <nl> + ( void ) vd ; <nl> + <nl> look - > vi = info ; <nl> look - > n = info - > postlist [ 1 ] ; <nl> <nl> int floor1_encode ( oggpack_buffer * opb , vorbis_block * vb , <nl> <nl> / * beginning / end post * / <nl> look - > frames + + ; <nl> - look - > postbits + = ilog ( look - > quant_q - 1 ) * 2 ; <nl> - oggpack_write ( opb , out [ 0 ] , ilog ( look - > quant_q - 1 ) ) ; <nl> - oggpack_write ( opb , out [ 1 ] , ilog ( look - > quant_q - 1 ) ) ; <nl> + look - > postbits + = ov_ilog ( look - > quant_q - 1 ) * 2 ; <nl> + oggpack_write ( opb , out [ 0 ] , ov_ilog ( look - > quant_q - 1 ) ) ; <nl> + oggpack_write ( opb , out [ 1 ] , ov_ilog ( look - > quant_q - 1 ) ) ; <nl> <nl> <nl> / * partition by partition * / <nl> int floor1_encode ( oggpack_buffer * opb , vorbis_block * vb , <nl> <nl> / * generate the partition ' s first stage cascade value * / <nl> if ( csubbits ) { <nl> - int maxval [ 8 ] ; <nl> + int maxval [ 8 ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; / * gcc ' s static analysis <nl> + issues a warning without <nl> + initialization * / <nl> for ( k = 0 ; k < csub ; k + + ) { <nl> int booknum = info - > class_subbook [ class ] [ k ] ; <nl> if ( booknum < 0 ) { <nl> static void * floor1_inverse1 ( vorbis_block * vb , vorbis_look_floor * in ) { <nl> if ( oggpack_read ( & vb - > opb , 1 ) = = 1 ) { <nl> int * fit_value = _vorbis_block_alloc ( vb , ( look - > posts ) * sizeof ( * fit_value ) ) ; <nl> <nl> - fit_value [ 0 ] = oggpack_read ( & vb - > opb , ilog ( look - > quant_q - 1 ) ) ; <nl> - fit_value [ 1 ] = oggpack_read ( & vb - > opb , ilog ( look - > quant_q - 1 ) ) ; <nl> + fit_value [ 0 ] = oggpack_read ( & vb - > opb , ov_ilog ( look - > quant_q - 1 ) ) ; <nl> + fit_value [ 1 ] = oggpack_read ( & vb - > opb , ov_ilog ( look - > quant_q - 1 ) ) ; <nl> <nl> / * partition by partition * / <nl> for ( i = 0 , j = 2 ; i < info - > partitions ; i + + ) { <nl> mmm a / drivers / vorbis / info . c <nl> ppp b / drivers / vorbis / info . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2010 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : maintain the info structure , info < - > header packets <nl> - last mod : $ Id : info . c 17584 2010 - 11 - 01 19 : 26 : 16Z xiphmont $ <nl> + last mod : $ Id : info . c 19441 2015 - 01 - 21 01 : 17 : 41Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> <nl> # include " misc . h " <nl> # include " os . h " <nl> <nl> - # define GENERAL_VENDOR_STRING " Xiph . Org libVorbis 1 . 3 . 2 " <nl> - # define ENCODE_VENDOR_STRING " Xiph . Org libVorbis I 20101101 ( Schaufenugget ) " <nl> + # define GENERAL_VENDOR_STRING " Xiph . Org libVorbis 1 . 3 . 5 " <nl> + # define ENCODE_VENDOR_STRING " Xiph . Org libVorbis I 20150105 ( ⛄ ⛄ ⛄ ⛄ ) " <nl> <nl> / * helpers * / <nl> - static int ilog2 ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - if ( v ) - - v ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> - } <nl> - <nl> static void _v_writestring ( oggpack_buffer * o , const char * s , int bytes ) { <nl> <nl> while ( bytes - - ) { <nl> static int _vorbis_unpack_comment ( vorbis_comment * vc , oggpack_buffer * opb ) { <nl> static int _vorbis_unpack_books ( vorbis_info * vi , oggpack_buffer * opb ) { <nl> codec_setup_info * ci = vi - > codec_setup ; <nl> int i ; <nl> - if ( ! ci ) return ( OV_EFAULT ) ; <nl> <nl> / * codebooks * / <nl> ci - > books = oggpack_read ( opb , 8 ) + 1 ; <nl> int vorbis_synthesis_headerin ( vorbis_info * vi , vorbis_comment * vc , ogg_packet * op ) <nl> / * um . . . we didn ' t get the initial header * / <nl> return ( OV_EBADHEADER ) ; <nl> } <nl> + if ( vc - > vendor ! = NULL ) { <nl> + / * previously initialized comment header * / <nl> + return ( OV_EBADHEADER ) ; <nl> + } <nl> <nl> return ( _vorbis_unpack_comment ( vc , & opb ) ) ; <nl> <nl> int vorbis_synthesis_headerin ( vorbis_info * vi , vorbis_comment * vc , ogg_packet * op ) <nl> / * um . . . we didn ; t get the initial header or comments yet * / <nl> return ( OV_EBADHEADER ) ; <nl> } <nl> + if ( vi - > codec_setup = = NULL ) { <nl> + / * improperly initialized vorbis_info * / <nl> + return ( OV_EFAULT ) ; <nl> + } <nl> + if ( ( ( codec_setup_info * ) vi - > codec_setup ) - > books > 0 ) { <nl> + / * previously initialized setup header * / <nl> + return ( OV_EBADHEADER ) ; <nl> + } <nl> <nl> return ( _vorbis_unpack_books ( vi , & opb ) ) ; <nl> <nl> int vorbis_synthesis_headerin ( vorbis_info * vi , vorbis_comment * vc , ogg_packet * op ) <nl> <nl> static int _vorbis_pack_info ( oggpack_buffer * opb , vorbis_info * vi ) { <nl> codec_setup_info * ci = vi - > codec_setup ; <nl> - if ( ! ci ) return ( OV_EFAULT ) ; <nl> + if ( ! ci | | <nl> + ci - > blocksizes [ 0 ] < 64 | | <nl> + ci - > blocksizes [ 1 ] < ci - > blocksizes [ 0 ] ) { <nl> + return ( OV_EFAULT ) ; <nl> + } <nl> <nl> / * preamble * / <nl> oggpack_write ( opb , 0x01 , 8 ) ; <nl> static int _vorbis_pack_info ( oggpack_buffer * opb , vorbis_info * vi ) { <nl> oggpack_write ( opb , vi - > bitrate_nominal , 32 ) ; <nl> oggpack_write ( opb , vi - > bitrate_lower , 32 ) ; <nl> <nl> - oggpack_write ( opb , ilog2 ( ci - > blocksizes [ 0 ] ) , 4 ) ; <nl> - oggpack_write ( opb , ilog2 ( ci - > blocksizes [ 1 ] ) , 4 ) ; <nl> + oggpack_write ( opb , ov_ilog ( ci - > blocksizes [ 0 ] - 1 ) , 4 ) ; <nl> + oggpack_write ( opb , ov_ilog ( ci - > blocksizes [ 1 ] - 1 ) , 4 ) ; <nl> oggpack_write ( opb , 1 , 1 ) ; <nl> <nl> return ( 0 ) ; <nl> int vorbis_commentheader_out ( vorbis_comment * vc , <nl> oggpack_buffer opb ; <nl> <nl> oggpack_writeinit ( & opb ) ; <nl> - if ( _vorbis_pack_comment ( & opb , vc ) ) return OV_EIMPL ; <nl> + if ( _vorbis_pack_comment ( & opb , vc ) ) { <nl> + oggpack_writeclear ( & opb ) ; <nl> + return OV_EIMPL ; <nl> + } <nl> <nl> op - > packet = _ogg_malloc ( oggpack_bytes ( & opb ) ) ; <nl> memcpy ( op - > packet , opb . buffer , oggpack_bytes ( & opb ) ) ; <nl> int vorbis_commentheader_out ( vorbis_comment * vc , <nl> op - > granulepos = 0 ; <nl> op - > packetno = 1 ; <nl> <nl> + oggpack_writeclear ( & opb ) ; <nl> return 0 ; <nl> } <nl> <nl> int vorbis_analysis_headerout ( vorbis_dsp_state * v , <nl> oggpack_buffer opb ; <nl> private_state * b = v - > backend_state ; <nl> <nl> - if ( ! b ) { <nl> + if ( ! b | | vi - > channels < = 0 ) { <nl> ret = OV_EFAULT ; <nl> goto err_out ; <nl> } <nl> mmm a / drivers / vorbis / lsp . c <nl> ppp b / drivers / vorbis / lsp . c <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : LSP ( also called LSF ) conversion routines <nl> - last mod : $ Id : lsp . c 17538 2010 - 10 - 15 02 : 52 : 29Z tterribe $ <nl> + last mod : $ Id : lsp . c 19453 2015 - 03 - 02 22 : 35 : 34Z xiphmont $ <nl> <nl> The LSP generation code is taken ( with minimal modification and a <nl> few bugfixes ) from " On the Computation of the LSP Frequencies " by <nl> static int comp ( const void * a , const void * b ) { <nl> # define EPSILON 10e - 7 <nl> static int Laguerre_With_Deflation ( float * a , int ord , float * r ) { <nl> int i , m ; <nl> - double lastdelta = 0 . f ; <nl> double * defl = alloca ( sizeof ( * defl ) * ( ord + 1 ) ) ; <nl> for ( i = 0 ; i < = ord ; i + + ) defl [ i ] = a [ i ] ; <nl> <nl> static int Laguerre_With_Deflation ( float * a , int ord , float * r ) { <nl> if ( delta < 0 . f ) delta * = - 1 ; <nl> <nl> if ( fabs ( delta / new ) < 10e - 12 ) break ; <nl> - lastdelta = delta ; <nl> } <nl> <nl> r [ m - 1 ] = new ; <nl> mmm a / drivers / vorbis / mapping0 . c <nl> ppp b / drivers / vorbis / mapping0 . c <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : channel mapping 0 implementation <nl> - last mod : $ Id : mapping0 . c 17022 2010 - 03 - 25 03 : 45 : 42Z xiphmont $ <nl> + last mod : $ Id : mapping0 . c 19441 2015 - 01 - 21 01 : 17 : 41Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static void mapping0_free_info ( vorbis_info_mapping * i ) { <nl> } <nl> } <nl> <nl> - static int ilog ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - if ( v ) - - v ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> - } <nl> - <nl> static void mapping0_pack ( vorbis_info * vi , vorbis_info_mapping * vm , <nl> oggpack_buffer * opb ) { <nl> int i ; <nl> static void mapping0_pack ( vorbis_info * vi , vorbis_info_mapping * vm , <nl> oggpack_write ( opb , info - > coupling_steps - 1 , 8 ) ; <nl> <nl> for ( i = 0 ; i < info - > coupling_steps ; i + + ) { <nl> - oggpack_write ( opb , info - > coupling_mag [ i ] , ilog ( vi - > channels ) ) ; <nl> - oggpack_write ( opb , info - > coupling_ang [ i ] , ilog ( vi - > channels ) ) ; <nl> + oggpack_write ( opb , info - > coupling_mag [ i ] , ov_ilog ( vi - > channels - 1 ) ) ; <nl> + oggpack_write ( opb , info - > coupling_ang [ i ] , ov_ilog ( vi - > channels - 1 ) ) ; <nl> } <nl> } else <nl> oggpack_write ( opb , 0 , 1 ) ; <nl> static vorbis_info_mapping * mapping0_unpack ( vorbis_info * vi , oggpack_buffer * opb ) <nl> vorbis_info_mapping0 * info = _ogg_calloc ( 1 , sizeof ( * info ) ) ; <nl> codec_setup_info * ci = vi - > codec_setup ; <nl> memset ( info , 0 , sizeof ( * info ) ) ; <nl> + if ( vi - > channels < = 0 ) goto err_out ; <nl> <nl> b = oggpack_read ( opb , 1 ) ; <nl> if ( b < 0 ) goto err_out ; <nl> static vorbis_info_mapping * mapping0_unpack ( vorbis_info * vi , oggpack_buffer * opb ) <nl> info - > coupling_steps = oggpack_read ( opb , 8 ) + 1 ; <nl> if ( info - > coupling_steps < = 0 ) goto err_out ; <nl> for ( i = 0 ; i < info - > coupling_steps ; i + + ) { <nl> - int testM = info - > coupling_mag [ i ] = oggpack_read ( opb , ilog ( vi - > channels ) ) ; <nl> - int testA = info - > coupling_ang [ i ] = oggpack_read ( opb , ilog ( vi - > channels ) ) ; <nl> + / * vi - > channels > 0 is enforced in the caller * / <nl> + int testM = info - > coupling_mag [ i ] = <nl> + oggpack_read ( opb , ov_ilog ( vi - > channels - 1 ) ) ; <nl> + int testA = info - > coupling_ang [ i ] = <nl> + oggpack_read ( opb , ov_ilog ( vi - > channels - 1 ) ) ; <nl> <nl> if ( testM < 0 | | <nl> testA < 0 | | <nl> mmm a / drivers / vorbis / misc . h <nl> ppp b / drivers / vorbis / misc . h <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : miscellaneous prototypes <nl> - last mod : $ Id : misc . h 16227 2009 - 07 - 08 06 : 58 : 46Z xiphmont $ <nl> + last mod : $ Id : misc . h 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> <nl> <nl> extern void * _vorbis_block_alloc ( vorbis_block * vb , long bytes ) ; <nl> extern void _vorbis_block_ripcord ( vorbis_block * vb ) ; <nl> + extern int ov_ilog ( ogg_uint32_t v ) ; <nl> <nl> # ifdef ANALYSIS <nl> extern int analysis_noisy ; <nl> mmm a / drivers / vorbis / modes / residue_44p51 . h <nl> ppp b / drivers / vorbis / modes / residue_44p51 . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : toplevel residue templates for 32 / 44 . 1 / 48kHz uncoupled <nl> - last mod : $ Id $ <nl> + last mod : $ Id : residue_44p51 . h 19013 2013 - 11 - 12 04 : 04 : 50Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> mmm a / drivers / vorbis / modes / setup_44p51 . h <nl> ppp b / drivers / vorbis / modes / setup_44p51 . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : toplevel settings for 44 . 1 / 48kHz 5 . 1 surround modes <nl> - last mod : $ Id $ <nl> + last mod : $ Id : setup_44p51 . h 19013 2013 - 11 - 12 04 : 04 : 50Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> mmm a / drivers / vorbis / os . h <nl> ppp b / drivers / vorbis / os . h <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : # ifdef jail to whip a few platforms into the UNIX ideal . <nl> - last mod : $ Id : os . h 16227 2009 - 07 - 08 06 : 58 : 46Z xiphmont $ <nl> + last mod : $ Id : os . h 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static inline int vorbis_ftoi ( double f ) { / * yes , double ! Otherwise , <nl> <nl> <nl> / * MSVC inline assembly . 32 bit only ; inline ASM isn ' t implemented in the <nl> - * 64 bit compiler * / <nl> - # if defined ( _MSC_VER ) & & ! defined ( _WIN64 ) & & ! defined ( _WIN32_WCE ) & & ! defined ( WINDOWSPHONE_ENABLED ) <nl> + * 64 bit compiler and doesn ' t work on arm . * / <nl> + # if defined ( _MSC_VER ) & & ! defined ( _WIN64 ) & & \ <nl> + ! defined ( _WIN32_WCE ) & & ! defined ( _M_ARM ) <nl> # define VORBIS_FPU_CONTROL <nl> <nl> typedef ogg_int16_t vorbis_fpu_control ; <nl> static __inline int vorbis_ftoi ( double f ) { <nl> } <nl> <nl> static __inline void vorbis_fpu_setround ( vorbis_fpu_control * fpu ) { <nl> + ( void ) fpu ; <nl> } <nl> <nl> static __inline void vorbis_fpu_restore ( vorbis_fpu_control fpu ) { <nl> + ( void ) fpu ; <nl> } <nl> <nl> # endif / * Special MSVC 32 bit implementation * / <nl> static __inline int vorbis_ftoi ( double f ) { <nl> } <nl> <nl> static __inline void vorbis_fpu_setround ( vorbis_fpu_control * fpu ) { <nl> + ( void ) fpu ; <nl> } <nl> <nl> static __inline void vorbis_fpu_restore ( vorbis_fpu_control fpu ) { <nl> + ( void ) fpu ; <nl> } <nl> <nl> # endif / * Special MSVC x64 implementation * / <nl> mmm a / drivers / vorbis / psy . c <nl> ppp b / drivers / vorbis / psy . c <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : psychoacoustics not including preecho <nl> - last mod : $ Id : psy . c 17569 2010 - 10 - 26 17 : 09 : 47Z xiphmont $ <nl> + last mod : $ Id : psy . c 18077 2011 - 09 - 02 02 : 49 : 00Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> void _vp_couple_quantize_normalize ( int blobno , <nl> int limit = g - > coupling_pointlimit [ p - > vi - > blockflag ] [ blobno ] ; <nl> float prepoint = stereo_threshholds [ g - > coupling_prepointamp [ blobno ] ] ; <nl> float postpoint = stereo_threshholds [ g - > coupling_postpointamp [ blobno ] ] ; <nl> + # if 0 <nl> float de = 0 . 1 * p - > m_val ; / * a blend of the AoTuV M2 and M3 code here and below * / <nl> + # endif <nl> <nl> / * mdct is our raw mdct output , floor not removed . * / <nl> / * inout passes in the ifloor , passes back quantized result * / <nl> void _vp_couple_quantize_normalize ( int blobno , <nl> reM [ j ] + = reA [ j ] ; <nl> qeM [ j ] = fabs ( reM [ j ] ) ; <nl> } else { <nl> + # if 0 <nl> / * AoTuV * / <nl> / * * @ M2 * * <nl> The boost problem by the combination of noise normalization and point stereo is eased . <nl> However , this is a temporary patch . <nl> by Aoyumi @ 2004 / 04 / 18 <nl> * / <nl> - / * float derate = ( 1 . 0 - de * ( ( float ) ( j - limit + i ) / ( float ) ( n - limit ) ) ) ; * / <nl> - / * elliptical <nl> + float derate = ( 1 . 0 - de * ( ( float ) ( j - limit + i ) / ( float ) ( n - limit ) ) ) ; <nl> + / * elliptical * / <nl> if ( reM [ j ] + reA [ j ] < 0 ) { <nl> reM [ j ] = - ( qeM [ j ] = ( fabs ( reM [ j ] ) + fabs ( reA [ j ] ) ) * derate * derate ) ; <nl> } else { <nl> reM [ j ] = ( qeM [ j ] = ( fabs ( reM [ j ] ) + fabs ( reA [ j ] ) ) * derate * derate ) ; <nl> - } * / <nl> - <nl> + } <nl> + # else <nl> / * elliptical * / <nl> if ( reM [ j ] + reA [ j ] < 0 ) { <nl> reM [ j ] = - ( qeM [ j ] = fabs ( reM [ j ] ) + fabs ( reA [ j ] ) ) ; <nl> } else { <nl> reM [ j ] = ( qeM [ j ] = fabs ( reM [ j ] ) + fabs ( reA [ j ] ) ) ; <nl> } <nl> - <nl> + # endif <nl> <nl> } <nl> reA [ j ] = qeA [ j ] = 0 . f ; <nl> mmm a / drivers / vorbis / res0 . c <nl> ppp b / drivers / vorbis / res0 . c <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : residue backend 0 , 1 and 2 implementation <nl> - last mod : $ Id : res0 . c 17556 2010 - 10 - 21 18 : 25 : 19Z tterribe $ <nl> + last mod : $ Id : res0 . c 19441 2015 - 01 - 21 01 : 17 : 41Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> void res0_free_look ( vorbis_look_residue * i ) { <nl> } <nl> } <nl> <nl> - static int ilog ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> - } <nl> - <nl> static int icount ( unsigned int v ) { <nl> int ret = 0 ; <nl> while ( v ) { <nl> void res0_pack ( vorbis_info_residue * vr , oggpack_buffer * opb ) { <nl> bitmask of one indicates this partition class has bits to write <nl> this pass * / <nl> for ( j = 0 ; j < info - > partitions ; j + + ) { <nl> - if ( ilog ( info - > secondstages [ j ] ) > 3 ) { <nl> + if ( ov_ilog ( info - > secondstages [ j ] ) > 3 ) { <nl> / * yes , this is a minor hack due to not thinking ahead * / <nl> oggpack_write ( opb , info - > secondstages [ j ] , 3 ) ; <nl> oggpack_write ( opb , 1 , 1 ) ; <nl> vorbis_look_residue * res0_look ( vorbis_dsp_state * vd , <nl> look - > partbooks = _ogg_calloc ( look - > parts , sizeof ( * look - > partbooks ) ) ; <nl> <nl> for ( j = 0 ; j < look - > parts ; j + + ) { <nl> - int stages = ilog ( info - > secondstages [ j ] ) ; <nl> + int stages = ov_ilog ( info - > secondstages [ j ] ) ; <nl> if ( stages ) { <nl> if ( stages > maxstage ) maxstage = stages ; <nl> look - > partbooks [ j ] = _ogg_calloc ( stages , sizeof ( * look - > partbooks [ j ] ) ) ; <nl> static int local_book_besterror ( codebook * book , int * a ) { <nl> return ( index ) ; <nl> } <nl> <nl> + # ifdef TRAIN_RES <nl> static int _encodepart ( oggpack_buffer * opb , int * vec , int n , <nl> codebook * book , long * acc ) { <nl> + # else <nl> + static int _encodepart ( oggpack_buffer * opb , int * vec , int n , <nl> + codebook * book ) { <nl> + # endif <nl> int i , bits = 0 ; <nl> int dim = book - > dim ; <nl> int step = n / dim ; <nl> static long * * _2class ( vorbis_block * vb , vorbis_look_residue * vl , int * * in , <nl> } <nl> <nl> static int _01forward ( oggpack_buffer * opb , <nl> - vorbis_block * vb , vorbis_look_residue * vl , <nl> + vorbis_look_residue * vl , <nl> int * * in , int ch , <nl> long * * partword , <nl> + # ifdef TRAIN_RES <nl> int ( * encode ) ( oggpack_buffer * , int * , int , <nl> codebook * , long * ) , <nl> - int submap ) { <nl> + int submap <nl> + # else <nl> + int ( * encode ) ( oggpack_buffer * , int * , int , <nl> + codebook * ) <nl> + # endif <nl> + ) { <nl> long i , j , k , s ; <nl> vorbis_look_residue0 * look = ( vorbis_look_residue0 * ) vl ; <nl> vorbis_info_residue0 * info = look - > info ; <nl> static int _01forward ( oggpack_buffer * opb , <nl> codebook * statebook = look - > partbooks [ partword [ j ] [ i ] ] [ s ] ; <nl> if ( statebook ) { <nl> int ret ; <nl> - long * accumulator = NULL ; <nl> - <nl> # ifdef TRAIN_RES <nl> + long * accumulator = NULL ; <nl> accumulator = look - > training_data [ s ] [ partword [ j ] [ i ] ] ; <nl> { <nl> int l ; <nl> static int _01forward ( oggpack_buffer * opb , <nl> look - > training_max [ s ] [ partword [ j ] [ i ] ] = samples [ l ] ; <nl> } <nl> } <nl> - # endif <nl> - <nl> ret = encode ( opb , in [ j ] + offset , samples_per_partition , <nl> statebook , accumulator ) ; <nl> + # else <nl> + ret = encode ( opb , in [ j ] + offset , samples_per_partition , <nl> + statebook ) ; <nl> + # endif <nl> <nl> look - > postbits + = ret ; <nl> resbits [ partword [ j ] [ i ] ] + = ret ; <nl> static int _01forward ( oggpack_buffer * opb , <nl> } <nl> } <nl> <nl> - / * { <nl> - long total = 0 ; <nl> - long totalbits = 0 ; <nl> - fprintf ( stderr , " % d : : " , vb - > mode ) ; <nl> - for ( k = 0 ; k < possible_partitions ; k + + ) { <nl> - fprintf ( stderr , " % ld / % 1 . 2g , " , resvals [ k ] , ( float ) resbits [ k ] / resvals [ k ] ) ; <nl> - total + = resvals [ k ] ; <nl> - totalbits + = resbits [ k ] ; <nl> - } <nl> - <nl> - fprintf ( stderr , " : : % ld : % 1 . 2g \ n " , total , ( double ) totalbits / total ) ; <nl> - } * / <nl> - <nl> return ( 0 ) ; <nl> } <nl> <nl> int res0_inverse ( vorbis_block * vb , vorbis_look_residue * vl , <nl> int res1_forward ( oggpack_buffer * opb , vorbis_block * vb , vorbis_look_residue * vl , <nl> int * * in , int * nonzero , int ch , long * * partword , int submap ) { <nl> int i , used = 0 ; <nl> + ( void ) vb ; <nl> for ( i = 0 ; i < ch ; i + + ) <nl> if ( nonzero [ i ] ) <nl> in [ used + + ] = in [ i ] ; <nl> <nl> if ( used ) { <nl> - return _01forward ( opb , vb , vl , in , used , partword , _encodepart , submap ) ; <nl> + # ifdef TRAIN_RES <nl> + return _01forward ( opb , vl , in , used , partword , _encodepart , submap ) ; <nl> + # else <nl> + ( void ) submap ; <nl> + return _01forward ( opb , vl , in , used , partword , _encodepart ) ; <nl> + # endif <nl> } else { <nl> return ( 0 ) ; <nl> } <nl> int res2_forward ( oggpack_buffer * opb , <nl> } <nl> <nl> if ( used ) { <nl> - return _01forward ( opb , vb , vl , & work , 1 , partword , _encodepart , submap ) ; <nl> + # ifdef TRAIN_RES <nl> + return _01forward ( opb , vl , & work , 1 , partword , _encodepart , submap ) ; <nl> + # else <nl> + ( void ) submap ; <nl> + return _01forward ( opb , vl , & work , 1 , partword , _encodepart ) ; <nl> + # endif <nl> } else { <nl> return ( 0 ) ; <nl> } <nl> mmm a / drivers / vorbis / sharedbook . c <nl> ppp b / drivers / vorbis / sharedbook . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : basic shared codebook operations <nl> - last mod : $ Id : sharedbook . c 17030 2010 - 03 - 25 06 : 52 : 55Z xiphmont $ <nl> + last mod : $ Id : sharedbook . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> <nl> # include " scales . h " <nl> <nl> / * * * * pack / unpack helpers * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> - int _ilog ( unsigned int v ) { <nl> - int ret = 0 ; <nl> - while ( v ) { <nl> - ret + + ; <nl> - v > > = 1 ; <nl> - } <nl> - return ( ret ) ; <nl> + <nl> + int ov_ilog ( ogg_uint32_t v ) { <nl> + int ret ; <nl> + for ( ret = 0 ; v ; ret + + ) v > > = 1 ; <nl> + return ret ; <nl> } <nl> <nl> / * 32 bit float ( not IEEE ; nonnormalized mantissa + <nl> float _float32_unpack ( long val ) { <nl> / * given a list of word lengths , generate a list of codewords . Works <nl> for length ordered or unordered , always assigns the lowest valued <nl> codewords first . Extended to handle unused entries ( length 0 ) * / <nl> - ogg_uint32_t * _make_words ( long * l , long n , long sparsecount ) { <nl> + ogg_uint32_t * _make_words ( char * l , long n , long sparsecount ) { <nl> long i , j , count = 0 ; <nl> ogg_uint32_t marker [ 33 ] ; <nl> ogg_uint32_t * r = _ogg_malloc ( ( sparsecount ? sparsecount : n ) * sizeof ( * r ) ) ; <nl> ogg_uint32_t * _make_words ( long * l , long n , long sparsecount ) { <nl> if ( sparsecount = = 0 ) count + + ; <nl> } <nl> <nl> - / * sanity check the huffman tree ; an underpopulated tree must be <nl> - rejected . The only exception is the one - node pseudo - nil tree , <nl> - which appears to be underpopulated because the tree doesn ' t <nl> - really exist ; there ' s only one possible ' codeword ' or zero bits , <nl> - but the above tree - gen code doesn ' t mark that . * / <nl> - if ( sparsecount ! = 1 ) { <nl> + / * any underpopulated tree must be rejected . * / <nl> + / * Single - entry codebooks are a retconned extension to the spec . <nl> + They have a single codeword ' 0 ' of length 1 that results in an <nl> + underpopulated tree . Shield that case from the underformed tree check . * / <nl> + if ( ! ( count = = 1 & & marker [ 2 ] = = 2 ) ) { <nl> for ( i = 1 ; i < 33 ; i + + ) <nl> if ( marker [ i ] & ( 0xffffffffUL > > ( 32 - i ) ) ) { <nl> - _ogg_free ( r ) ; <nl> - return ( NULL ) ; <nl> + _ogg_free ( r ) ; <nl> + return ( NULL ) ; <nl> } <nl> } <nl> <nl> static int sort32a ( const void * a , const void * b ) { <nl> int vorbis_book_init_decode ( codebook * c , const static_codebook * s ) { <nl> int i , j , n = 0 , tabn ; <nl> int * sortindex ; <nl> + <nl> memset ( c , 0 , sizeof ( * c ) ) ; <nl> <nl> - / * count actually used entries * / <nl> + / * count actually used entries and find max length * / <nl> for ( i = 0 ; i < s - > entries ; i + + ) <nl> if ( s - > lengthlist [ i ] > 0 ) <nl> n + + ; <nl> int vorbis_book_init_decode ( codebook * c , const static_codebook * s ) { <nl> c - > dim = s - > dim ; <nl> <nl> if ( n > 0 ) { <nl> - <nl> / * two different remappings go on here . <nl> <nl> First , we collapse the likely sparse codebook down only to <nl> int vorbis_book_init_decode ( codebook * c , const static_codebook * s ) { <nl> c - > codelist [ sortindex [ i ] ] = codes [ i ] ; <nl> _ogg_free ( codes ) ; <nl> <nl> - <nl> c - > valuelist = _book_unquantize ( s , n , sortindex ) ; <nl> c - > dec_index = _ogg_malloc ( n * sizeof ( * c - > dec_index ) ) ; <nl> <nl> int vorbis_book_init_decode ( codebook * c , const static_codebook * s ) { <nl> c - > dec_index [ sortindex [ n + + ] ] = i ; <nl> <nl> c - > dec_codelengths = _ogg_malloc ( n * sizeof ( * c - > dec_codelengths ) ) ; <nl> + c - > dec_maxlength = 0 ; <nl> for ( n = 0 , i = 0 ; i < s - > entries ; i + + ) <nl> - if ( s - > lengthlist [ i ] > 0 ) <nl> + if ( s - > lengthlist [ i ] > 0 ) { <nl> c - > dec_codelengths [ sortindex [ n + + ] ] = s - > lengthlist [ i ] ; <nl> + if ( s - > lengthlist [ i ] > c - > dec_maxlength ) <nl> + c - > dec_maxlength = s - > lengthlist [ i ] ; <nl> + } <nl> <nl> - c - > dec_firsttablen = _ilog ( c - > used_entries ) - 4 ; / * this is magic * / <nl> - if ( c - > dec_firsttablen < 5 ) c - > dec_firsttablen = 5 ; <nl> - if ( c - > dec_firsttablen > 8 ) c - > dec_firsttablen = 8 ; <nl> - <nl> - tabn = 1 < < c - > dec_firsttablen ; <nl> - c - > dec_firsttable = _ogg_calloc ( tabn , sizeof ( * c - > dec_firsttable ) ) ; <nl> - c - > dec_maxlength = 0 ; <nl> + if ( n = = 1 & & c - > dec_maxlength = = 1 ) { <nl> + / * special case the ' single entry codebook ' with a single bit <nl> + fastpath table ( that always returns entry 0 ) in order to use <nl> + unmodified decode paths . * / <nl> + c - > dec_firsttablen = 1 ; <nl> + c - > dec_firsttable = _ogg_calloc ( 2 , sizeof ( * c - > dec_firsttable ) ) ; <nl> + c - > dec_firsttable [ 0 ] = c - > dec_firsttable [ 1 ] = 1 ; <nl> <nl> - for ( i = 0 ; i < n ; i + + ) { <nl> - if ( c - > dec_maxlength < c - > dec_codelengths [ i ] ) <nl> - c - > dec_maxlength = c - > dec_codelengths [ i ] ; <nl> - if ( c - > dec_codelengths [ i ] < = c - > dec_firsttablen ) { <nl> - ogg_uint32_t orig = bitreverse ( c - > codelist [ i ] ) ; <nl> - for ( j = 0 ; j < ( 1 < < ( c - > dec_firsttablen - c - > dec_codelengths [ i ] ) ) ; j + + ) <nl> - c - > dec_firsttable [ orig | ( j < < c - > dec_codelengths [ i ] ) ] = i + 1 ; <nl> + } else { <nl> + c - > dec_firsttablen = ov_ilog ( c - > used_entries ) - 4 ; / * this is magic * / <nl> + if ( c - > dec_firsttablen < 5 ) c - > dec_firsttablen = 5 ; <nl> + if ( c - > dec_firsttablen > 8 ) c - > dec_firsttablen = 8 ; <nl> + <nl> + tabn = 1 < < c - > dec_firsttablen ; <nl> + c - > dec_firsttable = _ogg_calloc ( tabn , sizeof ( * c - > dec_firsttable ) ) ; <nl> + <nl> + for ( i = 0 ; i < n ; i + + ) { <nl> + if ( c - > dec_codelengths [ i ] < = c - > dec_firsttablen ) { <nl> + ogg_uint32_t orig = bitreverse ( c - > codelist [ i ] ) ; <nl> + for ( j = 0 ; j < ( 1 < < ( c - > dec_firsttablen - c - > dec_codelengths [ i ] ) ) ; j + + ) <nl> + c - > dec_firsttable [ orig | ( j < < c - > dec_codelengths [ i ] ) ] = i + 1 ; <nl> + } <nl> } <nl> - } <nl> <nl> - / * now fill in ' unused ' entries in the firsttable with hi / lo search <nl> - hints for the non - direct - hits * / <nl> - { <nl> - ogg_uint32_t mask = 0xfffffffeUL < < ( 31 - c - > dec_firsttablen ) ; <nl> - long lo = 0 , hi = 0 ; <nl> - <nl> - for ( i = 0 ; i < tabn ; i + + ) { <nl> - ogg_uint32_t word = i < < ( 32 - c - > dec_firsttablen ) ; <nl> - if ( c - > dec_firsttable [ bitreverse ( word ) ] = = 0 ) { <nl> - while ( ( lo + 1 ) < n & & c - > codelist [ lo + 1 ] < = word ) lo + + ; <nl> - while ( hi < n & & word > = ( c - > codelist [ hi ] & mask ) ) hi + + ; <nl> - <nl> - / * we only actually have 15 bits per hint to play with here . <nl> - In order to overflow gracefully ( nothing breaks , efficiency <nl> - just drops ) , encode as the difference from the extremes . * / <nl> - { <nl> - unsigned long loval = lo ; <nl> - unsigned long hival = n - hi ; <nl> - <nl> - if ( loval > 0x7fff ) loval = 0x7fff ; <nl> - if ( hival > 0x7fff ) hival = 0x7fff ; <nl> - c - > dec_firsttable [ bitreverse ( word ) ] = <nl> - 0x80000000UL | ( loval < < 15 ) | hival ; <nl> + / * now fill in ' unused ' entries in the firsttable with hi / lo search <nl> + hints for the non - direct - hits * / <nl> + { <nl> + ogg_uint32_t mask = 0xfffffffeUL < < ( 31 - c - > dec_firsttablen ) ; <nl> + long lo = 0 , hi = 0 ; <nl> + <nl> + for ( i = 0 ; i < tabn ; i + + ) { <nl> + ogg_uint32_t word = i < < ( 32 - c - > dec_firsttablen ) ; <nl> + if ( c - > dec_firsttable [ bitreverse ( word ) ] = = 0 ) { <nl> + while ( ( lo + 1 ) < n & & c - > codelist [ lo + 1 ] < = word ) lo + + ; <nl> + while ( hi < n & & word > = ( c - > codelist [ hi ] & mask ) ) hi + + ; <nl> + <nl> + / * we only actually have 15 bits per hint to play with here . <nl> + In order to overflow gracefully ( nothing breaks , efficiency <nl> + just drops ) , encode as the difference from the extremes . * / <nl> + { <nl> + unsigned long loval = lo ; <nl> + unsigned long hival = n - hi ; <nl> + <nl> + if ( loval > 0x7fff ) loval = 0x7fff ; <nl> + if ( hival > 0x7fff ) hival = 0x7fff ; <nl> + c - > dec_firsttable [ bitreverse ( word ) ] = <nl> + 0x80000000UL | ( loval < < 15 ) | hival ; <nl> + } <nl> } <nl> } <nl> } <nl> mmm a / drivers / vorbis / synthesis . c <nl> ppp b / drivers / vorbis / synthesis . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : single - block PCM synthesis <nl> - last mod : $ Id : synthesis . c 17474 2010 - 09 - 30 03 : 41 : 41Z gmaxwell $ <nl> + last mod : $ Id : synthesis . c 19441 2015 - 01 - 21 01 : 17 : 41Z xiphmont $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> long vorbis_packet_blocksize ( vorbis_info * vi , ogg_packet * op ) { <nl> oggpack_buffer opb ; <nl> int mode ; <nl> <nl> + if ( ci = = NULL | | ci - > modes < = 0 ) { <nl> + / * codec setup not properly intialized * / <nl> + return ( OV_EFAULT ) ; <nl> + } <nl> + <nl> oggpack_readinit ( & opb , op - > packet , op - > bytes ) ; <nl> <nl> / * Check the packet type * / <nl> long vorbis_packet_blocksize ( vorbis_info * vi , ogg_packet * op ) { <nl> return ( OV_ENOTAUDIO ) ; <nl> } <nl> <nl> - { <nl> - int modebits = 0 ; <nl> - int v = ci - > modes ; <nl> - while ( v > 1 ) { <nl> - modebits + + ; <nl> - v > > = 1 ; <nl> - } <nl> - <nl> - / * read our mode and pre / post windowsize * / <nl> - mode = oggpack_read ( & opb , modebits ) ; <nl> - } <nl> - if ( mode = = - 1 ) return ( OV_EBADPACKET ) ; <nl> + / * read our mode and pre / post windowsize * / <nl> + mode = oggpack_read ( & opb , ov_ilog ( ci - > modes - 1 ) ) ; <nl> + if ( mode = = - 1 | | ! ci - > mode_param [ mode ] ) return ( OV_EBADPACKET ) ; <nl> return ( ci - > blocksizes [ ci - > mode_param [ mode ] - > blockflag ] ) ; <nl> } <nl> <nl> mmm a / drivers / vorbis / tone . c <nl> ppp b / drivers / vorbis / tone . c <nl> <nl> # include < math . h > <nl> # include < string . h > <nl> <nl> - # ifndef M_PI <nl> - # define M_PI 3 . 14159265358979323846 <nl> - # endif <nl> - <nl> void usage ( ) { <nl> fprintf ( stderr , " tone < frequency_Hz > , [ < amplitude > ] [ < frequency_Hz > , [ < amplitude > ] . . . ] \ n " ) ; <nl> exit ( 1 ) ; <nl> mmm a / drivers / vorbis / vorbisenc . c <nl> ppp b / drivers / vorbis / vorbisenc . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : simple programmatic interface for encoder mode setup <nl> - last mod : $ Id : vorbisenc . c 17028 2010 - 03 - 25 05 : 22 : 15Z xiphmont $ <nl> + last mod : $ Id : vorbisenc . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> int vorbis_encode_setup_vbr ( vorbis_info * vi , <nl> long channels , <nl> long rate , <nl> float quality ) { <nl> - codec_setup_info * ci = vi - > codec_setup ; <nl> - highlevel_encode_setup * hi = & ci - > hi ; <nl> + codec_setup_info * ci ; <nl> + highlevel_encode_setup * hi ; <nl> + if ( rate < = 0 ) return OV_EINVAL ; <nl> + <nl> + ci = vi - > codec_setup ; <nl> + hi = & ci - > hi ; <nl> <nl> quality + = . 0000001 ; <nl> if ( quality > = 1 . ) quality = . 9999 ; <nl> int vorbis_encode_setup_managed ( vorbis_info * vi , <nl> long nominal_bitrate , <nl> long min_bitrate ) { <nl> <nl> - codec_setup_info * ci = vi - > codec_setup ; <nl> - highlevel_encode_setup * hi = & ci - > hi ; <nl> - double tnominal = nominal_bitrate ; <nl> + codec_setup_info * ci ; <nl> + highlevel_encode_setup * hi ; <nl> + double tnominal ; <nl> + if ( rate < = 0 ) return OV_EINVAL ; <nl> + <nl> + ci = vi - > codec_setup ; <nl> + hi = & ci - > hi ; <nl> + tnominal = nominal_bitrate ; <nl> <nl> if ( nominal_bitrate < = 0 . ) { <nl> if ( max_bitrate > 0 . ) { <nl> mmm a / drivers / vorbis / vorbisfile . c <nl> ppp b / drivers / vorbis / vorbisfile . c <nl> <nl> * GOVERNED BY A BSD - STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * <nl> * IN ' COPYING ' . PLEASE READ THESE TERMS BEFORE DISTRIBUTING . * <nl> * * <nl> - * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2009 * <nl> + * THE OggVorbis SOURCE CODE IS ( C ) COPYRIGHT 1994 - 2015 * <nl> * by the Xiph . Org Foundation http : / / www . xiph . org / * <nl> * * <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : stdio - based convenience library for opening / seeking / decoding <nl> - last mod : $ Id : vorbisfile . c 17573 2010 - 10 - 27 14 : 53 : 59Z xiphmont $ <nl> + last mod : $ Id : vorbisfile . c 19457 2015 - 03 - 03 00 : 15 : 29Z giles $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> static long _get_data ( OggVorbis_File * vf ) { <nl> / * save a tiny smidge of verbosity to make the code more readable * / <nl> static int _seek_helper ( OggVorbis_File * vf , ogg_int64_t offset ) { <nl> if ( vf - > datasource ) { <nl> - if ( ! ( vf - > callbacks . seek_func ) | | <nl> - ( vf - > callbacks . seek_func ) ( vf - > datasource , offset , SEEK_SET ) = = - 1 ) <nl> - return OV_EREAD ; <nl> - vf - > offset = offset ; <nl> - ogg_sync_reset ( & vf - > oy ) ; <nl> + / * only seek if the file position isn ' t already there * / <nl> + if ( vf - > offset ! = offset ) { <nl> + if ( ! ( vf - > callbacks . seek_func ) | | <nl> + ( vf - > callbacks . seek_func ) ( vf - > datasource , offset , SEEK_SET ) = = - 1 ) <nl> + return OV_EREAD ; <nl> + vf - > offset = offset ; <nl> + ogg_sync_reset ( & vf - > oy ) ; <nl> + } <nl> } else { <nl> / * shouldn ' t happen unless someone writes a broken callback * / <nl> return OV_EFAULT ; <nl> static ogg_int64_t _get_next_page ( OggVorbis_File * vf , ogg_page * og , <nl> } <nl> } <nl> <nl> - / * find the latest page beginning before the current stream cursor <nl> - position . Much dirtier than the above as Ogg doesn ' t have any <nl> - backward search linkage . no ' readp ' as it will certainly have to <nl> - read . * / <nl> + / * find the latest page beginning before the passed in position . Much <nl> + dirtier than the above as Ogg doesn ' t have any backward search <nl> + linkage . no ' readp ' as it will certainly have to read . * / <nl> / * returns offset or OV_EREAD , OV_FAULT * / <nl> - static ogg_int64_t _get_prev_page ( OggVorbis_File * vf , ogg_page * og ) { <nl> - ogg_int64_t begin = vf - > offset ; <nl> - ogg_int64_t end = begin ; <nl> + static ogg_int64_t _get_prev_page ( OggVorbis_File * vf , ogg_int64_t begin , ogg_page * og ) { <nl> + ogg_int64_t end = begin ; <nl> ogg_int64_t ret ; <nl> ogg_int64_t offset = - 1 ; <nl> <nl> static int _lookup_page_serialno ( ogg_page * og , long * serialno_list , int n ) { <nl> info of last page of the matching serial number instead of the very <nl> last page . If no page of the specified serialno is seen , it will <nl> return the info of last page and alter * serialno . * / <nl> - static ogg_int64_t _get_prev_page_serial ( OggVorbis_File * vf , <nl> + static ogg_int64_t _get_prev_page_serial ( OggVorbis_File * vf , ogg_int64_t begin , <nl> long * serial_list , int serial_n , <nl> int * serialno , ogg_int64_t * granpos ) { <nl> ogg_page og ; <nl> - ogg_int64_t begin = vf - > offset ; <nl> ogg_int64_t end = begin ; <nl> ogg_int64_t ret ; <nl> <nl> static ogg_int64_t _initial_pcmoffset ( OggVorbis_File * vf , vorbis_info * vi ) { <nl> while ( ( result = ogg_stream_packetout ( & vf - > os , & op ) ) ) { <nl> if ( result > 0 ) { / * ignore holes * / <nl> long thisblock = vorbis_packet_blocksize ( vi , & op ) ; <nl> - if ( lastblock ! = - 1 ) <nl> - accumulated + = ( lastblock + thisblock ) > > 2 ; <nl> - lastblock = thisblock ; <nl> + if ( thisblock > = 0 ) { <nl> + if ( lastblock ! = - 1 ) <nl> + accumulated + = ( lastblock + thisblock ) > > 2 ; <nl> + lastblock = thisblock ; <nl> + } <nl> } <nl> } <nl> <nl> static int _bisect_forward_serialno ( OggVorbis_File * vf , <nl> down to ( or just started with ) a single link . Now we need to <nl> find the last vorbis page belonging to the first vorbis stream <nl> for this link . * / <nl> - <nl> + searched = end ; <nl> while ( endserial ! = serialno ) { <nl> endserial = serialno ; <nl> - vf - > offset = _get_prev_page_serial ( vf , currentno_list , currentnos , & endserial , & endgran ) ; <nl> + searched = _get_prev_page_serial ( vf , searched , currentno_list , currentnos , & endserial , & endgran ) ; <nl> } <nl> <nl> vf - > links = m + 1 ; <nl> static int _bisect_forward_serialno ( OggVorbis_File * vf , <nl> <nl> } else { <nl> <nl> + / * last page is not in the starting stream ' s serial number list , <nl> + so we have multiple links . Find where the stream that begins <nl> + our bisection ends . * / <nl> + <nl> long * next_serialno_list = NULL ; <nl> int next_serialnos = 0 ; <nl> vorbis_info vi ; <nl> vorbis_comment vc ; <nl> + int testserial = serialno + 1 ; <nl> <nl> / * the below guards against garbage seperating the last and <nl> first pages of two links . * / <nl> static int _bisect_forward_serialno ( OggVorbis_File * vf , <nl> bisect = ( searched + endsearched ) / 2 ; <nl> } <nl> <nl> - if ( bisect ! = vf - > offset ) { <nl> - ret = _seek_helper ( vf , bisect ) ; <nl> - if ( ret ) return ( ret ) ; <nl> - } <nl> + ret = _seek_helper ( vf , bisect ) ; <nl> + if ( ret ) return ( ret ) ; <nl> <nl> last = _get_next_page ( vf , & og , - 1 ) ; <nl> if ( last = = OV_EREAD ) return ( OV_EREAD ) ; <nl> static int _bisect_forward_serialno ( OggVorbis_File * vf , <nl> } <nl> <nl> / * Bisection point found * / <nl> - <nl> / * for the time being , fetch end PCM offset the simple way * / <nl> - { <nl> - int testserial = serialno + 1 ; <nl> - vf - > offset = next ; <nl> - while ( testserial ! = serialno ) { <nl> - testserial = serialno ; <nl> - vf - > offset = _get_prev_page_serial ( vf , currentno_list , currentnos , & testserial , & searchgran ) ; <nl> - } <nl> + searched = next ; <nl> + while ( testserial ! = serialno ) { <nl> + testserial = serialno ; <nl> + searched = _get_prev_page_serial ( vf , searched , currentno_list , currentnos , & testserial , & searchgran ) ; <nl> } <nl> <nl> - if ( vf - > offset ! = next ) { <nl> - ret = _seek_helper ( vf , next ) ; <nl> - if ( ret ) return ( ret ) ; <nl> - } <nl> + ret = _seek_helper ( vf , next ) ; <nl> + if ( ret ) return ( ret ) ; <nl> <nl> ret = _fetch_headers ( vf , & vi , & vc , & next_serialno_list , & next_serialnos , NULL ) ; <nl> if ( ret ) return ( ret ) ; <nl> serialno = vf - > os . serialno ; <nl> dataoffset = vf - > offset ; <nl> <nl> - / * this will consume a page , however the next bistection always <nl> + / * this will consume a page , however the next bisection always <nl> starts with a raw seek * / <nl> pcmoffset = _initial_pcmoffset ( vf , & vi ) ; <nl> <nl> static int _open_seekable2 ( OggVorbis_File * vf ) { <nl> / * Get the offset of the last page of the physical bitstream , or , if <nl> we ' re lucky the last vorbis page of this link as most OggVorbis <nl> files will contain a single logical bitstream * / <nl> - end = _get_prev_page_serial ( vf , vf - > serialnos + 2 , vf - > serialnos [ 1 ] , & endserial , & endgran ) ; <nl> + end = _get_prev_page_serial ( vf , vf - > end , vf - > serialnos + 2 , vf - > serialnos [ 1 ] , & endserial , & endgran ) ; <nl> if ( end < 0 ) return ( end ) ; <nl> <nl> / * now determine bitstream structure recursively * / <nl> - if ( _bisect_forward_serialno ( vf , 0 , dataoffset , vf - > offset , endgran , endserial , <nl> + if ( _bisect_forward_serialno ( vf , 0 , dataoffset , end , endgran , endserial , <nl> vf - > serialnos + 2 , vf - > serialnos [ 1 ] , 0 ) < 0 ) return ( OV_EREAD ) ; <nl> <nl> vf - > offsets [ 0 ] = 0 ; <nl> int ov_halfrate_p ( OggVorbis_File * vf ) { <nl> / * Only partially open the vorbis file ; test for Vorbisness , and load <nl> the headers for the first chain . Do not seek ( although test for <nl> seekability ) . Use ov_test_open to finish opening the file , else <nl> - ov_clear to close / free it . Same return codes as open . * / <nl> + ov_clear to close / free it . Same return codes as open . <nl> + <nl> + Note that vorbisfile does _not_ take ownership of the file if the <nl> + call fails ; the calling applicaiton is responsible for closing the file <nl> + if this call returns an error . * / <nl> <nl> int ov_test_callbacks ( void * f , OggVorbis_File * vf , <nl> const char * initial , long ibytes , ov_callbacks callbacks ) <nl> int ov_pcm_seek_page ( OggVorbis_File * vf , ogg_int64_t pos ) { <nl> if ( pos > = total ) break ; <nl> } <nl> <nl> - / * search within the logical bitstream for the page with the highest <nl> - pcm_pos preceding ( or equal to ) pos . There is a danger here ; <nl> - missing pages or incorrect frame number information in the <nl> - bitstream could make our task impossible . Account for that ( it <nl> - would be an error condition ) * / <nl> + / * Search within the logical bitstream for the page with the highest <nl> + pcm_pos preceding pos . If we ' re looking for a position on the <nl> + first page , bisection will halt without finding our position as <nl> + it ' s before the first explicit granulepos fencepost . That case is <nl> + handled separately below . <nl> + <nl> + There is a danger here ; missing pages or incorrect frame number <nl> + information in the bitstream could make our task impossible . <nl> + Account for that ( it would be an error condition ) * / <nl> + <nl> + / * new search algorithm originally by HB ( Nicholas Vinen ) * / <nl> <nl> - / * new search algorithm by HB ( Nicholas Vinen ) * / <nl> { <nl> ogg_int64_t end = vf - > offsets [ link + 1 ] ; <nl> - ogg_int64_t begin = vf - > offsets [ link ] ; <nl> + ogg_int64_t begin = vf - > dataoffsets [ link ] ; <nl> ogg_int64_t begintime = vf - > pcmlengths [ link * 2 ] ; <nl> ogg_int64_t endtime = vf - > pcmlengths [ link * 2 + 1 ] + begintime ; <nl> ogg_int64_t target = pos - total + begintime ; <nl> - ogg_int64_t best = begin ; <nl> + ogg_int64_t best = - 1 ; <nl> + int got_page = 0 ; <nl> <nl> ogg_page og ; <nl> + <nl> + / * if we have only one page , there will be no bisection . Grab the page here * / <nl> + if ( begin = = end ) { <nl> + result = _seek_helper ( vf , begin ) ; <nl> + if ( result ) goto seek_error ; <nl> + <nl> + result = _get_next_page ( vf , & og , 1 ) ; <nl> + if ( result < 0 ) goto seek_error ; <nl> + <nl> + got_page = 1 ; <nl> + } <nl> + <nl> + / * bisection loop * / <nl> while ( begin < end ) { <nl> ogg_int64_t bisect ; <nl> <nl> int ov_pcm_seek_page ( OggVorbis_File * vf , ogg_int64_t pos ) { <nl> bisect = begin ; <nl> } <nl> <nl> - if ( bisect ! = vf - > offset ) { <nl> - result = _seek_helper ( vf , bisect ) ; <nl> - if ( result ) goto seek_error ; <nl> - } <nl> + result = _seek_helper ( vf , bisect ) ; <nl> + if ( result ) goto seek_error ; <nl> <nl> + / * read loop within the bisection loop * / <nl> while ( begin < end ) { <nl> result = _get_next_page ( vf , & og , end - vf - > offset ) ; <nl> if ( result = = OV_EREAD ) goto seek_error ; <nl> if ( result < 0 ) { <nl> + / * there is no next page ! * / <nl> if ( bisect < = begin + 1 ) <nl> - end = begin ; / * found it * / <nl> + / * No bisection left to perform . We ' ve either found the <nl> + best candidate already or failed . Exit loop . * / <nl> + end = begin ; <nl> else { <nl> + / * We tried to load a fraction of the last page ; back up a <nl> + bit and try to get the whole last page * / <nl> if ( bisect = = 0 ) goto seek_error ; <nl> bisect - = CHUNKSIZE ; <nl> + <nl> + / * don ' t repeat / loop on a read we ' ve already performed * / <nl> if ( bisect < = begin ) bisect = begin + 1 ; <nl> + <nl> + / * seek and cntinue bisection * / <nl> result = _seek_helper ( vf , bisect ) ; <nl> if ( result ) goto seek_error ; <nl> } <nl> } else { <nl> ogg_int64_t granulepos ; <nl> + got_page = 1 ; <nl> <nl> + / * got a page . analyze it * / <nl> + / * only consider pages from primary vorbis stream * / <nl> if ( ogg_page_serialno ( & og ) ! = vf - > serialnos [ link ] ) <nl> continue ; <nl> <nl> + / * only consider pages with the granulepos set * / <nl> granulepos = ogg_page_granulepos ( & og ) ; <nl> if ( granulepos = = - 1 ) continue ; <nl> <nl> if ( granulepos < target ) { <nl> + / * this page is a successful candidate ! Set state * / <nl> + <nl> best = result ; / * raw offset of packet with granulepos * / <nl> begin = vf - > offset ; / * raw offset of next page * / <nl> begintime = granulepos ; <nl> <nl> + / * if we ' re before our target but within a short distance , <nl> + don ' t bisect ; read forward * / <nl> if ( target - begintime > 44100 ) break ; <nl> - bisect = begin ; / * * not * begin + 1 * / <nl> + <nl> + bisect = begin ; / * * not * begin + 1 as above * / <nl> } else { <nl> - if ( bisect < = begin + 1 ) <nl> - end = begin ; / * found it * / <nl> - else { <nl> - if ( end = = vf - > offset ) { / * we ' re pretty close - we ' d be stuck in * / <nl> + <nl> + / * This is one of our pages , but the granpos is <nl> + post - target ; it is not a bisection return <nl> + candidate . ( The only way we ' d use it is if it ' s the <nl> + first page in the stream ; we handle that case later <nl> + outside the bisection ) * / <nl> + if ( bisect < = begin + 1 ) { <nl> + / * No bisection left to perform . We ' ve either found the <nl> + best candidate already or failed . Exit loop . * / <nl> + end = begin ; <nl> + } else { <nl> + if ( end = = vf - > offset ) { <nl> + / * bisection read to the end ; use the known page <nl> + boundary ( result ) to update bisection , back up a <nl> + little bit , and try again * / <nl> end = result ; <nl> - bisect - = CHUNKSIZE ; / * an endless loop otherwise . * / <nl> + bisect - = CHUNKSIZE ; <nl> if ( bisect < = begin ) bisect = begin + 1 ; <nl> result = _seek_helper ( vf , bisect ) ; <nl> if ( result ) goto seek_error ; <nl> } else { <nl> + / * Normal bisection * / <nl> end = bisect ; <nl> endtime = granulepos ; <nl> break ; <nl> int ov_pcm_seek_page ( OggVorbis_File * vf , ogg_int64_t pos ) { <nl> } <nl> } <nl> <nl> - / * found our page . seek to it , update pcm offset . Easier case than <nl> - raw_seek , don ' t keep packets preceding granulepos . * / <nl> - { <nl> + / * Out of bisection : did it ' fail ? ' * / <nl> + if ( best = = - 1 ) { <nl> + <nl> + / * Check the ' looking for data in first page ' special case ; <nl> + bisection would ' fail ' because our search target was before the <nl> + first PCM granule position fencepost . * / <nl> + <nl> + if ( got_page & & <nl> + begin = = vf - > dataoffsets [ link ] & & <nl> + ogg_page_serialno ( & og ) = = vf - > serialnos [ link ] ) { <nl> + <nl> + / * Yes , this is the beginning - of - stream case . We already have <nl> + our page , right at the beginning of PCM data . Set state <nl> + and return . * / <nl> + <nl> + vf - > pcm_offset = total ; <nl> + <nl> + if ( link ! = vf - > current_link ) { <nl> + / * Different link ; dump entire decode machine * / <nl> + _decode_clear ( vf ) ; <nl> + <nl> + vf - > current_link = link ; <nl> + vf - > current_serialno = vf - > serialnos [ link ] ; <nl> + vf - > ready_state = STREAMSET ; <nl> + <nl> + } else { <nl> + vorbis_synthesis_restart ( & vf - > vd ) ; <nl> + } <nl> + <nl> + ogg_stream_reset_serialno ( & vf - > os , vf - > current_serialno ) ; <nl> + ogg_stream_pagein ( & vf - > os , & og ) ; <nl> + <nl> + } else <nl> + goto seek_error ; <nl> + <nl> + } else { <nl> + <nl> + / * Bisection found our page . seek to it , update pcm offset . Easier case than <nl> + raw_seek , don ' t keep packets preceding granulepos . * / <nl> + <nl> ogg_page og ; <nl> ogg_packet op ; <nl> <nl> int ov_pcm_seek_page ( OggVorbis_File * vf , ogg_int64_t pos ) { <nl> while ( 1 ) { <nl> result = ogg_stream_packetpeek ( & vf - > os , & op ) ; <nl> if ( result = = 0 ) { <nl> - / * ! ! ! the packet finishing this page originated on a <nl> - preceding page . Keep fetching previous pages until we <nl> - get one with a granulepos or without the ' continued ' flag <nl> - set . Then just use raw_seek for simplicity . * / <nl> - <nl> - result = _seek_helper ( vf , best ) ; <nl> - if ( result < 0 ) goto seek_error ; <nl> - <nl> - while ( 1 ) { <nl> - result = _get_prev_page ( vf , & og ) ; <nl> + / * No packet returned ; we exited the bisection with ' best ' <nl> + pointing to a page with a granule position , so the packet <nl> + finishing this page ( ' best ' ) originated on a preceding <nl> + page . Keep fetching previous pages until we get one with <nl> + a granulepos or without the ' continued ' flag set . Then <nl> + just use raw_seek for simplicity . * / <nl> + / * Do not rewind past the beginning of link data ; if we do , <nl> + it ' s either a bug or a broken stream * / <nl> + result = best ; <nl> + while ( result > vf - > dataoffsets [ link ] ) { <nl> + result = _get_prev_page ( vf , result , & og ) ; <nl> if ( result < 0 ) goto seek_error ; <nl> if ( ogg_page_serialno ( & og ) = = vf - > current_serialno & & <nl> ( ogg_page_granulepos ( & og ) > - 1 | | <nl> ! ogg_page_continued ( & og ) ) ) { <nl> return ov_raw_seek ( vf , result ) ; <nl> } <nl> - vf - > offset = result ; <nl> } <nl> } <nl> if ( result < 0 ) { <nl> long ov_read_float ( OggVorbis_File * vf , float * * * pcm_channels , int length , <nl> } <nl> } <nl> <nl> - extern float * vorbis_window ( vorbis_dsp_state * v , int W ) ; <nl> + extern const float * vorbis_window ( vorbis_dsp_state * v , int W ) ; <nl> <nl> static void _ov_splice ( float * * pcm , float * * lappcm , <nl> int n1 , int n2 , <nl> int ch1 , int ch2 , <nl> - float * w1 , float * w2 ) { <nl> + const float * w1 , const float * w2 ) { <nl> int i , j ; <nl> - float * w = w1 ; <nl> + const float * w = w1 ; <nl> int n = n1 ; <nl> <nl> if ( n1 > n2 ) { <nl> int ov_crosslap ( OggVorbis_File * vf1 , OggVorbis_File * vf2 ) { <nl> vorbis_info * vi1 , * vi2 ; <nl> float * * lappcm ; <nl> float * * pcm ; <nl> - float * w1 , * w2 ; <nl> + const float * w1 , * w2 ; <nl> int n1 , n2 , i , ret , hs1 , hs2 ; <nl> <nl> if ( vf1 = = vf2 ) return ( 0 ) ; / * degenerate case * / <nl> static int _ov_64_seek_lap ( OggVorbis_File * vf , ogg_int64_t pos , <nl> vorbis_info * vi ; <nl> float * * lappcm ; <nl> float * * pcm ; <nl> - float * w1 , * w2 ; <nl> + const float * w1 , * w2 ; <nl> int n1 , n2 , ch1 , ch2 , hs ; <nl> int i , ret ; <nl> <nl> static int _ov_d_seek_lap ( OggVorbis_File * vf , double pos , <nl> vorbis_info * vi ; <nl> float * * lappcm ; <nl> float * * pcm ; <nl> - float * w1 , * w2 ; <nl> + const float * w1 , * w2 ; <nl> int n1 , n2 , ch1 , ch2 , hs ; <nl> int i , ret ; <nl> <nl> mmm a / drivers / vorbis / window . c <nl> ppp b / drivers / vorbis / window . c <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : window functions <nl> - last mod : $ Id : window . c 16227 2009 - 07 - 08 06 : 58 : 46Z xiphmont $ <nl> + last mod : $ Id : window . c 19028 2013 - 12 - 02 23 : 23 : 39Z tterribe $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> <nl> # include < math . h > <nl> # include " os . h " <nl> # include " misc . h " <nl> + # include " window . h " <nl> <nl> static const float vwin64 [ 32 ] = { <nl> 0 . 0009460463F , 0 . 0085006468F , 0 . 0235352254F , 0 . 0458950567F , <nl> mmm a / drivers / vorbis / window . h <nl> ppp b / drivers / vorbis / window . h <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * <nl> <nl> function : window functions <nl> - last mod : $ Id : window . h 13293 2007 - 07 - 24 00 : 09 : 47Z xiphmont $ <nl> + last mod : $ Id : window . h 19028 2013 - 12 - 02 23 : 23 : 39Z tterribe $ <nl> <nl> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * / <nl> <nl> # ifndef _V_WINDOW_ <nl> # define _V_WINDOW_ <nl> <nl> - extern float * _vorbis_window_get ( int n ) ; <nl> + extern const float * _vorbis_window_get ( int n ) ; <nl> extern void _vorbis_apply_window ( float * d , int * winno , long * blocksizes , <nl> int lW , int W , int nW ) ; <nl> <nl>
|
Merge pull request from J08nY / external - lib - update
|
godotengine/godot
|
7bdccc19119cec273f46d4d3b1be72f87049749a
|
2016-06-19T16:58:22Z
|
mmm a / tensorflow / core / common_runtime / direct_session . cc <nl> ppp b / tensorflow / core / common_runtime / direct_session . cc <nl> DirectSession : : ~ DirectSession ( ) { <nl> if ( options_ . config . use_per_session_threads ( ) ) { <nl> delete thread_pool_ ; <nl> } <nl> + for ( auto it : cost_models_ ) { <nl> + delete it . second ; <nl> + } <nl> } <nl> <nl> Status DirectSession : : Create ( const GraphDef & graph ) { <nl> Status DirectSession : : Run ( const RunOptions & run_options , <nl> LogMemory : : RecordStep ( args . step_id , run_state_args . handle ) ; <nl> } <nl> <nl> - if ( run_options . trace_level ( ) = = RunOptions : : FULL_TRACE ) { <nl> - args . stats_collector = <nl> - new StepStatsCollector ( run_metadata - > mutable_step_stats ( ) ) ; <nl> + if ( run_options . trace_level ( ) = = RunOptions : : FULL_TRACE | | <nl> + options_ . config . graph_options ( ) . build_cost_model ( ) ) { <nl> + args . stats_collector = new StepStatsCollector ( <nl> + run_metadata - > mutable_step_stats ( ) , & cost_models_ ) ; <nl> + run_state . collector = args . stats_collector ; <nl> } <nl> <nl> for ( const auto & item : executors_and_keys - > items ) { <nl> Status DirectSession : : Run ( const RunOptions & run_options , <nl> ? run_options . timeout_in_ms ( ) <nl> : operation_timeout_in_ms_ ) ; <nl> <nl> - if ( run_options . trace_level ( ) = = RunOptions : : FULL_TRACE ) { <nl> - delete args . stats_collector ; <nl> - } <nl> - <nl> { <nl> mutex_lock l ( run_state . mu_ ) ; <nl> TF_RETURN_IF_ERROR ( run_state . status ) ; <nl> Status DirectSession : : PRunSetup ( const std : : vector < string > & input_names , <nl> LogMemory : : RecordStep ( args . step_id , run_state_args . handle ) ; <nl> } <nl> <nl> + if ( options_ . config . graph_options ( ) . build_cost_model ( ) ) { <nl> + run_state - > collector = new StepStatsCollector ( nullptr , & cost_models_ ) ; <nl> + args . stats_collector = run_state - > collector ; <nl> + } <nl> + <nl> for ( auto & item : executors_and_keys - > items ) { <nl> Executor * exec = item . executor ; <nl> exec - > RunAsync ( args , barrier - > Get ( ) ) ; <nl> : : tensorflow : : Status DirectSession : : Close ( ) { <nl> return : : tensorflow : : Status : : OK ( ) ; <nl> } <nl> <nl> + DirectSession : : RunState : : ~ RunState ( ) { <nl> + if ( rendez ! = nullptr ) { <nl> + if ( ! executors_done . HasBeenNotified ( ) ) { <nl> + rendez - > StartAbort ( errors : : Cancelled ( " PRun cancellation " ) ) ; <nl> + executors_done . WaitForNotification ( ) ; <nl> + } <nl> + rendez - > Unref ( ) ; <nl> + } <nl> + if ( collector ! = nullptr ) { <nl> + delete collector ; <nl> + } <nl> + } <nl> + <nl> void DirectSession : : WaitForNotification ( RunState * run_state , <nl> int64 timeout_in_ms ) { <nl> if ( timeout_in_ms > 0 ) { <nl> mmm a / tensorflow / core / common_runtime / direct_session . h <nl> ppp b / tensorflow / core / common_runtime / direct_session . h <nl> limitations under the License . <nl> <nl> namespace tensorflow { <nl> <nl> + class CostModel ; <nl> class Device ; <nl> class ThreadPool ; <nl> <nl> class DirectSession : public Session { <nl> std : : vector < Tensor > * outputs ) override ; <nl> : : tensorflow : : Status Close ( ) override ; <nl> <nl> + / / NOTE : This is a temporary api that is only meant to enable testing . <nl> + / / This api will be replaced with better ones soon , so DO NOT USE <nl> + const std : : unordered_map < const Graph * , CostModel * > & GetCostModels ( ) const { <nl> + return cost_models_ ; <nl> + } <nl> + <nl> private : <nl> typedef DirectSession ME ; <nl> <nl> class DirectSession : public Session { <nl> mutex mu_ ; <nl> Status status GUARDED_BY ( mu_ ) ; <nl> IntraProcessRendezvous * rendez = nullptr ; <nl> + StepStatsCollector * collector = nullptr ; <nl> Notification executors_done ; <nl> std : : unordered_set < string > pending_inputs ; <nl> std : : unordered_set < string > pending_outputs ; <nl> class DirectSession : public Session { <nl> pending_outputs . emplace ( name ) ; <nl> } <nl> } <nl> - <nl> - ~ RunState ( ) { <nl> - if ( rendez ! = nullptr ) { <nl> - if ( ! executors_done . HasBeenNotified ( ) ) { <nl> - rendez - > StartAbort ( errors : : Cancelled ( " PRun cancellation " ) ) ; <nl> - executors_done . WaitForNotification ( ) ; <nl> - } <nl> - rendez - > Unref ( ) ; <nl> - } <nl> - } <nl> + ~ RunState ( ) ; <nl> } ; <nl> <nl> struct RunStateArgs { <nl> class DirectSession : public Session { <nl> / / Global timeout for all blocking operations in this session . <nl> const int64 operation_timeout_in_ms_ = 0 ; <nl> <nl> + std : : unordered_map < const Graph * , CostModel * > cost_models_ <nl> + GUARDED_BY ( executor_lock_ ) ; <nl> + <nl> TF_DISALLOW_COPY_AND_ASSIGN ( DirectSession ) ; <nl> } ; <nl> <nl> mmm a / tensorflow / core / common_runtime / direct_session_test . cc <nl> ppp b / tensorflow / core / common_runtime / direct_session_test . cc <nl> limitations under the License . <nl> # include < unordered_map > <nl> # include < vector > <nl> <nl> + # include " tensorflow / core / common_runtime / device_factory . h " <nl> # include " tensorflow / core / framework / allocator . h " <nl> # include " tensorflow / core / framework / graph . pb . h " <nl> # include " tensorflow / core / framework / tensor . h " <nl> # include " tensorflow / core / framework / tensor_testutil . h " <nl> # include " tensorflow / core / framework / types . pb . h " <nl> + # include " tensorflow / core / graph / costmodel . h " <nl> # include " tensorflow / core / graph / graph . h " <nl> # include " tensorflow / core / graph / testlib . h " <nl> # include " tensorflow / core / kernels / ops_util . h " <nl> TEST ( DirectSessionTest , TimeoutSession ) { <nl> session - > Close ( ) ; <nl> } <nl> <nl> + TEST ( DirectSessionTest , CostModelTest ) { <nl> + Graph graph ( OpRegistry : : Global ( ) ) ; <nl> + <nl> + Tensor a_tensor ( DT_FLOAT , TensorShape ( { 2 , 2 } ) ) ; <nl> + test : : FillValues < float > ( & a_tensor , { 3 , 2 , - 1 , 0 } ) ; <nl> + Node * a = test : : graph : : Constant ( & graph , a_tensor ) ; <nl> + a - > set_assigned_device_name ( " / job : localhost / replica : 0 / task : 0 / cpu : 0 " ) ; <nl> + <nl> + Tensor x_tensor ( DT_FLOAT , TensorShape ( { 2 , 1 } ) ) ; <nl> + test : : FillValues < float > ( & x_tensor , { 1 , 1 } ) ; <nl> + Node * x = test : : graph : : Constant ( & graph , x_tensor ) ; <nl> + x - > set_assigned_device_name ( " / job : localhost / replica : 0 / task : 0 / cpu : 1 " ) ; <nl> + <nl> + / / y = A * x <nl> + Node * y = test : : graph : : Matmul ( & graph , a , x , false , false ) ; <nl> + y - > set_assigned_device_name ( " / job : localhost / replica : 0 / task : 0 / cpu : 0 " ) ; <nl> + <nl> + Node * y_neg = test : : graph : : Unary ( & graph , " Neg " , y ) ; <nl> + y_neg - > set_assigned_device_name ( " / job : localhost / replica : 0 / task : 0 / cpu : 1 " ) ; <nl> + <nl> + GraphDef def ; <nl> + test : : graph : : ToGraphDef ( & graph , & def ) ; <nl> + <nl> + SessionOptions options ; <nl> + ( * options . config . mutable_device_count ( ) ) [ " CPU " ] = 2 ; <nl> + options . config . mutable_graph_options ( ) - > set_build_cost_model ( true ) ; <nl> + std : : vector < Device * > devices ; <nl> + DeviceFactory : : AddDevices ( options , " / job : localhost / replica : 0 / task : 0 " , <nl> + & devices ) ; <nl> + DirectSession session ( options , new DeviceMgr ( devices ) ) ; <nl> + TF_ASSERT_OK ( session . Create ( def ) ) ; <nl> + std : : vector < std : : pair < string , Tensor > > inputs ; <nl> + <nl> + / / Request two targets : one fetch output and one non - fetched output . <nl> + std : : vector < string > output_names = { y - > name ( ) + " : 0 " } ; <nl> + std : : vector < string > target_nodes = { y_neg - > name ( ) } ; <nl> + std : : vector < Tensor > outputs ; <nl> + Status s = session . Run ( inputs , output_names , target_nodes , & outputs ) ; <nl> + TF_ASSERT_OK ( s ) ; <nl> + <nl> + const std : : unordered_map < const Graph * , CostModel * > & cost_models = <nl> + session . GetCostModels ( ) ; <nl> + / / We should have 2 cost models since we have 2 cpu devices . <nl> + ASSERT_EQ ( 2 , cost_models . size ( ) ) ; <nl> + <nl> + for ( auto it : cost_models ) { <nl> + const Graph * g = ( it ) . first ; <nl> + const CostModel * cm = ( it ) . second ; <nl> + for ( Node * node : g - > nodes ( ) ) { <nl> + if ( node - > name ( ) = = y - > name ( ) ) { <nl> + EXPECT_EQ ( 0 , cm - > MaxSize ( node , 0 ) ) ; <nl> + EXPECT_EQ ( 0 , cm - > Aliases ( node , 0 ) ) ; <nl> + } else if ( node - > name ( ) = = y_neg - > name ( ) ) { <nl> + EXPECT_EQ ( 0 , cm - > MaxSize ( node , 0 ) ) ; <nl> + EXPECT_EQ ( 0 , cm - > Aliases ( node , 0 ) ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + <nl> } / / namespace <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / common_runtime / executor . cc <nl> ppp b / tensorflow / core / common_runtime / executor . cc <nl> bool ExecutorState : : NodeDone ( const Status & s , const Node * node , <nl> std : : deque < TaggedNode > * inline_ready ) { <nl> if ( stats_collector_ ) { <nl> nodestats : : SetAllEnd ( stats ) ; <nl> + stats_collector_ - > UpdateCostModel ( stats , impl_ - > graph_ , node ) ; <nl> if ( ! SetTimelineLabel ( node , stats ) ) { <nl> / / Only record non - transfer nodes . <nl> stats_collector_ - > Save ( impl_ - > params_ . device - > name ( ) , stats ) ; <nl> mmm a / tensorflow / core / common_runtime / step_stats_collector . cc <nl> ppp b / tensorflow / core / common_runtime / step_stats_collector . cc <nl> limitations under the License . <nl> # include " tensorflow / core / common_runtime / step_stats_collector . h " <nl> <nl> # include " tensorflow / core / framework / step_stats . pb . h " <nl> + # include " tensorflow / core / graph / costmodel . h " <nl> # include " tensorflow / core / platform / logging . h " <nl> <nl> namespace tensorflow { <nl> <nl> - StepStatsCollector : : StepStatsCollector ( StepStats * ss ) : step_stats_ ( ss ) { } <nl> + StepStatsCollector : : StepStatsCollector ( <nl> + StepStats * ss , std : : unordered_map < const Graph * , CostModel * > * cm ) <nl> + : step_stats_ ( ss ) , cost_models_ ( cm ) { } <nl> + <nl> + void StepStatsCollector : : UpdateCostModel ( const NodeExecStats * nt , <nl> + const Graph * graph , const Node * node ) { <nl> + mutex_lock l ( mu_ ) ; <nl> + if ( ! cost_models_ ) { <nl> + return ; <nl> + } <nl> + CostModel * cm ; <nl> + auto it = cost_models_ - > find ( graph ) ; <nl> + if ( it = = cost_models_ - > end ( ) ) { <nl> + cm = new CostModel ( false ) ; <nl> + cm - > InitFromGraph ( * graph ) ; <nl> + cost_models_ - > emplace ( graph , cm ) ; <nl> + } else { <nl> + cm = ( * it ) . second ; <nl> + } <nl> + <nl> + for ( int i = 0 ; i < nt - > output_size ( ) ; + + i ) { <nl> + cm - > RecordMaxSize ( node , i , Bytes ( nt - > output ( i ) <nl> + . tensor_description ( ) <nl> + . allocation_description ( ) <nl> + . allocated_bytes ( ) ) ) ; <nl> + cm - > RecordAliases ( node , i , nt - > output ( i ) <nl> + . tensor_description ( ) <nl> + . allocation_description ( ) <nl> + . allocation_id ( ) ) ; <nl> + } <nl> + } <nl> <nl> void StepStatsCollector : : Save ( const string & device , NodeExecStats * nt ) { <nl> VLOG ( 1 ) < < " Save dev " < < device < < " nt " < < nt ; <nl> { <nl> mutex_lock l ( mu_ ) ; <nl> + if ( ! step_stats_ ) { <nl> + delete nt ; <nl> + return ; <nl> + } <nl> DeviceStepStats * dss = nullptr ; <nl> / / Slow linear scan , but it should only be called <nl> / / by a Worker in a context with < ~ 10 devices . <nl> mmm a / tensorflow / core / common_runtime / step_stats_collector . h <nl> ppp b / tensorflow / core / common_runtime / step_stats_collector . h <nl> limitations under the License . <nl> # ifndef TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_STEP_STATS_COLLECTOR_H_ <nl> # define TENSORFLOW_CORE_DISTRIBUTED_RUNTIME_STEP_STATS_COLLECTOR_H_ <nl> <nl> + # include < unordered_map > <nl> # include " tensorflow / core / platform / mutex . h " <nl> # include " tensorflow / core / platform / thread_annotations . h " <nl> # include " tensorflow / core / platform / types . h " <nl> <nl> namespace tensorflow { <nl> <nl> + class CostModel ; <nl> + class Graph ; <nl> + class Node ; <nl> class NodeExecStats ; <nl> class StepStats ; <nl> <nl> class StepStatsCollector { <nl> public : <nl> - explicit StepStatsCollector ( StepStats * ss ) ; <nl> + explicit StepStatsCollector ( <nl> + StepStats * ss , <nl> + std : : unordered_map < const Graph * , CostModel * > * cost_models = nullptr ) ; <nl> <nl> + void UpdateCostModel ( const NodeExecStats * nt , const Graph * graph , <nl> + const Node * node ) ; <nl> void Save ( const string & device , NodeExecStats * nt ) ; <nl> <nl> void Swap ( StepStats * ss ) ; <nl> class StepStatsCollector { <nl> friend class StepStatsMgr ; <nl> mutex mu_ ; <nl> StepStats * step_stats_ GUARDED_BY ( mu_ ) ; <nl> + std : : unordered_map < const Graph * , CostModel * > * cost_models_ GUARDED_BY ( mu_ ) ; <nl> } ; <nl> <nl> } / / namespace tensorflow <nl> mmm a / tensorflow / core / graph / costmodel . cc <nl> ppp b / tensorflow / core / graph / costmodel . cc <nl> void CostModel : : Ensure ( int id ) { <nl> slot_bytes_ . resize ( id + 1 ) ; <nl> count_ . resize ( id + 1 ) ; <nl> time_ . resize ( id + 1 ) ; <nl> + max_mem_usage_ . resize ( id + 1 ) ; <nl> + output_port_alias_ . resize ( id + 1 ) ; <nl> } <nl> } <nl> <nl> void CostModel : : SetNumOutputs ( const Node * node , int num_outputs ) { <nl> if ( id < 0 ) return ; <nl> Ensure ( id ) ; <nl> auto perslot = & slot_bytes_ [ id ] ; <nl> + auto max_mem_usage = & max_mem_usage_ [ id ] ; <nl> + auto output_port_alias = & output_port_alias_ [ id ] ; <nl> if ( perslot - > size ( ) > 0 ) { <nl> CHECK_EQ ( num_outputs , perslot - > size ( ) ) < < " Cannot resize slot_bytes , node = " <nl> < < node - > name ( ) ; <nl> } else { <nl> perslot - > resize ( num_outputs , Bytes ( - 1 ) ) ; <nl> + max_mem_usage - > output_port_mem . resize ( num_outputs , Bytes ( - 1 ) ) ; <nl> + max_mem_usage - > temp_memory_size = Bytes ( - 1 ) ; <nl> + output_port_alias - > resize ( num_outputs , - 1 ) ; <nl> } <nl> } <nl> <nl> void CostModel : : CheckInitialized ( const Graph & graph ) const { <nl> } <nl> } <nl> <nl> + void CostModel : : RecordMaxSize ( const Node * node , int output_slot , Bytes bytes ) { <nl> + const int id = Id ( node ) ; <nl> + if ( id < 0 ) return ; <nl> + Ensure ( id ) ; <nl> + max_mem_usage_ [ id ] . output_port_mem [ output_slot ] = bytes ; <nl> + } <nl> + <nl> + Bytes CostModel : : MaxSize ( const Node * node , int slot ) const { <nl> + const int id = Id ( node ) ; <nl> + if ( id < 0 | | static_cast < size_t > ( id ) > = slot_bytes_ . size ( ) | | <nl> + slot_bytes_ [ id ] . size ( ) < = static_cast < size_t > ( slot ) ) { <nl> + return Bytes ( 0 ) ; <nl> + } <nl> + return max_mem_usage_ [ id ] . output_port_mem [ slot ] ; <nl> + } <nl> + <nl> + void CostModel : : RecordAliases ( const Node * node , int output_slot , <nl> + int64 alias_id ) { <nl> + const int id = Id ( node ) ; <nl> + if ( id < 0 ) return ; <nl> + Ensure ( id ) ; <nl> + output_port_alias_ [ id ] [ output_slot ] = alias_id ; <nl> + } <nl> + <nl> + int64 CostModel : : Aliases ( const Node * node , int slot ) const { <nl> + const int id = Id ( node ) ; <nl> + if ( id < 0 | | static_cast < size_t > ( id ) > = slot_bytes_ . size ( ) | | <nl> + slot_bytes_ [ id ] . size ( ) < = static_cast < size_t > ( slot ) ) { <nl> + return - 1 ; <nl> + } <nl> + return output_port_alias_ [ id ] [ slot ] ; <nl> + } <nl> + <nl> Microseconds CostModel : : CopyTimeEstimate ( Bytes b , double network_latency_millis , <nl> double estimated_gbps ) { <nl> / / TODO ( jeff , sanjay ) : estimate cost based on bandwidth along the <nl> mmm a / tensorflow / core / graph / costmodel . h <nl> ppp b / tensorflow / core / graph / costmodel . h <nl> class CostModel { <nl> / / Check that an estimate is available for every OP node in graph . <nl> void CheckInitialized ( const Graph & graph ) const ; <nl> <nl> + / / Records the maximum size in bytes of the tensor generated by " output_slot " <nl> + / / of " node " . <nl> + void RecordMaxSize ( const Node * node , int output_slot , Bytes bytes ) ; <nl> + <nl> + / / Returns the maximum size in bytes of the tensor generated by " output_slot " <nl> + / / of " node " . <nl> + Bytes MaxSize ( const Node * node , int output_slot ) const ; <nl> + <nl> + / / Record the unique id of the tensor generated by " output_slot " of " node " . <nl> + / / Any other tensor sharing the same id will be an alias , i . e . it will share <nl> + / / the same underlying memory storage area . <nl> + void RecordAliases ( const Node * node , int output_slot , int64 alias_id ) ; <nl> + <nl> + / / Return the unique id of the tensor generated by " output_slot " of " node " . <nl> + int64 Aliases ( const Node * node , int output_slot ) const ; <nl> + <nl> / / Helper routines to encapsulate static estimation heuristics <nl> <nl> / / Compute an estimate of the time to copy " b " bytes over the network , <nl> class CostModel { <nl> / / Cumulative Bytes output on each channel . <nl> std : : vector < gtl : : InlinedVector < Bytes , 2 > > slot_bytes_ ; <nl> <nl> + / / Maximum memory usage <nl> + struct MemUsage { <nl> + Bytes temp_memory_size ; <nl> + gtl : : InlinedVector < Bytes , 2 > output_port_mem ; <nl> + } ; <nl> + std : : vector < MemUsage > max_mem_usage_ ; <nl> + <nl> + std : : vector < gtl : : InlinedVector < int64 , 2 > > output_port_alias_ ; <nl> + <nl> TF_DISALLOW_COPY_AND_ASSIGN ( CostModel ) ; <nl> } ; <nl> <nl> mmm a / tensorflow / core / protobuf / config . proto <nl> ppp b / tensorflow / core / protobuf / config . proto <nl> message GraphOptions { <nl> <nl> / / Options controlling how graph is optimized . <nl> OptimizerOptions optimizer_options = 3 ; <nl> + <nl> + / / Build a cost model detailing the memory usage and performance of <nl> + / / each node of the graph . <nl> + bool build_cost_model = 4 ; <nl> } ; <nl> <nl> / / Session configuration parameters . <nl> mmm a / tensorflow / examples / udacity / README . md <nl> ppp b / tensorflow / examples / udacity / README . md <nl> Building a local Docker container <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> <nl> cd tensorflow / examples / udacity <nl> - docker build - t $ USER / assignments . <nl> + docker build - - pull - t $ USER / assignments . <nl> <nl> Running the local container <nl> mmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> mmm a / tensorflow / python / framework / function_test . py <nl> ppp b / tensorflow / python / framework / function_test . py <nl> def Forward ( x ) : <nl> y = Forward ( x ) <nl> dx , = tf . gradients ( [ y ] , [ x ] ) <nl> <nl> - np . random . seed ( 12345 ) <nl> - inp = np . random . uniform ( - 1 , 1 , [ 2 * 1024 , 1 ] ) . astype ( np . float32 ) <nl> + np . random . seed ( 321 ) <nl> + inp = np . random . uniform ( - 1 , 1 , [ 16 , 1 ] ) . astype ( np . float32 ) <nl> with tf . Session ( graph = g , config = cfg ) as sess : <nl> ans = sess . run ( [ y , dx ] , { x : inp } ) <nl> - self . assertAllClose ( ans [ 0 ] , 1384849 . 5 , rtol = 1e - 3 ) <nl> - self . assertAllClose ( np . sum ( ans [ 1 ] ) , 7127613 . 5 , rtol = 1e - 3 ) <nl> + print ( ans [ 0 ] , np . sum ( ans [ 1 ] ) ) <nl> + self . assertAllClose ( ans [ 0 ] , 255 . 971 , rtol = 1e - 3 ) <nl> + self . assertAllClose ( np . sum ( ans [ 1 ] ) , 13 . 0408 , rtol = 1e - 3 ) <nl> <nl> <nl> if __name__ = = " __main__ " : <nl> mmm a / tensorflow / python / ops / control_flow_ops . py <nl> ppp b / tensorflow / python / ops / control_flow_ops . py <nl> def ZerosLikeOutsideLoop ( op , index ) : <nl> branch = op_ctxt . branch <nl> switch_val = switch ( op . inputs [ 0 ] , pred ) [ 1 - branch ] <nl> zeros_shape = array_ops . shape ( switch_val ) <nl> - return array_ops . zeros ( zeros_shape ) <nl> + return array_ops . zeros ( zeros_shape , dtype = val . dtype ) <nl> <nl> <nl> class ControlFlowContext ( object ) : <nl> mmm a / tensorflow / tools / docker / README . md <nl> ppp b / tensorflow / tools / docker / README . md <nl> Alternately , you can use the ` docker_run_gpu . sh ` script in this directory . <nl> <nl> Just pick the dockerfile corresponding to the container you want to build , and run ; <nl> <nl> - $ docker build - t $ USER / tensorflow - suffix - f Dockerfile . suffix . <nl> + $ docker build - - pull - t $ USER / tensorflow - suffix - f Dockerfile . suffix . <nl>
|
Switch Docker instructions to always ` - - pull ` on build .
|
tensorflow/tensorflow
|
22cfbd1cebda28c3b55c64519f4af23c462b0000
|
2016-03-25T06:43:00Z
|
mmm a / native_client / Makefile <nl> ppp b / native_client / Makefile <nl> run : deepspeech <nl> debug : deepspeech <nl> $ { META_LD_LIBRARY_PATH } = $ { TFDIR } / bazel - bin / tensorflow : $ { TFDIR } / bazel - bin / native_client : $ { $ { META_LD_LIBRARY_PATH } } gdb - - args . / deepspeech $ { ARGS } <nl> <nl> - install : <nl> + install : deepspeech <nl> install - d $ { PREFIX } / lib <nl> install - s - m 0644 $ { TFDIR } / bazel - bin / tensorflow / libtensorflow . so $ { PREFIX } / lib / <nl> install - s - m 0644 $ { TFDIR } / bazel - bin / native_client / libdeepspeech . so $ { PREFIX } / lib / <nl> + install - d $ { PREFIX } / bin <nl> + install - m 0755 deepspeech $ { PREFIX } / bin / <nl> <nl> uninstall : <nl> + rm - f $ { PREFIX } / bin / deepspeech <nl> + rmdir - - ignore - fail - on - non - empty $ { PREFIX } / bin <nl> rm - f $ { PREFIX } / lib / libdeepspeech . so <nl> rm - f $ { PREFIX } / lib / libtensorflow . so <nl> rmdir - - ignore - fail - on - non - empty $ { PREFIX } / lib <nl>
|
Install deepspeech binary as well as libraries
|
mozilla/DeepSpeech
|
57d105f5e9394ffe5eecf47a8863f482594dedcc
|
2017-05-17T11:01:12Z
|
mmm a / OpenCVModule . cmake <nl> ppp b / OpenCVModule . cmake <nl> <nl> macro ( define_opencv_module name ) <nl> <nl> project ( opencv_ $ { name } ) <nl> - if ( OPENCV_BUILD_SHARED_LIB ) <nl> - add_definitions ( - DCVAPI_EXPORTS ) <nl> - endif ( ) <nl> <nl> include_directories ( " $ { CMAKE_CURRENT_SOURCE_DIR } / include " <nl> " $ { CMAKE_CURRENT_SOURCE_DIR } / src " <nl> macro ( define_opencv_module name ) <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> VERSION $ { OPENCV_VERSION } <nl> SOVERSION $ { OPENCV_SOVERSION } <nl> - OUTPUT_NAME " $ { the_target } $ { OPENCV_DLLVERSION } " <nl> - ) <nl> + OUTPUT_NAME " $ { the_target } $ { OPENCV_DLLVERSION } " <nl> + ) <nl> + <nl> + if ( OPENCV_BUILD_SHARED_LIB ) <nl> + # add_definitions ( - DCVAPI_EXPORTS ) <nl> + set_target_properties ( $ { the_target } PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS ) <nl> + endif ( ) <nl> <nl> # Additional target properties <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> mmm a / modules / calib3d / src / calibinit . cpp <nl> ppp b / modules / calib3d / src / calibinit . cpp <nl> void cv : : drawChessboardCorners ( InputOutputArray _image , Size patternSize , <nl> bool cv : : findCirclesGrid ( const InputArray & _image , Size patternSize , <nl> OutputArray _centers , int flags , const Ptr < FeatureDetector > & blobDetector ) <nl> { <nl> - bool isAsymmetricGrid = ( flags & CALIB_CB_ASYMMETRIC_GRID ) ; <nl> - bool isSymmetricGrid = ( flags & CALIB_CB_SYMMETRIC_GRID ) ; <nl> + bool isAsymmetricGrid = ( bool ) ( flags & CALIB_CB_ASYMMETRIC_GRID ) ; <nl> + bool isSymmetricGrid = ( bool ) ( flags & CALIB_CB_SYMMETRIC_GRID ) ; <nl> CV_Assert ( isAsymmetricGrid ^ isSymmetricGrid ) ; <nl> <nl> Mat image = _image . getMat ( ) ; <nl> mmm a / modules / calib3d / src / circlesgrid . cpp <nl> ppp b / modules / calib3d / src / circlesgrid . cpp <nl> void CirclesGridClusterFinder : : hierarchicalClustering ( const vector < Point2f > poin <nl> { <nl> for ( size_t j = i + 1 ; j < points . size ( ) ; j + + ) <nl> { <nl> - dists . at < float > ( i , j ) = norm ( points [ i ] - points [ j ] ) ; <nl> + dists . at < float > ( i , j ) = ( float ) norm ( points [ i ] - points [ j ] ) ; <nl> distsMask . at < uchar > ( i , j ) = 255 ; <nl> / / TODO : use symmetry <nl> distsMask . at < uchar > ( j , i ) = distsMask . at < uchar > ( i , j ) ; <nl> void CirclesGridClusterFinder : : findCorners ( const std : : vector < cv : : Point2f > & hull2 <nl> { <nl> Point2f vec1 = hull2f [ ( i + 1 ) % hull2f . size ( ) ] - hull2f [ i % hull2f . size ( ) ] ; <nl> Point2f vec2 = hull2f [ ( i - 1 + static_cast < int > ( hull2f . size ( ) ) ) % hull2f . size ( ) ] - hull2f [ i % hull2f . size ( ) ] ; <nl> - float angle = vec1 . ddot ( vec2 ) / ( norm ( vec1 ) * norm ( vec2 ) ) ; <nl> + float angle = ( float ) ( vec1 . ddot ( vec2 ) / ( norm ( vec1 ) * norm ( vec2 ) ) ) ; <nl> angles . push_back ( angle ) ; <nl> } <nl> <nl> bool CirclesGridFinder : : isDetectionCorrect ( ) <nl> } <nl> <nl> size_t largeWidth = patternSize . width ; <nl> - size_t largeHeight = ceil ( patternSize . height / 2 . ) ; <nl> + size_t largeHeight = ( size_t ) ceil ( patternSize . height / 2 . ) ; <nl> size_t smallWidth = patternSize . width ; <nl> - size_t smallHeight = floor ( patternSize . height / 2 . ) ; <nl> + size_t smallHeight = ( size_t ) floor ( patternSize . height / 2 . ) ; <nl> <nl> size_t sw = smallWidth , sh = smallHeight , lw = largeWidth , lh = largeHeight ; <nl> if ( largeHoles - > size ( ) ! = largeHeight ) <nl> Mat CirclesGridFinder : : rectifyGrid ( Size detectedGridSize , const vector < Point2f > & <nl> <nl> size_t CirclesGridFinder : : findNearestKeypoint ( Point2f pt ) const <nl> { <nl> - size_t bestIdx = - 1 ; <nl> + size_t bestIdx = 0 ; <nl> double minDist = std : : numeric_limits < double > : : max ( ) ; <nl> for ( size_t i = 0 ; i < keypoints . size ( ) ; i + + ) <nl> { <nl> mmm a / modules / calib3d / src / circlesgrid . hpp <nl> ppp b / modules / calib3d / src / circlesgrid . hpp <nl> <nl> <nl> class CirclesGridClusterFinder <nl> { <nl> + CirclesGridClusterFinder & operator = ( const CirclesGridClusterFinder & ) ; <nl> + CirclesGridClusterFinder ( const CirclesGridClusterFinder & ) ; <nl> public : <nl> CirclesGridClusterFinder ( bool _isAsymmetricGrid ) <nl> { <nl> isAsymmetricGrid = _isAsymmetricGrid ; <nl> squareSize = 1 . 0f ; <nl> - maxRectifiedDistance = squareSize / 2 . 0 ; <nl> + maxRectifiedDistance = ( float ) ( squareSize / 2 . 0 ) ; <nl> } <nl> void findGrid ( const std : : vector < cv : : Point2f > points , cv : : Size patternSize , std : : vector < cv : : Point2f > & centers ) ; <nl> <nl> class CirclesGridFinder <nl> <nl> const cv : : Size_ < size_t > patternSize ; <nl> CirclesGridFinderParameters parameters ; <nl> + <nl> + CirclesGridFinder & operator = ( const CirclesGridFinder & ) ; <nl> + CirclesGridFinder ( const CirclesGridFinder & ) ; <nl> } ; <nl> <nl> # endif / * CIRCLESGRID_HPP_ * / <nl> mmm a / modules / calib3d / src / solvepnp . cpp <nl> ppp b / modules / calib3d / src / solvepnp . cpp <nl> namespace cv <nl> tvec . copyTo ( initTvec ) ; <nl> } <nl> private : <nl> + <nl> + PnPSolver & operator = ( const PnPSolver & ) ; <nl> + PnPSolver ( const PnPSolver & ) ; <nl> + <nl> const Mat & objectPoints ; <nl> const Mat & imagePoints ; <nl> const Parameters & parameters ; <nl> mmm a / modules / contrib / src / chamfermatching . cpp <nl> ppp b / modules / contrib / src / chamfermatching . cpp <nl> ChamferMatcher : : Match * ChamferMatcher : : Matching : : localChamferDistance ( Point offs <nl> } <nl> <nl> if ( cnt_orientation > 0 ) { <nl> - cost = beta * cost + alpha * ( sum_orientation / ( 2 * CV_PI ) ) / cnt_orientation ; <nl> + cost = ( float ) ( beta * cost + alpha * ( sum_orientation / ( 2 * CV_PI ) ) / cnt_orientation ) ; <nl> } <nl> <nl> } <nl> mmm a / modules / core / test / test_math . cpp <nl> ppp b / modules / core / test / test_math . cpp <nl> void Core_SVDTest : : run_func ( ) <nl> } <nl> <nl> <nl> - void Core_SVDTest : : prepare_to_validation ( int test_case_idx ) <nl> + void Core_SVDTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> Mat & input = test_mat [ INPUT ] [ 0 ] ; <nl> int depth = input . depth ( ) ; <nl> mmm a / modules / features2d / src / blobdetector . cpp <nl> ppp b / modules / features2d / src / blobdetector . cpp <nl> void SimpleBlobDetector : : detectImpl ( const cv : : Mat & image , std : : vector < cv : : KeyPoi <nl> normalizer + = centers [ i ] [ j ] . confidence ; <nl> } <nl> sumPoint * = ( 1 . / normalizer ) ; <nl> - KeyPoint kpt ( sumPoint , params . defaultKeypointSize ) ; <nl> + KeyPoint kpt ( sumPoint , ( float ) params . defaultKeypointSize ) ; <nl> keypoints . push_back ( kpt ) ; <nl> } <nl> } <nl> mmm a / modules / flann / include / opencv2 / flann / autotuned_index . h <nl> ppp b / modules / flann / include / opencv2 / flann / autotuned_index . h <nl> class AutotunedIndex : public NNIndex < ELEM_TYPE > <nl> * / <nl> const AutotunedIndexParams & index_params ; <nl> <nl> + AutotunedIndex & operator = ( const AutotunedIndex & ) ; <nl> + AutotunedIndex ( const AutotunedIndex & ) ; <nl> + <nl> public : <nl> <nl> AutotunedIndex ( const Matrix < ELEM_TYPE > & inputData , const AutotunedIndexParams & params = AutotunedIndexParams ( ) ) : <nl> mmm a / modules / flann / include / opencv2 / flann / composite_index . h <nl> ppp b / modules / flann / include / opencv2 / flann / composite_index . h <nl> class CompositeIndex : public NNIndex < ELEM_TYPE > <nl> <nl> const IndexParams & index_params ; <nl> <nl> - <nl> + CompositeIndex & operator = ( const CompositeIndex & ) ; <nl> + CompositeIndex ( const CompositeIndex & ) ; <nl> public : <nl> <nl> CompositeIndex ( const Matrix < ELEM_TYPE > & inputData , const CompositeIndexParams & params = CompositeIndexParams ( ) ) : <nl> mmm a / modules / gpu / CMakeLists . txt <nl> ppp b / modules / gpu / CMakeLists . txt <nl> set ( name " gpu " ) <nl> set ( the_target " opencv_ $ { name } " ) <nl> project ( $ { the_target } ) <nl> <nl> - <nl> set ( DEPS " opencv_core " " opencv_imgproc " " opencv_objdetect " " opencv_features2d " " opencv_flann " " opencv_calib3d " ) # " opencv_features2d " " opencv_flann " " opencv_objdetect " - only headers needed <nl> set ( OPENCV_LINKER_LIBS $ { OPENCV_LINKER_LIBS } opencv_gpu ) <nl> <nl> - add_definitions ( - DCVAPI_EXPORTS ) <nl> - <nl> include_directories ( " $ { CMAKE_CURRENT_SOURCE_DIR } / include " <nl> " $ { CMAKE_CURRENT_SOURCE_DIR } / src / cuda " <nl> " $ { CMAKE_CURRENT_SOURCE_DIR } / src " <nl> if ( HAVE_CUDA ) <nl> string ( REPLACE " / EHsc - " " / EHs " CMAKE_CXX_FLAGS_RELEASE " $ { CMAKE_CXX_FLAGS_RELEASE } " ) <nl> string ( REPLACE " / EHsc - " " / EHs " CMAKE_CXX_FLAGS_DEBUG " $ { CMAKE_CXX_FLAGS_DEBUG } " ) <nl> endif ( ) <nl> + <nl> + if ( OPENCV_BUILD_SHARED_LIB ) <nl> + set ( CUDA_NVCC_FLAGS $ { CUDA_NVCC_FLAGS } " - Xcompiler ; - DCVAPI_EXPORTS " ) <nl> + endif ( ) <nl> <nl> CUDA_COMPILE ( cuda_objs $ { lib_cuda } $ { ncv_cuda } ) <nl> # CUDA_BUILD_CLEAN_TARGET ( ) <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> SOVERSION $ { OPENCV_SOVERSION } <nl> OUTPUT_NAME " $ { the_target } $ { OPENCV_DLLVERSION } " <nl> ) <nl> + <nl> + if ( OPENCV_BUILD_SHARED_LIB ) <nl> + # add_definitions ( - DCVAPI_EXPORTS ) <nl> + set_target_properties ( $ { the_target } PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS ) <nl> + endif ( ) <nl> <nl> # Additional target properties <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> mmm a / modules / gpu / CMakeLists . txt_cuda4 . 0 <nl> ppp b / modules / gpu / CMakeLists . txt_cuda4 . 0 <nl> set ( name " gpu " ) <nl> set ( the_target " opencv_ $ { name } " ) <nl> project ( $ { the_target } ) <nl> <nl> - <nl> set ( DEPS " opencv_core " " opencv_imgproc " " opencv_objdetect " " opencv_features2d " " opencv_flann " " opencv_calib3d " ) # " opencv_features2d " " opencv_flann " " opencv_objdetect " - only headers needed <nl> set ( OPENCV_LINKER_LIBS $ { OPENCV_LINKER_LIBS } opencv_gpu ) <nl> <nl> - add_definitions ( - DCVAPI_EXPORTS ) <nl> - <nl> include_directories ( " $ { CMAKE_CURRENT_SOURCE_DIR } / include " <nl> " $ { CMAKE_CURRENT_SOURCE_DIR } / src / cuda " <nl> " $ { CMAKE_CURRENT_SOURCE_DIR } / src " <nl> if ( HAVE_CUDA ) <nl> string ( REPLACE " / EHsc - " " / EHs " CMAKE_CXX_FLAGS_DEBUG " $ { CMAKE_CXX_FLAGS_DEBUG } " ) <nl> endif ( ) <nl> <nl> + if ( OPENCV_BUILD_SHARED_LIB ) <nl> + set ( CUDA_NVCC_FLAGS $ { CUDA_NVCC_FLAGS } " - Xcompiler ; - DCVAPI_EXPORTS " ) <nl> + endif ( ) <nl> + <nl> CUDA_COMPILE ( cuda_objs $ { lib_cuda } $ { ncv_cuda } ) <nl> # CUDA_BUILD_CLEAN_TARGET ( ) <nl> endif ( ) <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> SOVERSION $ { OPENCV_SOVERSION } <nl> OUTPUT_NAME " $ { the_target } $ { OPENCV_DLLVERSION } " <nl> ) <nl> + <nl> + if ( OPENCV_BUILD_SHARED_LIB ) <nl> + # add_definitions ( - DCVAPI_EXPORTS ) <nl> + set_target_properties ( $ { the_target } PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS ) <nl> + endif ( ) <nl> <nl> # Additional target properties <nl> set_target_properties ( $ { the_target } PROPERTIES <nl> DEBUG_POSTFIX " $ { OPENCV_DEBUG_POSTFIX } " <nl> ARCHIVE_OUTPUT_DIRECTORY " $ { CMAKE_BINARY_DIR } / lib / " <nl> RUNTIME_OUTPUT_DIRECTORY " $ { CMAKE_BINARY_DIR } / bin / " <nl> - INSTALL_NAME_DIR " $ { CMAKE_INSTALL_PREFIX } / lib " <nl> + INSTALL_NAME_DIR " $ { CMAKE_INSTALL_PREFIX } / lib " <nl> ) <nl> <nl> # Add the required libraries for linking : <nl> mmm a / modules / gpu / src / initialization . cpp <nl> ppp b / modules / gpu / src / initialization . cpp <nl> CV_EXPORTS bool cv : : gpu : : TargetArchs : : builtWith ( cv : : gpu : : FeatureSet feature_set ) <nl> # if defined ( HAVE_CUDA ) <nl> return : : compareToSet ( CUDA_ARCH_FEATURES , feature_set , std : : greater_equal < int > ( ) ) ; <nl> # else <nl> + ( void ) feature_set ; <nl> return false ; <nl> # endif <nl> } <nl> CV_EXPORTS bool cv : : gpu : : TargetArchs : : hasPtx ( int major , int minor ) <nl> # if defined ( HAVE_CUDA ) <nl> return : : compareToSet ( CUDA_ARCH_PTX , major * 10 + minor , std : : equal_to < int > ( ) ) ; <nl> # else <nl> + ( void ) major ; <nl> + ( void ) minor ; <nl> return false ; <nl> # endif <nl> } <nl> CV_EXPORTS bool cv : : gpu : : TargetArchs : : hasBin ( int major , int minor ) <nl> # if defined ( HAVE_CUDA ) <nl> return : : compareToSet ( CUDA_ARCH_BIN , major * 10 + minor , std : : equal_to < int > ( ) ) ; <nl> # else <nl> + ( void ) major ; <nl> + ( void ) minor ; <nl> return false ; <nl> # endif <nl> } <nl> CV_EXPORTS bool cv : : gpu : : TargetArchs : : hasEqualOrLessPtx ( int major , int minor ) <nl> return : : compareToSet ( CUDA_ARCH_PTX , major * 10 + minor , <nl> std : : less_equal < int > ( ) ) ; <nl> # else <nl> + ( void ) major ; <nl> + ( void ) minor ; <nl> return false ; <nl> # endif <nl> } <nl> CV_EXPORTS bool cv : : gpu : : TargetArchs : : hasEqualOrGreaterPtx ( int major , int minor ) <nl> return : : compareToSet ( CUDA_ARCH_PTX , major * 10 + minor , <nl> std : : greater_equal < int > ( ) ) ; <nl> # else <nl> + ( void ) major ; <nl> + ( void ) minor ; <nl> return false ; <nl> # endif <nl> } <nl> CV_EXPORTS bool cv : : gpu : : TargetArchs : : hasEqualOrGreaterBin ( int major , int minor ) <nl> return : : compareToSet ( CUDA_ARCH_BIN , major * 10 + minor , <nl> std : : greater_equal < int > ( ) ) ; <nl> # else <nl> + ( void ) major ; <nl> + ( void ) minor ; <nl> return false ; <nl> # endif <nl> } <nl> mmm a / modules / gpu / test / test_arithm . cpp <nl> ppp b / modules / gpu / test / test_arithm . cpp <nl> using namespace gpu ; <nl> class CV_GpuArithmTest : public cvtest : : BaseTest <nl> { <nl> public : <nl> - CV_GpuArithmTest ( const char * test_name , const char * test_funcs ) { } <nl> + CV_GpuArithmTest ( const char * / * test_name * / , const char * / * test_funcs * / ) { } <nl> virtual ~ CV_GpuArithmTest ( ) { } <nl> <nl> protected : <nl> mmm a / modules / gpu / test / test_filters . cpp <nl> ppp b / modules / gpu / test / test_filters . cpp <nl> using namespace gpu ; <nl> class CV_GpuNppFilterTest : public cvtest : : BaseTest <nl> { <nl> public : <nl> - CV_GpuNppFilterTest ( const char * test_name , const char * test_funcs ) { } <nl> + CV_GpuNppFilterTest ( const char * / * test_name * / , const char * / * test_funcs * / ) { } <nl> virtual ~ CV_GpuNppFilterTest ( ) { } <nl> <nl> protected : <nl> mmm a / modules / haartraining / createsamples . cpp <nl> ppp b / modules / haartraining / createsamples . cpp <nl> int main ( int argc , char * argv [ ] ) <nl> int width = 24 ; <nl> int height = 24 ; <nl> <nl> - srand ( time ( 0 ) ) ; <nl> + srand ( ( unsigned int ) time ( 0 ) ) ; <nl> <nl> if ( argc = = 1 ) <nl> { <nl> mmm a / modules / imgproc / test / test_filter . cpp <nl> ppp b / modules / imgproc / test / test_filter . cpp <nl> int CV_MorphologyBaseTest : : prepare_test_case ( int test_case_idx ) <nl> } <nl> <nl> <nl> - void CV_MorphologyBaseTest : : prepare_to_validation ( int test_case_idx ) <nl> + void CV_MorphologyBaseTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> Mat & src = test_mat [ INPUT ] [ 0 ] , & dst = test_mat [ REF_OUTPUT ] [ 0 ] ; <nl> Mat _ielement ( element - > nRows , element - > nCols , CV_32S , element - > values ) ; <nl> void CV_FilterTest : : run_func ( ) <nl> } <nl> <nl> <nl> - void CV_FilterTest : : prepare_to_validation ( int test_case_idx ) <nl> + void CV_FilterTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> cvtest : : filter2D ( test_mat [ INPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] . type ( ) , <nl> test_mat [ INPUT ] [ 1 ] , anchor , 0 , BORDER_REPLICATE ) ; <nl> void CV_SobelTest : : run_func ( ) <nl> } <nl> <nl> <nl> - void CV_SobelTest : : prepare_to_validation ( int test_case_idx ) <nl> + void CV_SobelTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> Mat kernel = cvtest : : calcSobelKernel2D ( dx , dy , _aperture_size , 0 ) ; <nl> cvtest : : filter2D ( test_mat [ INPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] . depth ( ) , <nl> int CV_LaplaceTest : : prepare_test_case ( int test_case_idx ) <nl> } <nl> <nl> <nl> - void CV_LaplaceTest : : prepare_to_validation ( int test_case_idx ) <nl> + void CV_LaplaceTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> Mat kernel = cvtest : : calcLaplaceKernel2D ( _aperture_size ) ; <nl> cvtest : : filter2D ( test_mat [ INPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] . depth ( ) , <nl> int CV_BlurTest : : prepare_test_case ( int test_case_idx ) <nl> } <nl> <nl> <nl> - void CV_BlurTest : : prepare_to_validation ( int test_case_idx ) <nl> + void CV_BlurTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> Mat kernel ( aperture_size , CV_64F ) ; <nl> kernel . setTo ( Scalar : : all ( normalize ? 1 . / ( aperture_size . width * aperture_size . height ) : 1 . ) ) ; <nl> static Mat calcGaussianKernel2D ( Size ksize , double sigma ) <nl> } <nl> <nl> <nl> - void CV_GaussianBlurTest : : prepare_to_validation ( int test_case_idx ) <nl> + void CV_GaussianBlurTest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> Mat kernel = calcGaussianKernel2D ( aperture_size , sigma ) ; <nl> cvtest : : filter2D ( test_mat [ INPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] , test_mat [ REF_OUTPUT ] [ 0 ] . depth ( ) , <nl> mmm a / modules / ml / src / ertrees . cpp <nl> ppp b / modules / ml / src / ertrees . cpp <nl> CvDTreeSplit * CvForestERTree : : find_split_cat_class ( CvDTreeNode * node , int vi , f <nl> <nl> if ( var_class_mask - > data . ptr [ mask_class_idx ] ) <nl> { <nl> - lc [ r ] + = p ; <nl> + lc [ r ] + = ( int ) p ; <nl> L + = p ; <nl> split - > subset [ var_class_idx > > 5 ] | = 1 < < ( var_class_idx & 31 ) ; <nl> } <nl> else <nl> { <nl> - rc [ r ] + = p ; <nl> + rc [ r ] + = ( int ) p ; <nl> R + = p ; <nl> } <nl> } <nl> mmm a / modules / ml / src / svm . cpp <nl> ppp b / modules / ml / src / svm . cpp <nl> struct predict_body_svm { <nl> cvGetRow ( samples , & sample , i ) ; <nl> int r = ( int ) pointer - > predict ( & sample ) ; <nl> if ( results ) <nl> - results - > data . fl [ i ] = r ; <nl> + results - > data . fl [ i ] = ( float ) r ; <nl> if ( i = = 0 ) <nl> - * result = r ; <nl> + * result = ( float ) r ; <nl> } <nl> } <nl> } ; <nl> mmm a / modules / objdetect / src / datamatrix . cpp <nl> ppp b / modules / objdetect / src / datamatrix . cpp <nl> static int decode ( Sampler & sa , code & cc ) <nl> <nl> for ( i = 0 ; i < 64 ; i + + ) <nl> sum + = sa . getpixel ( 1 + ( i & 7 ) , 1 + ( i > > 3 ) ) ; <nl> - uint8 mean = sum / 64 ; <nl> + uint8 mean = ( uint8 ) ( sum / 64 ) ; <nl> for ( i = 0 ; i < 64 ; i + + ) { <nl> b = ( b < < 1 ) + ( sa . getpixel ( pickup [ i ] . x , pickup [ i ] . y ) < = mean ) ; <nl> if ( ( i & 7 ) = = 7 ) { <nl> mmm a / modules / objdetect / src / dotdetector . cpp <nl> ppp b / modules / objdetect / src / dotdetector . cpp <nl> void DOTDetector : : save ( const std : : string & filename ) const <nl> } <nl> } <nl> <nl> - void DOTDetector : : train ( const string & _baseDirName , const TrainParams & _trainParams , bool _isAddImageAndGradientMask ) <nl> + void DOTDetector : : train ( const string & _baseDirName , const TrainParams & _trainParams , bool / * _isAddImageAndGradientMask * / ) <nl> { <nl> clear ( ) ; <nl> <nl> mmm a / modules / objdetect / src / latentsvm . cpp <nl> ppp b / modules / objdetect / src / latentsvm . cpp <nl> int searchObjectThreshold ( const CvLSVMFeaturePyramid * H , <nl> float scoreThreshold , <nl> CvPoint * * points , int * * levels , int * kPoints , <nl> float * * score , CvPoint * * * partsDisplacement , <nl> - int numThreads ) <nl> + int / * numThreads * / ) <nl> { <nl> int opResult ; <nl> <nl> int searchObjectThresholdSomeComponents ( const CvLSVMFeaturePyramid * H , <nl> const float * b , float scoreThreshold , <nl> CvPoint * * points , CvPoint * * oppPoints , <nl> float * * score , int * kPoints , <nl> - int numThreads ) <nl> + int / * numThreads * / ) <nl> { <nl> int error = 0 ; <nl> int i , j , s , f , componentIndex ; <nl> mmm a / modules / ts / include / opencv2 / ts / ts_gtest . h <nl> ppp b / modules / ts / include / opencv2 / ts / ts_gtest . h <nl> inline bool operator ! = ( const GTEST_10_TUPLE_ ( T ) & t , <nl> # ifdef _MSC_VER <nl> <nl> # if GTEST_LINKED_AS_SHARED_LIBRARY <nl> - # define GTEST_API_ __declspec ( dllimport ) <nl> + # define GTEST_API_ <nl> + # define GTEST_API_2 __declspec ( dllimport ) <nl> # elif GTEST_CREATE_SHARED_LIBRARY <nl> # define GTEST_API_ __declspec ( dllexport ) <nl> + # define GTEST_API_2 GTEST_API_ <nl> # endif <nl> <nl> # endif / / _MSC_VER <nl> <nl> # ifndef GTEST_API_ <nl> # define GTEST_API_ <nl> + # define GTEST_API_2 <nl> # endif <nl> <nl> namespace testing { <nl> namespace testing { <nl> namespace internal { <nl> <nl> / / Protects copying of all linked_ptr objects . <nl> - GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_ ( g_linked_ptr_mutex ) ; <nl> + GTEST_API_2 GTEST_DECLARE_STATIC_MUTEX_ ( g_linked_ptr_mutex ) ; <nl> <nl> / / This is used internally by all instances of linked_ptr < > . It needs to be <nl> / / a non - template class because different types of linked_ptr < > can refer to <nl> class GTEST_API_ TestPartResultArray { <nl> } ; <nl> <nl> / / This interface knows how to report a test part result . <nl> - class TestPartResultReporterInterface { <nl> + class GTEST_API_ TestPartResultReporterInterface { <nl> public : <nl> virtual ~ TestPartResultReporterInterface ( ) { } <nl> <nl> mmm a / modules / ts / src / ts_func . cpp <nl> ppp b / modules / ts / src / ts_func . cpp <nl> Mat calcLaplaceKernel2D ( int aperture_size ) <nl> <nl> for ( int i = 0 ; i < ksize ; i + + ) <nl> for ( int j = 0 ; j < ksize ; j + + ) <nl> - kernel . at < float > ( i , j ) = kx [ j ] * ky [ i ] + kx [ i ] * ky [ j ] ; <nl> + kernel . at < float > ( i , j ) = ( float ) ( kx [ j ] * ky [ i ] + kx [ i ] * ky [ j ] ) ; <nl> <nl> return kernel ; <nl> } <nl> mmm a / modules / video / test / test_motiontemplates . cpp <nl> ppp b / modules / video / test / test_motiontemplates . cpp <nl> void CV_UpdateMHITest : : run_func ( ) <nl> <nl> void CV_UpdateMHITest : : prepare_to_validation ( int / * test_case_idx * / ) <nl> { <nl> - CvMat m0 = test_mat [ REF_INPUT_OUTPUT ] [ 0 ] ; <nl> + / / CvMat m0 = test_mat [ REF_INPUT_OUTPUT ] [ 0 ] ; <nl> test_updateMHI ( test_mat [ INPUT ] [ 0 ] , test_mat [ REF_INPUT_OUTPUT ] [ 0 ] , timestamp , duration ) ; <nl> } <nl> <nl>
|
fixed ~ 300 warnings under windows ( had to hack gtest a bit )
|
opencv/opencv
|
1c18e5fef91130dc7595faa7737b751125378285
|
2011-05-06T21:45:48Z
|
mmm a / modules / gdscript / gdscript_analyzer . cpp <nl> ppp b / modules / gdscript / gdscript_analyzer . cpp <nl> void GDScriptAnalyzer : : reduce_call ( GDScriptParser : : CallNode * p_call , bool is_awa <nl> call_type . native_type = function_name ; / / " Object " . <nl> } <nl> <nl> - if ( all_is_constant ) { <nl> + bool safe_to_fold = true ; <nl> + switch ( builtin_type ) { <nl> + / / Those are stored by reference so not suited for compile - time construction . <nl> + / / Because in this case they would be the same reference in all constructed values . <nl> + case Variant : : OBJECT : <nl> + case Variant : : PACKED_BYTE_ARRAY : <nl> + case Variant : : PACKED_INT32_ARRAY : <nl> + case Variant : : PACKED_INT64_ARRAY : <nl> + case Variant : : PACKED_FLOAT32_ARRAY : <nl> + case Variant : : PACKED_FLOAT64_ARRAY : <nl> + case Variant : : PACKED_STRING_ARRAY : <nl> + case Variant : : PACKED_VECTOR2_ARRAY : <nl> + case Variant : : PACKED_VECTOR3_ARRAY : <nl> + case Variant : : PACKED_COLOR_ARRAY : <nl> + safe_to_fold = false ; <nl> + break ; <nl> + default : <nl> + break ; <nl> + } <nl> + <nl> + if ( all_is_constant & & safe_to_fold ) { <nl> / / Construct here . <nl> Vector < const Variant * > args ; <nl> for ( int i = 0 ; i < p_call - > arguments . size ( ) ; i + + ) { <nl>
|
GDScript : Don ' t construct ref values in compiler
|
godotengine/godot
|
a604e72dc974723439e9df5edc67502b82beba4b
|
2020-11-30T12:42:22Z
|
mmm a / src / lookup - inl . h <nl> ppp b / src / lookup - inl . h <nl> <nl> namespace v8 { <nl> namespace internal { <nl> <nl> + LookupIterator : : LookupIterator ( Isolate * isolate , Handle < Object > receiver , <nl> + Handle < Name > name , Configuration configuration ) <nl> + : LookupIterator ( isolate , receiver , name , GetRoot ( isolate , receiver ) , <nl> + configuration ) { } <nl> + <nl> LookupIterator : : LookupIterator ( Handle < Object > receiver , Handle < Name > name , <nl> Handle < JSReceiver > holder , <nl> Configuration configuration ) <nl> LookupIterator : : LookupIterator ( Isolate * isolate , Handle < Object > receiver , <nl> Start < false > ( ) ; <nl> } <nl> <nl> + LookupIterator : : LookupIterator ( Isolate * isolate , Handle < Object > receiver , <nl> + uint32_t index , Configuration configuration ) <nl> + : LookupIterator ( isolate , receiver , index , <nl> + GetRoot ( isolate , receiver , index ) , configuration ) { } <nl> + <nl> LookupIterator LookupIterator : : PropertyOrElement ( <nl> Isolate * isolate , Handle < Object > receiver , Handle < Name > name , <nl> Handle < JSReceiver > holder , Configuration configuration ) { <nl> bool LookupIterator : : is_dictionary_holder ( ) const { <nl> return ! holder_ - > HasFastProperties ( ) ; <nl> } <nl> <nl> + Handle < Map > LookupIterator : : transition_map ( ) const { <nl> + DCHECK_EQ ( TRANSITION , state_ ) ; <nl> + return Handle < Map > : : cast ( transition_ ) ; <nl> + } <nl> + <nl> + Handle < PropertyCell > LookupIterator : : transition_cell ( ) const { <nl> + DCHECK_EQ ( TRANSITION , state_ ) ; <nl> + return Handle < PropertyCell > : : cast ( transition_ ) ; <nl> + } <nl> + <nl> + template < class T > <nl> + Handle < T > LookupIterator : : GetHolder ( ) const { <nl> + DCHECK ( IsFound ( ) ) ; <nl> + return Handle < T > : : cast ( holder_ ) ; <nl> + } <nl> + <nl> bool LookupIterator : : ExtendingNonExtensible ( Handle < JSReceiver > receiver ) { <nl> DCHECK ( receiver . is_identical_to ( GetStoreTarget < JSReceiver > ( ) ) ) ; <nl> return ! receiver - > map ( ) - > is_extensible ( ) & & <nl> void LookupIterator : : UpdateProtector ( ) { <nl> } <nl> } <nl> <nl> + int LookupIterator : : descriptor_number ( ) const { <nl> + DCHECK ( ! IsElement ( ) ) ; <nl> + DCHECK ( has_property_ ) ; <nl> + DCHECK ( holder_ - > HasFastProperties ( ) ) ; <nl> + return number_ ; <nl> + } <nl> + <nl> + int LookupIterator : : dictionary_entry ( ) const { <nl> + DCHECK ( ! IsElement ( ) ) ; <nl> + DCHECK ( has_property_ ) ; <nl> + DCHECK ( ! holder_ - > HasFastProperties ( ) ) ; <nl> + return number_ ; <nl> + } <nl> + <nl> LookupIterator : : Configuration LookupIterator : : ComputeConfiguration ( <nl> Configuration configuration , Handle < Name > name ) { <nl> return name - > IsPrivate ( ) ? OWN_SKIP_INTERCEPTOR : configuration ; <nl> mmm a / src / lookup . h <nl> ppp b / src / lookup . h <nl> class V8_EXPORT_PRIVATE LookupIterator final { <nl> BEFORE_PROPERTY = INTERCEPTOR <nl> } ; <nl> <nl> - LookupIterator ( Isolate * isolate , Handle < Object > receiver , Handle < Name > name , <nl> - Configuration configuration = DEFAULT ) <nl> - : LookupIterator ( isolate , receiver , name , GetRoot ( isolate , receiver ) , <nl> - configuration ) { } <nl> + inline LookupIterator ( Isolate * isolate , Handle < Object > receiver , <nl> + Handle < Name > name , <nl> + Configuration configuration = DEFAULT ) ; <nl> <nl> inline LookupIterator ( Handle < Object > receiver , Handle < Name > name , <nl> Handle < JSReceiver > holder , <nl> class V8_EXPORT_PRIVATE LookupIterator final { <nl> Handle < Name > name , Handle < JSReceiver > holder , <nl> Configuration configuration = DEFAULT ) ; <nl> <nl> - LookupIterator ( Isolate * isolate , Handle < Object > receiver , uint32_t index , <nl> - Configuration configuration = DEFAULT ) <nl> - : LookupIterator ( isolate , receiver , index , <nl> - GetRoot ( isolate , receiver , index ) , configuration ) { } <nl> + inline LookupIterator ( Isolate * isolate , Handle < Object > receiver , <nl> + uint32_t index , Configuration configuration = DEFAULT ) ; <nl> <nl> LookupIterator ( Isolate * isolate , Handle < Object > receiver , uint32_t index , <nl> Handle < JSReceiver > holder , <nl> class V8_EXPORT_PRIVATE LookupIterator final { <nl> template < class T > <nl> inline Handle < T > GetStoreTarget ( ) const ; <nl> inline bool is_dictionary_holder ( ) const ; <nl> - Handle < Map > transition_map ( ) const { <nl> - DCHECK_EQ ( TRANSITION , state_ ) ; <nl> - return Handle < Map > : : cast ( transition_ ) ; <nl> - } <nl> - Handle < PropertyCell > transition_cell ( ) const { <nl> - DCHECK_EQ ( TRANSITION , state_ ) ; <nl> - return Handle < PropertyCell > : : cast ( transition_ ) ; <nl> - } <nl> + inline Handle < Map > transition_map ( ) const ; <nl> + inline Handle < PropertyCell > transition_cell ( ) const ; <nl> template < class T > <nl> - Handle < T > GetHolder ( ) const { <nl> - DCHECK ( IsFound ( ) ) ; <nl> - return Handle < T > : : cast ( holder_ ) ; <nl> - } <nl> + inline Handle < T > GetHolder ( ) const ; <nl> <nl> bool HolderIsReceiver ( ) const ; <nl> bool HolderIsReceiverOrHiddenPrototype ( ) const ; <nl> class V8_EXPORT_PRIVATE LookupIterator final { <nl> bool check_interceptor ( ) const { <nl> return ( configuration_ & kInterceptor ) ! = 0 ; <nl> } <nl> - int descriptor_number ( ) const { <nl> - DCHECK ( ! IsElement ( ) ) ; <nl> - DCHECK ( has_property_ ) ; <nl> - DCHECK ( holder_ - > HasFastProperties ( ) ) ; <nl> - return number_ ; <nl> - } <nl> - int dictionary_entry ( ) const { <nl> - DCHECK ( ! IsElement ( ) ) ; <nl> - DCHECK ( has_property_ ) ; <nl> - DCHECK ( ! holder_ - > HasFastProperties ( ) ) ; <nl> - return number_ ; <nl> - } <nl> + inline int descriptor_number ( ) const ; <nl> + inline int dictionary_entry ( ) const ; <nl> <nl> static inline Configuration ComputeConfiguration ( <nl> Configuration configuration , Handle < Name > name ) ; <nl> mmm a / tools / generate - header - include - checks . py <nl> ppp b / tools / generate - header - include - checks . py <nl> <nl> ' src / compiler / raw - machine - assembler . h ' , <nl> ' src / dateparser - inl . h ' , <nl> ' src / ic / ic . h ' , <nl> - ' src / lookup . h ' , <nl> ' src / regexp / jsregexp . h ' , <nl> ' src / snapshot / object - deserializer . h ' , <nl> ' src / transitions . h ' , <nl>
|
[ iwyu ] Fix lookup . h
|
v8/v8
|
e2662d108855ff58d8f53e13e2237f76729a740b
|
2018-10-29T09:49:25Z
|
mmm a / ports / azure - storage - cpp / CONTROL <nl> ppp b / ports / azure - storage - cpp / CONTROL <nl> <nl> Source : azure - storage - cpp <nl> - Version : 3 . 0 . 0 - 4 <nl> + Version : 3 . 1 . 0 <nl> Build - Depends : cpprestsdk , atlmfc <nl> Description : Microsoft Azure Storage Client SDK for C + + <nl> A client library for working with Microsoft Azure storage services including blobs , files , tables , and queues . This client library enables working with the Microsoft Azure storage services which include the blob service for storing binary and text data , the file service for storing binary and text data , the table service for storing structured non - relational data , and the queue service for storing messages that may be accessed by a client . Microsoft Azure Storage team ' s blog - http : / / blogs . msdn . com / b / windowsazurestorage / <nl> mmm a / ports / azure - storage - cpp / portfile . cmake <nl> ppp b / ports / azure - storage - cpp / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO Azure / azure - storage - cpp <nl> - REF v3 . 0 . 0 <nl> - SHA512 45d0d7f8cc350a16cff0371cdd442e851912c89061acfec559482e8f79cebafffd8681b32a30b878e329235cd3aaad5d2ff797d1148302e3109cf5111df14b97 <nl> + REF v3 . 1 . 0 <nl> + SHA512 ebd6f8aab33046942d641bd42b126dae94c49c08963b96b0141cd6827cb865c95f05f4c7a4df9ce8c62b4ec39092c0538a8c274a0a7219c74656ad111b15bfb8 <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / cpp - redis / CONTROL <nl> ppp b / ports / cpp - redis / CONTROL <nl> <nl> Source : cpp - redis <nl> - Version : 4 . 3 . 0 <nl> + Version : 4 . 3 . 1 <nl> Build - Depends : tacopie <nl> Description : cpp - redis is a C + + 11 Asynchronous Multi - Platform Lightweight Redis Client , with support for synchronous operations and pipelining . <nl> deleted file mode 100644 <nl> index 2839ce56f11 . . 00000000000 <nl> mmm a / ports / cpp - redis / fix - cmakelists . patch <nl> ppp / dev / null <nl> <nl> mmmmmm a / CMakeLists . txt <nl> - ppp b / CMakeLists . txt <nl> - <nl> - cmake_minimum_required ( VERSION 2 . 8 . 7 ) <nl> - set ( CMAKE_MACOSX_RPATH 1 ) <nl> - include ( $ { CMAKE_ROOT } / Modules / ExternalProject . cmake ) <nl> - + include ( $ { CMAKE_ROOT } / Modules / GenerateExportHeader . cmake ) <nl> - <nl> - <nl> - # # # <nl> - if ( USE_CUSTOM_TCP_CLIENT ) <nl> - set_target_properties ( $ { PROJECT } PROPERTIES COMPILE_DEFINITIONS " __CPP_REDIS_USE_CUSTOM_TCP_CLIENT = $ { USE_CUSTOM_TCP_CLIENT } " ) <nl> - endif ( USE_CUSTOM_TCP_CLIENT ) <nl> - <nl> - + generate_export_header ( $ { PROJECT } EXPORT_FILE_NAME $ { CMAKE_BINARY_DIR } / cpp_redis / misc / $ { PROJECT } _export . hpp ) <nl> - + target_include_directories ( $ { PROJECT } PUBLIC $ { CMAKE_BINARY_DIR } ) <nl> - <nl> - # # # <nl> - # install <nl> - install ( DIRECTORY DESTINATION $ { CMAKE_RUNTIME_OUTPUT_DIRECTORY } ) <nl> - install ( DIRECTORY $ { CMAKE_LIBRARY_OUTPUT_DIRECTORY } DESTINATION lib USE_SOURCE_PERMISSIONS ) <nl> - install ( DIRECTORY $ { CMAKE_RUNTIME_OUTPUT_DIRECTORY } DESTINATION bin USE_SOURCE_PERMISSIONS ) <nl> - install ( DIRECTORY $ { CPP_REDIS_INCLUDES } / DESTINATION include USE_SOURCE_PERMISSIONS ) <nl> - + install ( FILES $ { CMAKE_BINARY_DIR } / cpp_redis / misc / $ { PROJECT } _export . hpp DESTINATION include / cpp_redis / misc ) <nl> - <nl> - <nl> - # # # <nl> deleted file mode 100644 <nl> index 1b071c5110e . . 00000000000 <nl> mmm a / ports / cpp - redis / fix - export . patch <nl> ppp / dev / null <nl> <nl> mmmmmm a / includes / cpp_redis / misc / logger . hpp <nl> - ppp b / includes / cpp_redis / misc / logger . hpp <nl> - <nl> - # include < mutex > <nl> - # include < string > <nl> - <nl> - + # include < cpp_redis / misc / cpp_redis_export . hpp > <nl> - + <nl> - namespace cpp_redis { <nl> - <nl> - / / ! <nl> - private : <nl> - / / ! variable containing the current logger <nl> - / / ! by default , not set ( no logs ) <nl> - / / ! <nl> - - extern std : : unique_ptr < logger_iface > active_logger ; <nl> - + extern CPP_REDIS_EXPORT std : : unique_ptr < logger_iface > active_logger ; <nl> - <nl> - / / ! <nl> - / / ! debug logging <nl> mmm a / ports / cpp - redis / portfile . cmake <nl> ppp b / ports / cpp - redis / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO Cylix / cpp_redis <nl> - REF 4 . 3 . 0 <nl> - SHA512 d4a2865b72b4dfa80b6d3c004245014a77e74d4a3d254d6b0a9d50e890a22dc3d9ce54688a8c9185ecee9bbf8cdf76046a9788c70887ccf8a08d5cdcef298b46 <nl> + REF 4 . 3 . 1 <nl> + SHA512 abf372542c53f37f504b3211b840b100d07a8f4b2e7f5584cc7550ab16ed617838e2df79064374c7a409458d8567f4834686318ea3a40249c767e36c744c7a47 <nl> HEAD_REF master <nl> ) <nl> <nl> - vcpkg_apply_patches ( <nl> - SOURCE_PATH $ { SOURCE_PATH } <nl> - PATCHES <nl> - $ { CMAKE_CURRENT_LIST_DIR } / fix - cmakelists . patch <nl> - $ { CMAKE_CURRENT_LIST_DIR } / fix - export . patch <nl> - ) <nl> - <nl> file ( COPY $ { CMAKE_CURRENT_LIST_DIR } / tacopie / CMakeLists . txt DESTINATION $ { SOURCE_PATH } / tacopie ) <nl> <nl> - if ( VCPKG_CRT_LINKAGE STREQUAL dynamic ) <nl> + if ( VCPKG_CRT_LINKAGE STREQUAL " dynamic " ) <nl> set ( MSVC_RUNTIME_LIBRARY_CONFIG " / MD " ) <nl> else ( ) <nl> set ( MSVC_RUNTIME_LIBRARY_CONFIG " / MT " ) <nl> file ( GLOB_RECURSE FILES " $ { CURRENT_PACKAGES_DIR } / include / * " ) <nl> foreach ( file $ { FILES } ) <nl> file ( READ $ { file } _contents ) <nl> string ( REPLACE " ifndef __CPP_REDIS_USE_CUSTOM_TCP_CLIENT " " if 1 " _contents " $ { _contents } " ) <nl> + if ( VCPKG_LIBRARY_LINKAGE STREQUAL " dynamic " ) <nl> + string ( REPLACE <nl> + " extern std : : unique_ptr < logger_iface > active_logger ; " <nl> + " extern __declspec ( dllimport ) std : : unique_ptr < logger_iface > active_logger ; " <nl> + _contents " $ { _contents } " ) <nl> + endif ( ) <nl> file ( WRITE $ { file } " $ { _contents } " ) <nl> endforeach ( ) <nl> <nl> - file ( COPY $ { CURRENT_PACKAGES_DIR } / debug / lib / lib $ { CURRENT_PACKAGES_DIR } / debug / bin / bin DESTINATION $ { CURRENT_PACKAGES_DIR } / debug ) <nl> - file ( COPY $ { CURRENT_PACKAGES_DIR } / lib / lib $ { CURRENT_PACKAGES_DIR } / bin / bin DESTINATION $ { CURRENT_PACKAGES_DIR } ) <nl> - file ( REMOVE_RECURSE $ { CURRENT_PACKAGES_DIR } / debug / lib / lib $ { CURRENT_PACKAGES_DIR } / debug / bin / bin $ { CURRENT_PACKAGES_DIR } / lib / lib $ { CURRENT_PACKAGES_DIR } / bin / bin ) <nl> + file ( GLOB FILES_TO_REMOVE " $ { CURRENT_PACKAGES_DIR } / debug / bin / cpp_redis . ilk " " $ { CURRENT_PACKAGES_DIR } / bin / cpp_redis . dll . manifest " ) <nl> + if ( FILES_TO_REMOVE ) <nl> + file ( REMOVE_RECURSE $ { FILES_TO_REMOVE } ) <nl> + endif ( ) <nl> <nl> file ( INSTALL $ { SOURCE_PATH } / LICENSE DESTINATION $ { CURRENT_PACKAGES_DIR } / share / cpp - redis RENAME copyright ) <nl> <nl> - if ( VCPKG_LIBRARY_LINKAGE STREQUAL static ) <nl> + if ( VCPKG_LIBRARY_LINKAGE STREQUAL " static " ) <nl> file ( REMOVE_RECURSE $ { CURRENT_PACKAGES_DIR } / bin $ { CURRENT_PACKAGES_DIR } / debug / bin ) <nl> endif ( ) <nl> <nl> mmm a / ports / dirent / CONTROL <nl> ppp b / ports / dirent / CONTROL <nl> <nl> Source : dirent <nl> - Version : 2017 - 06 - 23 - 5c7194c2fe2c68c1a8212712c0b4b6195382d27d <nl> + Version : 1 . 23 . 1 <nl> Description : Dirent is a C / C + + programming interface that allows programmers to retrieve information about files and directories under Linux / UNIX . This project provides Linux compatible Dirent interface for Microsoft Windows . <nl> mmm a / ports / dirent / portfile . cmake <nl> ppp b / ports / dirent / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO tronkko / dirent <nl> - REF 8b1db5092479a73d47eafd3de739b27e876e6bf3 <nl> - SHA512 f529aa65c2a4b8249c1291f3bccad25fa3a9c2146a2c74abc0a4710f68e2bd6f73cd52682bb406fbcab71d6a5225a354f9e8bdc22ce63b7a4e64bb65bab34b9f <nl> + REF 1 . 23 . 1 <nl> + SHA512 13c59f0d225ccc09a2b92a29b41b6644dabdb0b39df7bb528d5ac60dbe71a2770eaa37d3890e0df21065bc798e9cc018e174d34c6697da7da665caafe062bbc2 <nl> HEAD_REF master <nl> ) <nl> file ( INSTALL $ { SOURCE_PATH } / include / DESTINATION $ { CURRENT_PACKAGES_DIR } / include ) <nl> mmm a / ports / doctest / CONTROL <nl> ppp b / ports / doctest / CONTROL <nl> <nl> Source : doctest <nl> - Version : 1 . 2 . 6 <nl> + Version : 1 . 2 . 7 <nl> Description : The fastest feature - rich C + + single - header testing framework for unit tests and TDD <nl> mmm a / ports / doctest / portfile . cmake <nl> ppp b / ports / doctest / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO onqtam / doctest <nl> - REF 1 . 2 . 6 <nl> - SHA512 bee59e9e18a474b9a7883e0c506a1133fdd382d3ecbe010c0402399d6c48572508bfa347a2196908d846e345508c564f758b17c268a19b65968f5c2ff87b25a4 <nl> + REF 1 . 2 . 7 <nl> + SHA512 aa6671eb0ac0a7336ad81dea4d696ce61849ab7eb97d6f0f549446b2ac7538a8cdb0a87b8500b3af41cd3f10672ae13591633b368cbcb901f361f7715f22e4e9 <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / gdcm2 / CONTROL <nl> ppp b / ports / gdcm2 / CONTROL <nl> <nl> Source : gdcm2 <nl> - Version : 2 . 8 . 3 <nl> + Version : 2 . 8 . 4 <nl> Description : Grassroots DICOM library <nl> Build - Depends : zlib , expat <nl> mmm a / ports / gdcm2 / portfile . cmake <nl> ppp b / ports / gdcm2 / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO malaterre / GDCM <nl> - REF v2 . 8 . 3 <nl> - SHA512 f8c3d600f067c9b60a32ff5fb7e751c06088e1e4a8e8d0f5e25d9fc7d49e8fab1f0242b10433f522d2043777cddace78c5a9c2cb25bac75a8e84fee554370f62 <nl> + REF v2 . 8 . 4 <nl> + SHA512 d58854507bcc477bcf7944c82014ceac4c603bf8f0e75ddda2371052f4972f1535cb782b47d0822a8929131b804ea5c16b9236b414d70cbf96a494741391c534 <nl> ) <nl> <nl> vcpkg_apply_patches ( <nl> mmm a / ports / grpc / CONTROL <nl> ppp b / ports / grpc / CONTROL <nl> <nl> Source : grpc <nl> - Version : 1 . 8 . 3 <nl> + Version : 1 . 9 . 1 <nl> Build - Depends : zlib , openssl , protobuf , c - ares <nl> Description : An RPC library and framework <nl> mmm a / ports / grpc / portfile . cmake <nl> ppp b / ports / grpc / portfile . cmake <nl> endif ( ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO grpc / grpc <nl> - REF v1 . 8 . 3 <nl> - SHA512 9bf308252221488840fad7669b8f10143c6e2130585b350b31b8d9f362f55cb1d16e5ee79d9d02ce13521e9471a8d55e8fd6c1ae0b710e22e3f918fb9fdc4d40 <nl> + REF v1 . 9 . 1 <nl> + SHA512 2043b76f76680df9759d1eef9d524af2b5f82237cd08428a7aa87cadae516052b37dee470a0850e6d63f685e95f0593900d640f7e4f2fa9de9e8c2b760a82191 <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / llvm / portfile . cmake <nl> ppp b / ports / llvm / portfile . cmake <nl> <nl> + message ( FATAL_ERROR " temporarily disabled " ) <nl> + <nl> # LLVM documentation recommends always using static library linkage when <nl> # building with Microsoft toolchain ; it ' s also the default on other platforms <nl> set ( VCPKG_LIBRARY_LINKAGE static ) <nl> mmm a / ports / matio / CONTROL <nl> ppp b / ports / matio / CONTROL <nl> <nl> Source : matio <nl> - Version : 1 . 5 . 10 - 2 <nl> + Version : 1 . 5 . 11 <nl> Description : MATLAB MAT File I / O Library <nl> Build - Depends : zlib , hdf5 <nl> mmm a / ports / matio / portfile . cmake <nl> ppp b / ports / matio / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO tbeu / matio <nl> - REF v1 . 5 . 10 <nl> - SHA512 c06ff6b3d17a136be20cebca4e1a4bb87eea98e35d979713e73f855487dee568895245528b1b8e55caf02f88aff1b742daf75f590e2d3b08158d0ad73e377243 <nl> + REF v1 . 5 . 11 <nl> + SHA512 f500475e80cdb52a4754c49e900a34c0b540a5c64f353287e6b85b0c16156b251fe8088f2ed584af5a4d0916e98fddf73a3799e7c045ab859298687038e6d513 <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / spdlog / CONTROL <nl> ppp b / ports / spdlog / CONTROL <nl> <nl> Source : spdlog <nl> - Version : 0 . 14 . 0 - 1 <nl> + Version : 0 . 16 . 3 <nl> Description : Very fast , header only , C + + logging library <nl> Build - Depends : fmt <nl> mmm a / ports / spdlog / portfile . cmake <nl> ppp b / ports / spdlog / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO gabime / spdlog <nl> - REF v0 . 14 . 0 <nl> - SHA512 f49b7f26f4fde57fe16f32ab89082f0c590645c627f5b4646f633a16f3eec2926b3465e742bc4899cb802e7b974978c547638205065e9955ed9696fbcaf0b444 <nl> + REF v0 . 16 . 3 <nl> + SHA512 6e08473825cf97dfb10b0e919b77996c1023bbfb583d851e961ec4a95094e4afffd1fc6f6e7e728ce8c2c69c9fb280c59f8d6494b50224bdf8cc68914ffd21e8 <nl> HEAD_REF master <nl> ) <nl> <nl> mmm a / ports / yaml - cpp / CONTROL <nl> ppp b / ports / yaml - cpp / CONTROL <nl> <nl> Source : yaml - cpp <nl> - Version : 0 . 5 . 4 - rc - 2 <nl> + Version : 0 . 6 . 1 <nl> Description : yaml - cpp is a YAML parser and emitter in C + + matching the YAML 1 . 2 spec . <nl> mmm a / ports / yaml - cpp / portfile . cmake <nl> ppp b / ports / yaml - cpp / portfile . cmake <nl> include ( vcpkg_common_functions ) <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO jbeder / yaml - cpp <nl> - REF 380ecb404ef99ba132154ed43dd2b84136b30b14 <nl> - SHA512 30d344d271d15163be755c998b28750857355f26a3fdbaf620932b60e419a7f72884bc7fd65bf3076f4e5315e0f82aab6011406a8146e2c01ba3fc267723d5bc <nl> + REF yaml - cpp - 0 . 6 . 1 <nl> + SHA512 606482d1d38c6747e22604a24c119adb4b70287da7deadb94cc20d70df47122f1714ec9bfc8f566ecf075b94d48771df17430c50039cb984bdf1980f3b445791 <nl> HEAD_REF master <nl> ) <nl> <nl> vcpkg_configure_cmake ( <nl> PREFER_NINJA <nl> OPTIONS <nl> - DYAML_CPP_BUILD_TOOLS = OFF <nl> + - DYAML_CPP_BUILD_TESTS = OFF <nl> ) <nl> <nl> vcpkg_install_cmake ( ) <nl>
|
[ azure - storage - cpp ] [ cpp - redis ] [ dirent ] [ doctest ] [ gdcm2 ] [ grpc ] [ llvm ] [ matio ] [ spdlog ] [ yaml - cpp ] Upgrades
|
microsoft/vcpkg
|
e3dda1a82dccb1c74af615572d6c35df9707275f
|
2018-02-23T11:27:04Z
|
mmm a / templates / cocos2dx_files . json <nl> ppp b / templates / cocos2dx_files . json <nl> <nl> " external / android - specific / tremolo / Tremolo / treminfo . c " , <nl> " external / android - specific / tremolo / Tremolo / vorbisfile . c " , <nl> " external / android - specific / tremolo / Tremolo / window_lookup . h " , <nl> - " external / bullet / Android . mk " , <nl> - " external / bullet / Bullet - C - Api . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btAxisSweep3 . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btAxisSweep3 . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btBroadphaseInterface . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btBroadphaseProxy . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btBroadphaseProxy . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btDbvt . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btDbvt . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btDbvtBroadphase . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btDbvtBroadphase . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btDispatcher . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btDispatcher . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btMultiSapBroadphase . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btMultiSapBroadphase . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btOverlappingPairCache . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btOverlappingPairCache . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btOverlappingPairCallback . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btQuantizedBvh . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btQuantizedBvh . h " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btSimpleBroadphase . cpp " , <nl> - " external / bullet / BulletCollision / BroadphaseCollision / btSimpleBroadphase . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / SphereTriangleDetector . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / SphereTriangleDetector . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btActivatingCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btActivatingCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btBox2dBox2dCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btBox2dBox2dCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btBoxBoxCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btBoxBoxCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btBoxBoxDetector . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btBoxBoxDetector . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionConfiguration . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionCreateFunc . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionDispatcher . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionDispatcher . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionObject . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionObject . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionObjectWrapper . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionWorld . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCollisionWorld . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCompoundCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCompoundCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCompoundCompoundCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btCompoundCompoundCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvex2dConvex2dAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvex2dConvex2dAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvexConcaveCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvexConcaveCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvexConvexAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvexConvexAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvexPlaneCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btConvexPlaneCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btDefaultCollisionConfiguration . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btDefaultCollisionConfiguration . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btEmptyCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btEmptyCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btGhostObject . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btGhostObject . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btHashedSimplePairCache . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btHashedSimplePairCache . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btInternalEdgeUtility . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btInternalEdgeUtility . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btManifoldResult . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btManifoldResult . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSimulationIslandManager . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSimulationIslandManager . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSphereBoxCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSphereBoxCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSphereSphereCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSphereSphereCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSphereTriangleCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btSphereTriangleCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btUnionFind . cpp " , <nl> - " external / bullet / BulletCollision / CollisionDispatch / btUnionFind . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btBox2dShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btBox2dShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btBoxShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btBoxShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btBvhTriangleMeshShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btBvhTriangleMeshShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCapsuleShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCapsuleShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCollisionMargin . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCollisionShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCollisionShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCompoundShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCompoundShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConcaveShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConcaveShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConeShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConeShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvex2dShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvex2dShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexHullShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexHullShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexInternalShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexInternalShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexPointCloudShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexPointCloudShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexPolyhedron . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexPolyhedron . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexTriangleMeshShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btConvexTriangleMeshShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCylinderShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btCylinderShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btEmptyShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btEmptyShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btHeightfieldTerrainShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btHeightfieldTerrainShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMaterial . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMinkowskiSumShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMinkowskiSumShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMultiSphereShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMultiSphereShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMultimaterialTriangleMeshShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btMultimaterialTriangleMeshShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btOptimizedBvh . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btOptimizedBvh . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btPolyhedralConvexShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btPolyhedralConvexShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btScaledBvhTriangleMeshShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btScaledBvhTriangleMeshShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btShapeHull . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btShapeHull . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btSphereShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btSphereShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btStaticPlaneShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btStaticPlaneShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btStridingMeshInterface . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btStridingMeshInterface . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTetrahedronShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTetrahedronShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleBuffer . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleBuffer . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleCallback . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleCallback . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleIndexVertexArray . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleIndexVertexArray . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleIndexVertexMaterialArray . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleIndexVertexMaterialArray . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleInfoMap . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleMesh . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleMesh . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleMeshShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleMeshShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btTriangleShape . h " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btUniformScalingShape . cpp " , <nl> - " external / bullet / BulletCollision / CollisionShapes / btUniformScalingShape . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btBoxCollision . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btClipPolygon . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btCompoundFromGimpact . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btContactProcessing . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btContactProcessing . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactBvh . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactBvh . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactCollisionAlgorithm . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactMassUtil . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactQuantizedBvh . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactQuantizedBvh . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactShape . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btGImpactShape . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGenericPoolAllocator . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btGenericPoolAllocator . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btGeometryOperations . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btQuantization . h " , <nl> - " external / bullet / BulletCollision / Gimpact / btTriangleShapeEx . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / btTriangleShapeEx . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_array . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_basic_geometry_operations . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_bitset . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_box_collision . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_box_set . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_box_set . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_clip_polygon . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_contact . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_contact . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_geom_types . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_geometry . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_hash_table . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_linear_math . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_math . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_memory . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_memory . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_radixsort . h " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_tri_collision . cpp " , <nl> - " external / bullet / BulletCollision / Gimpact / gim_tri_collision . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btContinuousConvexCollision . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btContinuousConvexCollision . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btConvexCast . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btConvexCast . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btConvexPenetrationDepthSolver . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btDiscreteCollisionDetectorInterface . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkConvexCast . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkConvexCast . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkEpa2 . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkEpa2 . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkEpaPenetrationDepthSolver . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkEpaPenetrationDepthSolver . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkPairDetector . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btGjkPairDetector . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btManifoldPoint . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btMinkowskiPenetrationDepthSolver . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btMinkowskiPenetrationDepthSolver . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btPersistentManifold . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btPersistentManifold . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btPointCollector . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btPolyhedralContactClipping . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btPolyhedralContactClipping . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btRaycastCallback . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btRaycastCallback . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btSimplexSolverInterface . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btSubSimplexConvexCast . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btSubSimplexConvexCast . h " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btVoronoiSimplexSolver . cpp " , <nl> - " external / bullet / BulletCollision / NarrowPhaseCollision / btVoronoiSimplexSolver . h " , <nl> - " external / bullet / BulletDynamics / Character / btCharacterControllerInterface . h " , <nl> - " external / bullet / BulletDynamics / Character / btKinematicCharacterController . cpp " , <nl> - " external / bullet / BulletDynamics / Character / btKinematicCharacterController . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btConeTwistConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btConeTwistConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btConstraintSolver . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btContactConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btContactConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btContactSolverInfo . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btFixedConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btFixedConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btGearConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btGearConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btGeneric6DofConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btGeneric6DofConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btGeneric6DofSpringConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btGeneric6DofSpringConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btHinge2Constraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btHinge2Constraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btHingeConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btHingeConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btJacobianEntry . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btPoint2PointConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btPoint2PointConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSequentialImpulseConstraintSolver . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSequentialImpulseConstraintSolver . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSliderConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSliderConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSolve2LinearConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSolve2LinearConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSolverBody . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btSolverConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btTypedConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btTypedConstraint . h " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btUniversalConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / ConstraintSolver / btUniversalConstraint . h " , <nl> - " external / bullet / BulletDynamics / Dynamics / Bullet - C - API . cpp " , <nl> - " external / bullet / BulletDynamics / Dynamics / btActionInterface . h " , <nl> - " external / bullet / BulletDynamics / Dynamics / btDiscreteDynamicsWorld . cpp " , <nl> - " external / bullet / BulletDynamics / Dynamics / btDiscreteDynamicsWorld . h " , <nl> - " external / bullet / BulletDynamics / Dynamics / btDynamicsWorld . h " , <nl> - " external / bullet / BulletDynamics / Dynamics / btRigidBody . cpp " , <nl> - " external / bullet / BulletDynamics / Dynamics / btRigidBody . h " , <nl> - " external / bullet / BulletDynamics / Dynamics / btSimpleDynamicsWorld . cpp " , <nl> - " external / bullet / BulletDynamics / Dynamics / btSimpleDynamicsWorld . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBody . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBody . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyConstraint . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyConstraintSolver . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyConstraintSolver . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyDynamicsWorld . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyDynamicsWorld . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyJointLimitConstraint . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyJointLimitConstraint . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyJointMotor . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyJointMotor . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyLink . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyLinkCollider . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyPoint2Point . cpp " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodyPoint2Point . h " , <nl> - " external / bullet / BulletDynamics / Featherstone / btMultiBodySolverConstraint . h " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btDantzigLCP . cpp " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btDantzigLCP . h " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btDantzigSolver . h " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btMLCPSolver . cpp " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btMLCPSolver . h " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btMLCPSolverInterface . h " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btPATHSolver . h " , <nl> - " external / bullet / BulletDynamics / MLCPSolvers / btSolveProjectedGaussSeidel . h " , <nl> - " external / bullet / BulletDynamics / Vehicle / btRaycastVehicle . cpp " , <nl> - " external / bullet / BulletDynamics / Vehicle / btRaycastVehicle . h " , <nl> - " external / bullet / BulletDynamics / Vehicle / btVehicleRaycaster . h " , <nl> - " external / bullet / BulletDynamics / Vehicle / btWheelInfo . cpp " , <nl> - " external / bullet / BulletDynamics / Vehicle / btWheelInfo . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / ApplyForces . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / ComputeBounds . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / Integrate . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / OutputToVertexArray . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / PrepareLinks . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / SolvePositions . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / SolvePositionsSIMDBatched . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / UpdateConstants . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / UpdateNodes . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / UpdateNormals . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / UpdatePositions . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / UpdatePositionsFromVelocities . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / VSolveLinks . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / solveCollisionsAndUpdateVelocities . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / HLSL / solveCollisionsAndUpdateVelocitiesSIMDBatched . hlsl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverBuffer_DX11 . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverLinkData_DX11 . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverLinkData_DX11SIMDAware . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverTriangleData_DX11 . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverVertexBuffer_DX11 . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverVertexData_DX11 . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolver_DX11 . cpp " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolver_DX11 . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolver_DX11SIMDAware . cpp " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolver_DX11SIMDAware . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / MiniCL / MiniCLTaskWrap . cpp " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / ApplyForces . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / ComputeBounds . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / Integrate . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / OutputToVertexArray . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / PrepareLinks . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / SolveCollisionsAndUpdateVelocities . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / SolveCollisionsAndUpdateVelocitiesSIMDBatched . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / SolvePositions . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / SolvePositionsSIMDBatched . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdateConstants . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdateFixedVertexPositions . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdateNodes . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdateNormals . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdatePositions . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdatePositionsFromVelocities . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / VSolveLinks . cl " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverBuffer_OpenCL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverLinkData_OpenCL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverLinkData_OpenCLSIMDAware . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverOutputCLtoGL . cpp " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverOutputCLtoGL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverTriangleData_OpenCL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverVertexBuffer_OpenGL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverVertexData_OpenCL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolver_OpenCL . cpp " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolver_OpenCL . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolver_OpenCLSIMDAware . cpp " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolver_OpenCLSIMDAware . h " , <nl> - " external / bullet / BulletMultiThreaded / GpuSoftBodySolvers / Shared / btSoftBodySolverData . h " , <nl> - " external / bullet / BulletMultiThreaded / HeapManager . h " , <nl> - " external / bullet / BulletMultiThreaded / PlatformDefinitions . h " , <nl> - " external / bullet / BulletMultiThreaded / PosixThreadSupport . cpp " , <nl> - " external / bullet / BulletMultiThreaded / PosixThreadSupport . h " , <nl> - " external / bullet / BulletMultiThreaded / PpuAddressSpace . h " , <nl> - " external / bullet / BulletMultiThreaded / SequentialThreadSupport . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SequentialThreadSupport . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuCollisionObjectWrapper . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuCollisionObjectWrapper . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuCollisionTaskProcess . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuCollisionTaskProcess . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuContactManifoldCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuContactManifoldCollisionAlgorithm . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuDoubleBuffer . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuFakeDma . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuFakeDma . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuGatheringCollisionDispatcher . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuGatheringCollisionDispatcher . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuLibspe2Support . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuLibspe2Support . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / Box . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuCollisionShapes . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuCollisionShapes . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuContactResult . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuContactResult . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuConvexPenetrationDepthSolver . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuGatheringCollisionTask . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuGatheringCollisionTask . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuLocalSupport . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuMinkowskiPenetrationDepthSolver . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuMinkowskiPenetrationDepthSolver . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuPreferredPenetrationDirections . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / boxBoxDistance . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / boxBoxDistance . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuSampleTask / SpuSampleTask . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuSampleTask / SpuSampleTask . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuSampleTaskProcess . cpp " , <nl> - " external / bullet / BulletMultiThreaded / SpuSampleTaskProcess . h " , <nl> - " external / bullet / BulletMultiThreaded / SpuSync . h " , <nl> - " external / bullet / BulletMultiThreaded / TrbDynBody . h " , <nl> - " external / bullet / BulletMultiThreaded / TrbStateVec . h " , <nl> - " external / bullet / BulletMultiThreaded / Win32ThreadSupport . cpp " , <nl> - " external / bullet / BulletMultiThreaded / Win32ThreadSupport . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpu3DGridBroadphase . cpp " , <nl> - " external / bullet / BulletMultiThreaded / btGpu3DGridBroadphase . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpu3DGridBroadphaseSharedCode . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpu3DGridBroadphaseSharedDefs . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpu3DGridBroadphaseSharedTypes . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpuDefines . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpuUtilsSharedCode . h " , <nl> - " external / bullet / BulletMultiThreaded / btGpuUtilsSharedDefs . h " , <nl> - " external / bullet / BulletMultiThreaded / btParallelConstraintSolver . cpp " , <nl> - " external / bullet / BulletMultiThreaded / btParallelConstraintSolver . h " , <nl> - " external / bullet / BulletMultiThreaded / btThreadSupportInterface . cpp " , <nl> - " external / bullet / BulletMultiThreaded / btThreadSupportInterface . h " , <nl> - " external / bullet / BulletMultiThreaded / vectormath2bullet . h " , <nl> - " external / bullet / BulletSoftBody / btDefaultSoftBodySolver . cpp " , <nl> - " external / bullet / BulletSoftBody / btDefaultSoftBodySolver . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBody . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftBody . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyConcaveCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyConcaveCollisionAlgorithm . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyData . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyHelpers . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyHelpers . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyInternals . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyRigidBodyCollisionConfiguration . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftBodyRigidBodyCollisionConfiguration . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodySolverVertexBuffer . h " , <nl> - " external / bullet / BulletSoftBody / btSoftBodySolvers . h " , <nl> - " external / bullet / BulletSoftBody / btSoftRigidCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftRigidCollisionAlgorithm . h " , <nl> - " external / bullet / BulletSoftBody / btSoftRigidDynamicsWorld . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftRigidDynamicsWorld . h " , <nl> - " external / bullet / BulletSoftBody / btSoftSoftCollisionAlgorithm . cpp " , <nl> - " external / bullet / BulletSoftBody / btSoftSoftCollisionAlgorithm . h " , <nl> - " external / bullet / BulletSoftBody / btSparseSDF . h " , <nl> - " external / bullet / CMakeLists . txt " , <nl> - " external / bullet / LinearMath / btAabbUtil2 . h " , <nl> - " external / bullet / LinearMath / btAlignedAllocator . cpp " , <nl> - " external / bullet / LinearMath / btAlignedAllocator . h " , <nl> - " external / bullet / LinearMath / btAlignedObjectArray . h " , <nl> - " external / bullet / LinearMath / btConvexHull . cpp " , <nl> - " external / bullet / LinearMath / btConvexHull . h " , <nl> - " external / bullet / LinearMath / btConvexHullComputer . cpp " , <nl> - " external / bullet / LinearMath / btConvexHullComputer . h " , <nl> - " external / bullet / LinearMath / btDefaultMotionState . h " , <nl> - " external / bullet / LinearMath / btGeometryUtil . cpp " , <nl> - " external / bullet / LinearMath / btGeometryUtil . h " , <nl> - " external / bullet / LinearMath / btGrahamScan2dConvexHull . h " , <nl> - " external / bullet / LinearMath / btHashMap . h " , <nl> - " external / bullet / LinearMath / btIDebugDraw . h " , <nl> - " external / bullet / LinearMath / btList . h " , <nl> - " external / bullet / LinearMath / btMatrix3x3 . h " , <nl> - " external / bullet / LinearMath / btMatrixX . h " , <nl> - " external / bullet / LinearMath / btMinMax . h " , <nl> - " external / bullet / LinearMath / btMotionState . h " , <nl> - " external / bullet / LinearMath / btPolarDecomposition . cpp " , <nl> - " external / bullet / LinearMath / btPolarDecomposition . h " , <nl> - " external / bullet / LinearMath / btPoolAllocator . h " , <nl> - " external / bullet / LinearMath / btQuadWord . h " , <nl> - " external / bullet / LinearMath / btQuaternion . h " , <nl> - " external / bullet / LinearMath / btQuickprof . cpp " , <nl> - " external / bullet / LinearMath / btQuickprof . h " , <nl> - " external / bullet / LinearMath / btRandom . h " , <nl> - " external / bullet / LinearMath / btScalar . h " , <nl> - " external / bullet / LinearMath / btSerializer . cpp " , <nl> - " external / bullet / LinearMath / btSerializer . h " , <nl> - " external / bullet / LinearMath / btStackAlloc . h " , <nl> - " external / bullet / LinearMath / btTransform . h " , <nl> - " external / bullet / LinearMath / btTransformUtil . h " , <nl> - " external / bullet / LinearMath / btVector3 . cpp " , <nl> - " external / bullet / LinearMath / btVector3 . h " , <nl> - " external / bullet / MiniCL / MiniCL . cpp " , <nl> - " external / bullet / MiniCL / MiniCLTask / MiniCLTask . cpp " , <nl> - " external / bullet / MiniCL / MiniCLTask / MiniCLTask . h " , <nl> - " external / bullet / MiniCL / MiniCLTaskScheduler . cpp " , <nl> - " external / bullet / MiniCL / MiniCLTaskScheduler . h " , <nl> - " external / bullet / MiniCL / cl . h " , <nl> - " external / bullet / MiniCL / cl_MiniCL_Defs . h " , <nl> - " external / bullet / MiniCL / cl_gl . h " , <nl> - " external / bullet / MiniCL / cl_platform . h " , <nl> - " external / bullet / btBulletCollisionCommon . h " , <nl> - " external / bullet / btBulletDynamicsCommon . h " , <nl> - " external / bullet / proj . win10 / libbullet . vcxproj " , <nl> - " external / bullet / proj . win10 / libbullet . vcxproj . filters " , <nl> - " external / bullet / proj . win32 / libbullet . vcxproj " , <nl> - " external / bullet / proj . win32 / libbullet . vcxproj . filters " , <nl> - " external / bullet / vectormath / neon / boolInVec . h " , <nl> - " external / bullet / vectormath / neon / floatInVec . h " , <nl> - " external / bullet / vectormath / neon / mat_aos . h " , <nl> - " external / bullet / vectormath / neon / quat_aos . h " , <nl> - " external / bullet / vectormath / neon / vec_aos . h " , <nl> - " external / bullet / vectormath / neon / vectormath_aos . h " , <nl> - " external / bullet / vectormath / scalar / boolInVec . h " , <nl> - " external / bullet / vectormath / scalar / floatInVec . h " , <nl> - " external / bullet / vectormath / scalar / mat_aos . h " , <nl> - " external / bullet / vectormath / scalar / quat_aos . h " , <nl> - " external / bullet / vectormath / scalar / vec_aos . h " , <nl> - " external / bullet / vectormath / scalar / vectormath_aos . h " , <nl> - " external / bullet / vectormath / sse / boolInVec . h " , <nl> - " external / bullet / vectormath / sse / floatInVec . h " , <nl> - " external / bullet / vectormath / sse / mat_aos . h " , <nl> - " external / bullet / vectormath / sse / quat_aos . h " , <nl> - " external / bullet / vectormath / sse / vec_aos . h " , <nl> - " external / bullet / vectormath / sse / vecidx_aos . h " , <nl> - " external / bullet / vectormath / sse / vectormath_aos . h " , <nl> - " external / bullet / vectormath / vmInclude . h " , <nl> + " external / bullet / include / bullet / Bullet - C - Api . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btAxisSweep3 . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btBroadphaseInterface . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btBroadphaseProxy . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btDbvt . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btDbvtBroadphase . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btDispatcher . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btMultiSapBroadphase . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btOverlappingPairCache . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btOverlappingPairCallback . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btQuantizedBvh . h " , <nl> + " external / bullet / include / bullet / BulletCollision / BroadphaseCollision / btSimpleBroadphase . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / SphereTriangleDetector . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btActivatingCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btBox2dBox2dCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btBoxBoxCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btBoxBoxDetector . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCollisionConfiguration . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCollisionCreateFunc . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCollisionDispatcher . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCollisionObject . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCollisionObjectWrapper . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCollisionWorld . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCompoundCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btCompoundCompoundCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btConvex2dConvex2dAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btConvexConcaveCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btConvexConvexAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btConvexPlaneCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btDefaultCollisionConfiguration . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btEmptyCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btGhostObject . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btHashedSimplePairCache . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btInternalEdgeUtility . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btManifoldResult . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btSimulationIslandManager . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btSphereBoxCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btSphereSphereCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btSphereTriangleCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionDispatch / btUnionFind . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btBox2dShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btBoxShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btBvhTriangleMeshShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btCapsuleShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btCollisionMargin . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btCollisionShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btCompoundShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConcaveShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConeShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvex2dShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvexHullShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvexInternalShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvexPointCloudShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvexPolyhedron . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvexShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btConvexTriangleMeshShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btCylinderShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btEmptyShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btHeightfieldTerrainShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btMaterial . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btMinkowskiSumShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btMultiSphereShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btMultimaterialTriangleMeshShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btOptimizedBvh . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btPolyhedralConvexShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btScaledBvhTriangleMeshShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btShapeHull . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btSphereShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btStaticPlaneShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btStridingMeshInterface . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTetrahedronShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleBuffer . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleCallback . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleIndexVertexArray . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleIndexVertexMaterialArray . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleInfoMap . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleMesh . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleMeshShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btTriangleShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / CollisionShapes / btUniformScalingShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btBoxCollision . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btClipPolygon . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btCompoundFromGimpact . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btContactProcessing . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGImpactBvh . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGImpactCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGImpactMassUtil . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGImpactQuantizedBvh . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGImpactShape . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGenericPoolAllocator . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btGeometryOperations . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btQuantization . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / btTriangleShapeEx . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_array . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_basic_geometry_operations . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_bitset . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_box_collision . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_box_set . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_clip_polygon . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_contact . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_geom_types . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_geometry . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_hash_table . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_linear_math . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_math . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_memory . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_radixsort . h " , <nl> + " external / bullet / include / bullet / BulletCollision / Gimpact / gim_tri_collision . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btContinuousConvexCollision . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btConvexCast . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btConvexPenetrationDepthSolver . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btDiscreteCollisionDetectorInterface . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btGjkConvexCast . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btGjkEpa2 . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btGjkEpaPenetrationDepthSolver . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btGjkPairDetector . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btManifoldPoint . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btMinkowskiPenetrationDepthSolver . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btPersistentManifold . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btPointCollector . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btPolyhedralContactClipping . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btRaycastCallback . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btSimplexSolverInterface . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btSubSimplexConvexCast . h " , <nl> + " external / bullet / include / bullet / BulletCollision / NarrowPhaseCollision / btVoronoiSimplexSolver . h " , <nl> + " external / bullet / include / bullet / BulletCollision / btBulletCollisionCommon . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Character / btCharacterControllerInterface . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Character / btKinematicCharacterController . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btConeTwistConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btConstraintSolver . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btContactConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btContactSolverInfo . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btFixedConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btGearConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btGeneric6DofConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btGeneric6DofSpringConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btHinge2Constraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btHingeConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btJacobianEntry . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btPoint2PointConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btSequentialImpulseConstraintSolver . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btSliderConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btSolve2LinearConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btSolverBody . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btSolverConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btTypedConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / ConstraintSolver / btUniversalConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Dynamics / btActionInterface . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Dynamics / btDiscreteDynamicsWorld . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Dynamics / btDynamicsWorld . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Dynamics / btRigidBody . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Dynamics / btSimpleDynamicsWorld . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBody . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyConstraintSolver . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyDynamicsWorld . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyJointLimitConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyJointMotor . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyLink . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyLinkCollider . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodyPoint2Point . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Featherstone / btMultiBodySolverConstraint . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / MLCPSolvers / btDantzigLCP . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / MLCPSolvers / btDantzigSolver . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / MLCPSolvers / btMLCPSolver . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / MLCPSolvers / btMLCPSolverInterface . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / MLCPSolvers / btPATHSolver . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / MLCPSolvers / btSolveProjectedGaussSeidel . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Vehicle / btRaycastVehicle . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Vehicle / btVehicleRaycaster . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / Vehicle / btWheelInfo . h " , <nl> + " external / bullet / include / bullet / BulletDynamics / btBulletDynamicsCommon . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverBuffer_DX11 . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverLinkData_DX11 . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverLinkData_DX11SIMDAware . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverTriangleData_DX11 . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverVertexBuffer_DX11 . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolverVertexData_DX11 . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolver_DX11 . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / DX11 / btSoftBodySolver_DX11SIMDAware . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverBuffer_OpenCL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverLinkData_OpenCL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverLinkData_OpenCLSIMDAware . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverOutputCLtoGL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverTriangleData_OpenCL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverVertexBuffer_OpenGL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolverVertexData_OpenCL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolver_OpenCL . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / btSoftBodySolver_OpenCLSIMDAware . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / GpuSoftBodySolvers / Shared / btSoftBodySolverData . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / HeapManager . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / PlatformDefinitions . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / PosixThreadSupport . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / PpuAddressSpace . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SequentialThreadSupport . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuCollisionObjectWrapper . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuCollisionTaskProcess . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuContactManifoldCollisionAlgorithm . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuDoubleBuffer . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuFakeDma . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuGatheringCollisionDispatcher . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuLibspe2Support . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / Box . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuCollisionShapes . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuContactResult . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuConvexPenetrationDepthSolver . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuGatheringCollisionTask . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuLocalSupport . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuMinkowskiPenetrationDepthSolver . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / SpuPreferredPenetrationDirections . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuNarrowPhaseCollisionTask / boxBoxDistance . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuSampleTask / SpuSampleTask . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuSampleTaskProcess . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / SpuSync . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / TrbDynBody . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / TrbStateVec . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / Win32ThreadSupport . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpu3DGridBroadphase . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpu3DGridBroadphaseSharedCode . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpu3DGridBroadphaseSharedDefs . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpu3DGridBroadphaseSharedTypes . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpuDefines . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpuUtilsSharedCode . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btGpuUtilsSharedDefs . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btParallelConstraintSolver . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / btThreadSupportInterface . h " , <nl> + " external / bullet / include / bullet / BulletMultiThreaded / vectormath2bullet . h " , <nl> + " external / bullet / include / bullet / LinearMath / btAabbUtil2 . h " , <nl> + " external / bullet / include / bullet / LinearMath / btAlignedAllocator . h " , <nl> + " external / bullet / include / bullet / LinearMath / btAlignedObjectArray . h " , <nl> + " external / bullet / include / bullet / LinearMath / btConvexHull . h " , <nl> + " external / bullet / include / bullet / LinearMath / btConvexHullComputer . h " , <nl> + " external / bullet / include / bullet / LinearMath / btDefaultMotionState . h " , <nl> + " external / bullet / include / bullet / LinearMath / btGeometryUtil . h " , <nl> + " external / bullet / include / bullet / LinearMath / btGrahamScan2dConvexHull . h " , <nl> + " external / bullet / include / bullet / LinearMath / btHashMap . h " , <nl> + " external / bullet / include / bullet / LinearMath / btIDebugDraw . h " , <nl> + " external / bullet / include / bullet / LinearMath / btList . h " , <nl> + " external / bullet / include / bullet / LinearMath / btMatrix3x3 . h " , <nl> + " external / bullet / include / bullet / LinearMath / btMatrixX . h " , <nl> + " external / bullet / include / bullet / LinearMath / btMinMax . h " , <nl> + " external / bullet / include / bullet / LinearMath / btMotionState . h " , <nl> + " external / bullet / include / bullet / LinearMath / btPolarDecomposition . h " , <nl> + " external / bullet / include / bullet / LinearMath / btPoolAllocator . h " , <nl> + " external / bullet / include / bullet / LinearMath / btQuadWord . h " , <nl> + " external / bullet / include / bullet / LinearMath / btQuaternion . h " , <nl> + " external / bullet / include / bullet / LinearMath / btQuickprof . h " , <nl> + " external / bullet / include / bullet / LinearMath / btRandom . h " , <nl> + " external / bullet / include / bullet / LinearMath / btScalar . h " , <nl> + " external / bullet / include / bullet / LinearMath / btSerializer . h " , <nl> + " external / bullet / include / bullet / LinearMath / btStackAlloc . h " , <nl> + " external / bullet / include / bullet / LinearMath / btTransform . h " , <nl> + " external / bullet / include / bullet / LinearMath / btTransformUtil . h " , <nl> + " external / bullet / include / bullet / LinearMath / btVector3 . h " , <nl> + " external / bullet / include / bullet / MiniCL / MiniCLTask / MiniCLTask . h " , <nl> + " external / bullet / include / bullet / MiniCL / MiniCLTaskScheduler . h " , <nl> + " external / bullet / include / bullet / MiniCL / cl . h " , <nl> + " external / bullet / include / bullet / MiniCL / cl_MiniCL_Defs . h " , <nl> + " external / bullet / include / bullet / MiniCL / cl_gl . h " , <nl> + " external / bullet / include / bullet / MiniCL / cl_platform . h " , <nl> + " external / bullet / include / bullet / btBulletCollisionCommon . h " , <nl> + " external / bullet / include / bullet / btBulletDynamicsCommon . h " , <nl> + " external / bullet / include / bullet / vectormath / scalar / boolInVec . h " , <nl> + " external / bullet / include / bullet / vectormath / scalar / floatInVec . h " , <nl> + " external / bullet / include / bullet / vectormath / scalar / mat_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / scalar / quat_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / scalar / vec_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / scalar / vectormath_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / boolInVec . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / floatInVec . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / mat_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / quat_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / vec_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / vecidx_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / sse / vectormath_aos . h " , <nl> + " external / bullet / include / bullet / vectormath / vmInclude . h " , <nl> + " external / bullet / prebuilt / android / Android . mk " , <nl> + " external / bullet / prebuilt / android / arm64 - v8a / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / android / arm64 - v8a / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / android / arm64 - v8a / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / android / arm64 - v8a / libLinearMath . a " , <nl> + " external / bullet / prebuilt / android / arm64 - v8a / libMiniCL . a " , <nl> + " external / bullet / prebuilt / android / armeabi - v7a / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / android / armeabi - v7a / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / android / armeabi - v7a / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / android / armeabi - v7a / libLinearMath . a " , <nl> + " external / bullet / prebuilt / android / armeabi - v7a / libMiniCL . a " , <nl> + " external / bullet / prebuilt / android / armeabi / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / android / armeabi / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / android / armeabi / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / android / armeabi / libLinearMath . a " , <nl> + " external / bullet / prebuilt / android / armeabi / libMiniCL . a " , <nl> + " external / bullet / prebuilt / android / x86 / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / android / x86 / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / android / x86 / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / android / x86 / libLinearMath . a " , <nl> + " external / bullet / prebuilt / android / x86 / libMiniCL . a " , <nl> + " external / bullet / prebuilt / ios / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / ios / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / ios / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / ios / libLinearMath . a " , <nl> + " external / bullet / prebuilt / ios / libMiniCL . a " , <nl> + " external / bullet / prebuilt / linux / 64 - bit / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / linux / 64 - bit / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / linux / 64 - bit / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / linux / 64 - bit / libLinearMath . a " , <nl> + " external / bullet / prebuilt / linux / 64 - bit / libMiniCL . a " , <nl> + " external / bullet / prebuilt / mac / libBulletCollision . a " , <nl> + " external / bullet / prebuilt / mac / libBulletDynamics . a " , <nl> + " external / bullet / prebuilt / mac / libBulletMultiThreaded . a " , <nl> + " external / bullet / prebuilt / mac / libLinearMath . a " , <nl> + " external / bullet / prebuilt / mac / libMiniCL . a " , <nl> " external / chipmunk / include / chipmunk / chipmunk . h " , <nl> " external / chipmunk / include / chipmunk / chipmunk_ffi . h " , <nl> " external / chipmunk / include / chipmunk / chipmunk_private . h " , <nl>
|
[ ci skip ] [ AUTO ] : updating luabinding & jsbinding & cocos_file . json automatically ( )
|
cocos2d/cocos2d-x
|
320bf9706606847ce98a8d0aaa5a4d2225d28dbe
|
2017-06-21T06:34:55Z
|
mmm a / test / server / server_corpus / clusterfuzz - testcase - server_fuzz_test - 4832853025095680 <nl> ppp b / test / server / server_corpus / clusterfuzz - testcase - server_fuzz_test - 4832853025095680 <nl> static_resources { <nl> hosts { <nl> socket_address { <nl> address : " google . com " <nl> - port_value : 443 <nl> + port_value : 0 <nl> } <nl> } <nl> tls_context { <nl> mmm a / test / server / server_corpus / clusterfuzz - testcase - server_fuzz_test - 6280208148594688 <nl> ppp b / test / server / server_corpus / clusterfuzz - testcase - server_fuzz_test - 6280208148594688 <nl> static_resources { <nl> hosts { <nl> socket_address { <nl> address : " 127 . 0 . 0 . 1 " <nl> - port_value : 9901 <nl> + port_value : 0 <nl> } <nl> } <nl> tls_context { <nl> admin { <nl> address { <nl> socket_address { <nl> address : " 127 . 0 . 0 . 1 " <nl> - port_value : 9901 <nl> + port_value : 0 <nl> } <nl> } <nl> } <nl> mmm a / test / server / server_corpus / crash - d60f68abcafaae8e7b135ca5144b062d969e5575 <nl> ppp b / test / server / server_corpus / crash - d60f68abcafaae8e7b135ca5144b062d969e5575 <nl> static_resources { <nl> hosts { <nl> socket_address { <nl> address : " google . com " <nl> - port_value : 443 <nl> + port_value : 0 <nl> } <nl> } <nl> tls_context { <nl> static_resources { <nl> hosts { <nl> socket_address { <nl> address : " google . com " <nl> - port_value : 443 <nl> + port_value : 0 <nl> } <nl> } <nl> tls_context { <nl> admin { <nl> address { <nl> socket_address { <nl> address : " 127 . 0 . 0 . 1 " <nl> - port_value : 9901 <nl> + port_value : 0 <nl> } <nl> } <nl> } <nl> mmm a / test / server / server_corpus / google_com_proxy . v2 . pb_text <nl> ppp b / test / server / server_corpus / google_com_proxy . v2 . pb_text <nl> static_resources { <nl> address { <nl> socket_address { <nl> address : " 0 . 0 . 0 . 0 " <nl> - port_value : 10000 <nl> + port_value : 0 <nl> } <nl> } <nl> filter_chains { <nl> static_resources { <nl> hosts { <nl> socket_address { <nl> address : " google . com " <nl> - port_value : 443 <nl> + port_value : 0 <nl> } <nl> } <nl> tls_context { <nl> admin { <nl> address { <nl> socket_address { <nl> address : " 127 . 0 . 0 . 1 " <nl> - port_value : 9901 <nl> + port_value : 0 <nl> } <nl> } <nl> } <nl>
|
fuzz : make server_fuzz corpus more hermetic . ( )
|
envoyproxy/envoy
|
f0af99c0fffd69e73f8c8c0757373729b0f970db
|
2018-04-26T19:15:50Z
|
mmm a / tools / dead_function_eliminator . py <nl> ppp b / tools / dead_function_eliminator . py <nl> <nl> <nl> import os , sys , re <nl> <nl> - abspath = os . path . abspath ( os . path . dirname ( __file__ ) ) <nl> def path_from_root ( * pathelems ) : <nl> - return os . path . join ( os . path . sep , * ( abspath . split ( os . sep ) [ : - 1 ] + list ( pathelems ) ) ) <nl> + rootpath = os . path . abspath ( os . path . dirname ( os . path . dirname ( __file__ ) ) ) <nl> + return os . path . join ( rootpath , * pathelems ) <nl> exec ( open ( path_from_root ( ' tools ' , ' shared . py ' ) , ' r ' ) . read ( ) ) <nl> <nl> infile = sys . argv [ 1 ] <nl>
|
Edited tools / dead_function_eliminator . py via GitHub
|
emscripten-core/emscripten
|
5a2bdcfa7c385ce1e56c4e66264a6947ce795314
|
2011-09-23T10:37:12Z
|
mmm a / Telegram / SourceFiles / apiwrap . cpp <nl> ppp b / Telegram / SourceFiles / apiwrap . cpp <nl> void ApiWrap : : stickersSaveOrder ( ) { <nl> } <nl> } <nl> <nl> + void ApiWrap : : applyUpdatesNoPtsCheck ( const MTPUpdates & updates ) { <nl> + switch ( updates . type ( ) ) { <nl> + case mtpc_updateShortMessage : { <nl> + auto & d = updates . c_updateShortMessage ( ) ; <nl> + auto flags = mtpCastFlags ( d . vflags . v ) | MTPDmessage : : Flag : : f_from_id ; <nl> + App : : histories ( ) . addNewMessage ( MTP_message ( MTP_flags ( flags ) , d . vid , d . is_out ( ) ? MTP_int ( AuthSession : : CurrentUserId ( ) ) : d . vuser_id , MTP_peerUser ( d . is_out ( ) ? d . vuser_id : MTP_int ( AuthSession : : CurrentUserId ( ) ) ) , d . vfwd_from , d . vvia_bot_id , d . vreply_to_msg_id , d . vdate , d . vmessage , MTP_messageMediaEmpty ( ) , MTPnullMarkup , d . has_entities ( ) ? d . ventities : MTPnullEntities , MTPint ( ) , MTPint ( ) ) , NewMessageUnread ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateShortChatMessage : { <nl> + auto & d = updates . c_updateShortChatMessage ( ) ; <nl> + auto flags = mtpCastFlags ( d . vflags . v ) | MTPDmessage : : Flag : : f_from_id ; <nl> + App : : histories ( ) . addNewMessage ( MTP_message ( MTP_flags ( flags ) , d . vid , d . vfrom_id , MTP_peerChat ( d . vchat_id ) , d . vfwd_from , d . vvia_bot_id , d . vreply_to_msg_id , d . vdate , d . vmessage , MTP_messageMediaEmpty ( ) , MTPnullMarkup , d . has_entities ( ) ? d . ventities : MTPnullEntities , MTPint ( ) , MTPint ( ) ) , NewMessageUnread ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateShortSentMessage : { <nl> + auto & d = updates . c_updateShortSentMessage ( ) ; <nl> + Q_UNUSED ( d ) ; / / Sent message data was applied anyway . <nl> + } break ; <nl> + <nl> + default : Unexpected ( " Type in applyUpdatesNoPtsCheck ( ) " ) ; <nl> + } <nl> + } <nl> + <nl> + void ApiWrap : : applyUpdateNoPtsCheck ( const MTPUpdate & update ) { <nl> + switch ( update . type ( ) ) { <nl> + case mtpc_updateNewMessage : { <nl> + auto & d = update . c_updateNewMessage ( ) ; <nl> + auto needToAdd = true ; <nl> + if ( d . vmessage . type ( ) = = mtpc_message ) { / / index forwarded messages to links _overview <nl> + if ( App : : checkEntitiesAndViewsUpdate ( d . vmessage . c_message ( ) ) ) { / / already in blocks <nl> + LOG ( ( " Skipping message , because it is already in blocks ! " ) ) ; <nl> + needToAdd = false ; <nl> + } <nl> + } <nl> + if ( needToAdd ) { <nl> + App : : histories ( ) . addNewMessage ( d . vmessage , NewMessageUnread ) ; <nl> + } <nl> + } break ; <nl> + <nl> + case mtpc_updateReadMessagesContents : { <nl> + auto & d = update . c_updateReadMessagesContents ( ) ; <nl> + auto & v = d . vmessages . v ; <nl> + for ( auto i = 0 , l = v . size ( ) ; i < l ; + + i ) { <nl> + if ( auto item = App : : histItemById ( NoChannel , v . at ( i ) . v ) ) { <nl> + if ( item - > isMediaUnread ( ) ) { <nl> + item - > markMediaRead ( ) ; <nl> + Ui : : repaintHistoryItem ( item ) ; <nl> + <nl> + if ( item - > out ( ) & & item - > history ( ) - > peer - > isUser ( ) ) { <nl> + auto when = App : : main ( ) - > requestingDifference ( ) ? 0 : unixtime ( ) ; <nl> + item - > history ( ) - > peer - > asUser ( ) - > madeAction ( when ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> + } break ; <nl> + <nl> + case mtpc_updateReadHistoryInbox : { <nl> + auto & d = update . c_updateReadHistoryInbox ( ) ; <nl> + App : : feedInboxRead ( peerFromMTP ( d . vpeer ) , d . vmax_id . v ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateReadHistoryOutbox : { <nl> + auto & d = update . c_updateReadHistoryOutbox ( ) ; <nl> + auto peerId = peerFromMTP ( d . vpeer ) ; <nl> + auto when = App : : main ( ) - > requestingDifference ( ) ? 0 : unixtime ( ) ; <nl> + App : : feedOutboxRead ( peerId , d . vmax_id . v , when ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateWebPage : { <nl> + auto & d = update . c_updateWebPage ( ) ; <nl> + Q_UNUSED ( d ) ; / / Web page was updated anyway . <nl> + } break ; <nl> + <nl> + case mtpc_updateDeleteMessages : { <nl> + auto & d = update . c_updateDeleteMessages ( ) ; <nl> + App : : feedWereDeleted ( NoChannel , d . vmessages . v ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateNewChannelMessage : { <nl> + auto & d = update . c_updateNewChannelMessage ( ) ; <nl> + auto needToAdd = true ; <nl> + if ( d . vmessage . type ( ) = = mtpc_message ) { / / index forwarded messages to links _overview <nl> + if ( App : : checkEntitiesAndViewsUpdate ( d . vmessage . c_message ( ) ) ) { / / already in blocks <nl> + LOG ( ( " Skipping message , because it is already in blocks ! " ) ) ; <nl> + needToAdd = false ; <nl> + } <nl> + } <nl> + if ( needToAdd ) { <nl> + App : : histories ( ) . addNewMessage ( d . vmessage , NewMessageUnread ) ; <nl> + } <nl> + } break ; <nl> + <nl> + case mtpc_updateEditChannelMessage : { <nl> + auto & d = update . c_updateEditChannelMessage ( ) ; <nl> + App : : updateEditedMessage ( d . vmessage ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateEditMessage : { <nl> + auto & d = update . c_updateEditMessage ( ) ; <nl> + App : : updateEditedMessage ( d . vmessage ) ; <nl> + } break ; <nl> + <nl> + case mtpc_updateChannelWebPage : { <nl> + auto & d = update . c_updateChannelWebPage ( ) ; <nl> + Q_UNUSED ( d ) ; / / Web page was updated anyway . <nl> + } break ; <nl> + <nl> + case mtpc_updateDeleteChannelMessages : { <nl> + auto & d = update . c_updateDeleteChannelMessages ( ) ; <nl> + App : : feedWereDeleted ( d . vchannel_id . v , d . vmessages . v ) ; <nl> + } break ; <nl> + <nl> + default : Unexpected ( " Type in applyUpdateNoPtsCheck ( ) " ) ; <nl> + } <nl> + } <nl> + <nl> ApiWrap : : ~ ApiWrap ( ) = default ; <nl> mmm a / Telegram / SourceFiles / apiwrap . h <nl> ppp b / Telegram / SourceFiles / apiwrap . h <nl> class ApiWrap : private MTP : : Sender , private base : : Subscriber { <nl> <nl> bool isQuitPrevent ( ) ; <nl> <nl> + void applyUpdatesNoPtsCheck ( const MTPUpdates & updates ) ; <nl> + void applyUpdateNoPtsCheck ( const MTPUpdate & update ) ; <nl> + <nl> ~ ApiWrap ( ) ; <nl> <nl> private : <nl> mmm a / Telegram / SourceFiles / mainwidget . cpp <nl> ppp b / Telegram / SourceFiles / mainwidget . cpp <nl> void MainWidget : : deleteHistoryAfterLeave ( PeerData * peer , const MTPUpdates & updat <nl> void MainWidget : : deleteHistoryPart ( DeleteHistoryRequest request , const MTPmessages_AffectedHistory & result ) { <nl> auto peer = request . peer ; <nl> <nl> - const auto & d ( result . c_messages_affectedHistory ( ) ) ; <nl> + auto & d = result . c_messages_affectedHistory ( ) ; <nl> if ( peer & & peer - > isChannel ( ) ) { <nl> - if ( peer - > asChannel ( ) - > ptsUpdated ( d . vpts . v , d . vpts_count . v ) ) { <nl> - peer - > asChannel ( ) - > ptsApplySkippedUpdates ( ) ; <nl> - } <nl> + peer - > asChannel ( ) - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v ) ; <nl> } else { <nl> - if ( ptsUpdated ( d . vpts . v , d . vpts_count . v ) ) { <nl> - ptsApplySkippedUpdates ( ) ; <nl> - } <nl> + ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v ) ; <nl> } <nl> <nl> - int32 offset = d . voffset . v ; <nl> + auto offset = d . voffset . v ; <nl> if ( offset < = 0 ) { <nl> cRefReportSpamStatuses ( ) . remove ( peer - > id ) ; <nl> Local : : writeReportSpamStatuses ( ) ; <nl> void MainWidget : : deleteAllFromUser ( ChannelData * channel , UserData * from ) { <nl> } <nl> <nl> void MainWidget : : deleteAllFromUserPart ( DeleteAllFromUserParams params , const MTPmessages_AffectedHistory & result ) { <nl> - const auto & d ( result . c_messages_affectedHistory ( ) ) ; <nl> - if ( params . channel - > ptsUpdated ( d . vpts . v , d . vpts_count . v ) ) { <nl> - params . channel - > ptsApplySkippedUpdates ( ) ; <nl> - } <nl> + auto & d = result . c_messages_affectedHistory ( ) ; <nl> + params . channel - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v ) ; <nl> <nl> - int32 offset = d . voffset . v ; <nl> + auto offset = d . voffset . v ; <nl> if ( offset > 0 ) { <nl> MTP : : send ( MTPchannels_DeleteUserHistory ( params . channel - > inputChannel , params . from - > inputUser ) , rpcDone ( & MainWidget : : deleteAllFromUserPart , params ) ) ; <nl> - } else if ( History * h = App : : historyLoaded ( params . channel ) ) { <nl> + } else if ( auto h = App : : historyLoaded ( params . channel ) ) { <nl> if ( ! h - > lastMsg ) { <nl> checkPeerHistory ( params . channel ) ; <nl> } <nl> void MainWidget : : readRequestDone ( PeerData * peer ) { <nl> } <nl> <nl> void MainWidget : : messagesAffected ( PeerData * peer , const MTPmessages_AffectedMessages & result ) { <nl> - const auto & d ( result . c_messages_affectedMessages ( ) ) ; <nl> + auto & d = result . c_messages_affectedMessages ( ) ; <nl> if ( peer & & peer - > isChannel ( ) ) { <nl> - if ( peer - > asChannel ( ) - > ptsUpdated ( d . vpts . v , d . vpts_count . v ) ) { <nl> - peer - > asChannel ( ) - > ptsApplySkippedUpdates ( ) ; <nl> - } <nl> + peer - > asChannel ( ) - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v ) ; <nl> } else { <nl> - if ( ptsUpdated ( d . vpts . v , d . vpts_count . v ) ) { <nl> - ptsApplySkippedUpdates ( ) ; <nl> - } <nl> + ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v ) ; <nl> } <nl> - if ( History * h = App : : historyLoaded ( peer ? peer - > id : 0 ) ) { <nl> + <nl> + if ( auto h = App : : historyLoaded ( peer ? peer - > id : 0 ) ) { <nl> if ( ! h - > lastMsg ) { <nl> checkPeerHistory ( peer ) ; <nl> } <nl> void MainWidget : : failDifferenceStartTimerFor ( ChannelData * channel ) { <nl> } <nl> } <nl> <nl> - bool MainWidget : : ptsUpdated ( int32 pts , int32 ptsCount ) { / / return false if need to save that update and apply later <nl> - return _ptsWaiter . updated ( 0 , pts , ptsCount ) ; <nl> + bool MainWidget : : ptsUpdateAndApply ( int32 pts , int32 ptsCount , const MTPUpdates & updates ) { <nl> + return _ptsWaiter . updateAndApply ( nullptr , pts , ptsCount , updates ) ; <nl> } <nl> <nl> - bool MainWidget : : ptsUpdated ( int32 pts , int32 ptsCount , const MTPUpdates & updates ) { <nl> - return _ptsWaiter . updated ( 0 , pts , ptsCount , updates ) ; <nl> + bool MainWidget : : ptsUpdateAndApply ( int32 pts , int32 ptsCount , const MTPUpdate & update ) { <nl> + return _ptsWaiter . updateAndApply ( nullptr , pts , ptsCount , update ) ; <nl> } <nl> <nl> - bool MainWidget : : ptsUpdated ( int32 pts , int32 ptsCount , const MTPUpdate & update ) { <nl> - return _ptsWaiter . updated ( 0 , pts , ptsCount , update ) ; <nl> - } <nl> - <nl> - void MainWidget : : ptsApplySkippedUpdates ( ) { <nl> - return _ptsWaiter . applySkippedUpdates ( 0 ) ; <nl> + bool MainWidget : : ptsUpdateAndApply ( int32 pts , int32 ptsCount ) { <nl> + return _ptsWaiter . updateAndApply ( nullptr , pts , ptsCount ) ; <nl> } <nl> <nl> void MainWidget : : feedDifference ( const MTPVector < MTPUser > & users , const MTPVector < MTPChat > & chats , const MTPVector < MTPMessage > & msgs , const MTPVector < MTPUpdate > & other ) { <nl> void MainWidget : : feedUpdates ( const MTPUpdates & updates , uint64 randomId ) { <nl> MTP_LOG ( 0 , ( " getDifference { good - getting user for updateShortMessage } % 1 " ) . arg ( cTestMode ( ) ? " TESTMODE " : " " ) ) ; <nl> return getDifference ( ) ; <nl> } <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , updates ) ) { <nl> - return ; <nl> - } <nl> + if ( ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , updates ) ) { <nl> + / / We could ' ve added an item . <nl> + / / Better would be for history to be subscribed to new messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> <nl> - / / update before applying skipped <nl> - auto flags = mtpCastFlags ( d . vflags . v ) | MTPDmessage : : Flag : : f_from_id ; <nl> - auto item = App : : histories ( ) . addNewMessage ( MTP_message ( MTP_flags ( flags ) , d . vid , d . is_out ( ) ? MTP_int ( AuthSession : : CurrentUserId ( ) ) : d . vuser_id , MTP_peerUser ( d . is_out ( ) ? d . vuser_id : MTP_int ( AuthSession : : CurrentUserId ( ) ) ) , d . vfwd_from , d . vvia_bot_id , d . vreply_to_msg_id , d . vdate , d . vmessage , MTP_messageMediaEmpty ( ) , MTPnullMarkup , d . has_entities ( ) ? d . ventities : MTPnullEntities , MTPint ( ) , MTPint ( ) ) , NewMessageUnread ) ; <nl> - if ( item ) { <nl> - _history - > peerMessagesUpdated ( item - > history ( ) - > peer - > id ) ; <nl> + / / Update date as well . <nl> + updSetState ( 0 , d . vdate . v , updQts , updSeq ) ; <nl> } <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> - <nl> - updSetState ( 0 , d . vdate . v , updQts , updSeq ) ; <nl> } break ; <nl> <nl> case mtpc_updateShortChatMessage : { <nl> void MainWidget : : feedUpdates ( const MTPUpdates & updates , uint64 randomId ) { <nl> if ( noFrom & & App : : api ( ) ) App : : api ( ) - > requestFullPeer ( App : : chatLoaded ( d . vchat_id . v ) ) ; <nl> return getDifference ( ) ; <nl> } <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , updates ) ) { <nl> - return ; <nl> - } <nl> + if ( ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , updates ) ) { <nl> + / / We could ' ve added an item . <nl> + / / Better would be for history to be subscribed to new messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> <nl> - / / update before applying skipped <nl> - auto flags = mtpCastFlags ( d . vflags . v ) | MTPDmessage : : Flag : : f_from_id ; <nl> - auto item = App : : histories ( ) . addNewMessage ( MTP_message ( MTP_flags ( flags ) , d . vid , d . vfrom_id , MTP_peerChat ( d . vchat_id ) , d . vfwd_from , d . vvia_bot_id , d . vreply_to_msg_id , d . vdate , d . vmessage , MTP_messageMediaEmpty ( ) , MTPnullMarkup , d . has_entities ( ) ? d . ventities : MTPnullEntities , MTPint ( ) , MTPint ( ) ) , NewMessageUnread ) ; <nl> - if ( item ) { <nl> - _history - > peerMessagesUpdated ( item - > history ( ) - > peer - > id ) ; <nl> + / / Update date as well . <nl> + updSetState ( 0 , d . vdate . v , updQts , updSeq ) ; <nl> } <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> - <nl> - updSetState ( 0 , d . vdate . v , updQts , updSeq ) ; <nl> } break ; <nl> <nl> case mtpc_updateShortSentMessage : { <nl> void MainWidget : : feedUpdates ( const MTPUpdates & updates , uint64 randomId ) { <nl> } <nl> } <nl> <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , updates ) ) { <nl> - return ; <nl> + if ( ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , updates ) ) { <nl> + / / Update date as well . <nl> + updSetState ( 0 , d . vdate . v , updQts , updSeq ) ; <nl> } <nl> - / / update before applying skipped <nl> - ptsApplySkippedUpdates ( ) ; <nl> - <nl> - updSetState ( 0 , d . vdate . v , updQts , updSeq ) ; <nl> } break ; <nl> <nl> case mtpc_updatesTooLong : { <nl> void MainWidget : : feedUpdate ( const MTPUpdate & update ) { <nl> return getDifference ( ) ; <nl> } <nl> <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - bool needToAdd = true ; <nl> - if ( d . vmessage . type ( ) = = mtpc_message ) { / / index forwarded messages to links _overview <nl> - if ( App : : checkEntitiesAndViewsUpdate ( d . vmessage . c_message ( ) ) ) { / / already in blocks <nl> - LOG ( ( " Skipping message , because it is already in blocks ! " ) ) ; <nl> - needToAdd = false ; <nl> - } <nl> - } <nl> - if ( needToAdd ) { <nl> - if ( auto item = App : : histories ( ) . addNewMessage ( d . vmessage , NewMessageUnread ) ) { <nl> - _history - > peerMessagesUpdated ( item - > history ( ) - > peer - > id ) ; <nl> - } <nl> + if ( ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> + / / We could ' ve added an item . <nl> + / / Better would be for history to be subscribed to new messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> } <nl> - ptsApplySkippedUpdates ( ) ; <nl> } break ; <nl> <nl> case mtpc_updateMessageID : { <nl> void MainWidget : : feedUpdate ( const MTPUpdate & update ) { <nl> <nl> case mtpc_updateReadMessagesContents : { <nl> auto & d = update . c_updateReadMessagesContents ( ) ; <nl> - <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - auto & v = d . vmessages . v ; <nl> - for ( int32 i = 0 , l = v . size ( ) ; i < l ; + + i ) { <nl> - if ( auto item = App : : histItemById ( NoChannel , v . at ( i ) . v ) ) { <nl> - if ( item - > isMediaUnread ( ) ) { <nl> - item - > markMediaRead ( ) ; <nl> - Ui : : repaintHistoryItem ( item ) ; <nl> - <nl> - if ( item - > out ( ) & & item - > history ( ) - > peer - > isUser ( ) ) { <nl> - auto when = requestingDifference ( ) ? 0 : unixtime ( ) ; <nl> - item - > history ( ) - > peer - > asUser ( ) - > madeAction ( when ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> + ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ; <nl> } break ; <nl> <nl> case mtpc_updateReadHistoryInbox : { <nl> auto & d = update . c_updateReadHistoryInbox ( ) ; <nl> - <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - App : : feedInboxRead ( peerFromMTP ( d . vpeer ) , d . vmax_id . v ) ; <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> + ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ; <nl> } break ; <nl> <nl> case mtpc_updateReadHistoryOutbox : { <nl> auto & d = update . c_updateReadHistoryOutbox ( ) ; <nl> - <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - auto peerId = peerFromMTP ( d . vpeer ) ; <nl> - auto when = requestingDifference ( ) ? 0 : unixtime ( ) ; <nl> - App : : feedOutboxRead ( peerId , d . vmax_id . v , when ) ; <nl> - if ( _history - > peer ( ) & & _history - > peer ( ) - > id = = peerId ) { <nl> + if ( ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> + / / We could ' ve updated the double checks . <nl> + / / Better would be for history to be subscribed to outbox read events . <nl> _history - > update ( ) ; <nl> } <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> } break ; <nl> <nl> case mtpc_updateWebPage : { <nl> auto & d = update . c_updateWebPage ( ) ; <nl> <nl> - / / update web page anyway <nl> + / / Update web page anyway . <nl> App : : feedWebPage ( d . vwebpage ) ; <nl> _history - > updatePreview ( ) ; <nl> webPagesOrGamesUpdate ( ) ; <nl> <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> - } <nl> - ptsApplySkippedUpdates ( ) ; <nl> + ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ; <nl> } break ; <nl> <nl> case mtpc_updateDeleteMessages : { <nl> auto & d = update . c_updateDeleteMessages ( ) ; <nl> <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> + if ( ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> + / / We could ' ve removed some items . <nl> + / / Better would be for history to be subscribed to removed messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> } <nl> - <nl> - / / update before applying skipped <nl> - App : : feedWereDeleted ( NoChannel , d . vmessages . v ) ; <nl> - _history - > peerMessagesUpdated ( ) ; <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> } break ; <nl> <nl> case mtpc_updateUserTyping : { <nl> void MainWidget : : feedUpdate ( const MTPUpdate & update ) { <nl> if ( channel & & ! _handlingChannelDifference ) { <nl> if ( channel - > ptsRequesting ( ) ) { / / skip global updates while getting channel difference <nl> return ; <nl> - } else if ( ! channel - > ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> + } else if ( channel - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> + / / We could ' ve added an item . <nl> + / / Better would be for history to be subscribed to new messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> } <nl> - } <nl> + } else { <nl> + App : : api ( ) - > applyUpdateNoPtsCheck ( update ) ; <nl> <nl> - / / update before applying skipped <nl> - bool needToAdd = true ; <nl> - if ( d . vmessage . type ( ) = = mtpc_message ) { / / index forwarded messages to links _overview <nl> - if ( App : : checkEntitiesAndViewsUpdate ( d . vmessage . c_message ( ) ) ) { / / already in blocks <nl> - LOG ( ( " Skipping message , because it is already in blocks ! " ) ) ; <nl> - needToAdd = false ; <nl> - } <nl> - } <nl> - if ( needToAdd ) { <nl> - if ( auto item = App : : histories ( ) . addNewMessage ( d . vmessage , NewMessageUnread ) ) { <nl> - _history - > peerMessagesUpdated ( item - > history ( ) - > peer - > id ) ; <nl> - } <nl> - } <nl> - if ( channel & & ! _handlingChannelDifference ) { <nl> - channel - > ptsApplySkippedUpdates ( ) ; <nl> + / / We could ' ve added an item . <nl> + / / Better would be for history to be subscribed to new messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> } <nl> } break ; <nl> <nl> void MainWidget : : feedUpdate ( const MTPUpdate & update ) { <nl> if ( channel & & ! _handlingChannelDifference ) { <nl> if ( channel - > ptsRequesting ( ) ) { / / skip global updates while getting channel difference <nl> return ; <nl> - } else if ( ! channel - > ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> + } else { <nl> + channel - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ; <nl> } <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - App : : updateEditedMessage ( d . vmessage ) ; <nl> - <nl> - if ( channel & & ! _handlingChannelDifference ) { <nl> - channel - > ptsApplySkippedUpdates ( ) ; <nl> + } else { <nl> + App : : api ( ) - > applyUpdateNoPtsCheck ( update ) ; <nl> } <nl> } break ; <nl> <nl> case mtpc_updateEditMessage : { <nl> auto & d = update . c_updateEditMessage ( ) ; <nl> - <nl> - if ( ! ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - App : : updateEditedMessage ( d . vmessage ) ; <nl> - <nl> - ptsApplySkippedUpdates ( ) ; <nl> + ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ; <nl> } break ; <nl> <nl> case mtpc_updateChannelPinnedMessage : { <nl> void MainWidget : : feedUpdate ( const MTPUpdate & update ) { <nl> if ( channel & & ! _handlingChannelDifference ) { <nl> if ( channel - > ptsRequesting ( ) ) { / / skip global updates while getting channel difference <nl> return ; <nl> - } else if ( ! channel - > ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> + } else { <nl> + channel - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ; <nl> } <nl> - } <nl> - <nl> - if ( channel & & ! _handlingChannelDifference ) { <nl> - channel - > ptsApplySkippedUpdates ( ) ; <nl> + } else { <nl> + App : : api ( ) - > applyUpdateNoPtsCheck ( update ) ; <nl> } <nl> } break ; <nl> <nl> void MainWidget : : feedUpdate ( const MTPUpdate & update ) { <nl> if ( channel & & ! _handlingChannelDifference ) { <nl> if ( channel - > ptsRequesting ( ) ) { / / skip global updates while getting channel difference <nl> return ; <nl> - } else if ( ! channel - > ptsUpdated ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> - return ; <nl> + } else if ( channel - > ptsUpdateAndApply ( d . vpts . v , d . vpts_count . v , update ) ) { <nl> + / / We could ' ve removed some items . <nl> + / / Better would be for history to be subscribed to removed messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> } <nl> - } <nl> - <nl> - / / update before applying skipped <nl> - App : : feedWereDeleted ( d . vchannel_id . v , d . vmessages . v ) ; <nl> - _history - > peerMessagesUpdated ( ) ; <nl> + } else { <nl> + / / We could ' ve removed some items . <nl> + / / Better would be for history to be subscribed to removed messages . <nl> + _history - > peerMessagesUpdated ( ) ; <nl> <nl> - if ( channel & & ! _handlingChannelDifference ) { <nl> - channel - > ptsApplySkippedUpdates ( ) ; <nl> + App : : api ( ) - > applyUpdateNoPtsCheck ( update ) ; <nl> } <nl> } break ; <nl> <nl> mmm a / Telegram / SourceFiles / mainwidget . h <nl> ppp b / Telegram / SourceFiles / mainwidget . h <nl> class MainWidget : public TWidget , public RPCSender , private base : : Subscriber { <nl> void gotRangeDifference ( ChannelData * channel , const MTPupdates_ChannelDifference & diff ) ; <nl> void onSelfParticipantUpdated ( ChannelData * channel ) ; <nl> <nl> + / / Mayde public for ApiWrap , while it is still here . <nl> + / / Better would be for this to be moved to ApiWrap . <nl> + bool requestingDifference ( ) const { <nl> + return _ptsWaiter . requesting ( ) ; <nl> + } <nl> + <nl> bool contentOverlapped ( const QRect & globalRect ) ; <nl> <nl> void documentLoadProgress ( DocumentData * document ) ; <nl> public slots : <nl> QPoint getFloatPlayerHiddenPosition ( QPoint position , QSize size , RectPart side ) const ; <nl> RectPart getFloatPlayerSide ( QPoint center ) const ; <nl> <nl> - bool ptsUpdated ( int32 pts , int32 ptsCount ) ; <nl> - bool ptsUpdated ( int32 pts , int32 ptsCount , const MTPUpdates & updates ) ; <nl> - bool ptsUpdated ( int32 pts , int32 ptsCount , const MTPUpdate & update ) ; <nl> - void ptsApplySkippedUpdates ( ) ; <nl> - bool requestingDifference ( ) const { <nl> - return _ptsWaiter . requesting ( ) ; <nl> - } <nl> + bool ptsUpdateAndApply ( int32 pts , int32 ptsCount , const MTPUpdates & updates ) ; <nl> + bool ptsUpdateAndApply ( int32 pts , int32 ptsCount , const MTPUpdate & update ) ; <nl> + bool ptsUpdateAndApply ( int32 pts , int32 ptsCount ) ; <nl> bool getDifferenceTimeChanged ( ChannelData * channel , int32 ms , ChannelGetDifferenceTime & channelCurTime , TimeMs & curTime ) ; <nl> <nl> void viewsIncrementDone ( QVector < MTPint > ids , const MTPVector < MTPint > & result , mtpRequestId req ) ; <nl> mmm a / Telegram / SourceFiles / structs . cpp <nl> ppp b / Telegram / SourceFiles / structs . cpp <nl> void ChannelData : : setRestrictedRights ( const MTPChannelBannedRights & rights ) { <nl> Notify : : peerUpdatedDelayed ( this , UpdateFlag : : ChannelRightsChanged | UpdateFlag : : AdminsChanged | UpdateFlag : : BannedUsersChanged ) ; <nl> } <nl> <nl> - uint64 PtsWaiter : : ptsKey ( PtsSkippedQueue queue ) { <nl> - return _queue . insert ( uint64 ( uint32 ( _last ) ) < < 32 | uint64 ( uint32 ( _count ) ) , queue ) . key ( ) ; <nl> + uint64 PtsWaiter : : ptsKey ( PtsSkippedQueue queue , int32 pts ) { <nl> + return _queue . insert ( uint64 ( uint32 ( pts ) ) < < 32 | ( + + _skippedKey ) , queue ) . key ( ) ; <nl> } <nl> <nl> void PtsWaiter : : setWaitingForSkipped ( ChannelData * channel , int32 ms ) { <nl> void PtsWaiter : : applySkippedUpdates ( ChannelData * channel ) { <nl> <nl> setWaitingForSkipped ( channel , - 1 ) ; <nl> <nl> - if ( ! App : : main ( ) | | _queue . isEmpty ( ) ) return ; <nl> + if ( ! App : : api ( ) | | _queue . isEmpty ( ) ) return ; <nl> <nl> + + _applySkippedLevel ; <nl> for ( QMap < uint64 , PtsSkippedQueue > : : const_iterator i = _queue . cbegin ( ) , e = _queue . cend ( ) ; i ! = e ; + + i ) { <nl> switch ( i . value ( ) ) { <nl> - case SkippedUpdate : App : : main ( ) - > feedUpdate ( _updateQueue . value ( i . key ( ) ) ) ; break ; <nl> - case SkippedUpdates : App : : main ( ) - > feedUpdates ( _updatesQueue . value ( i . key ( ) ) ) ; break ; <nl> + case SkippedUpdate : App : : api ( ) - > applyUpdateNoPtsCheck ( _updateQueue . value ( i . key ( ) ) ) ; break ; <nl> + case SkippedUpdates : App : : api ( ) - > applyUpdatesNoPtsCheck ( _updatesQueue . value ( i . key ( ) ) ) ; break ; <nl> } <nl> } <nl> - - _applySkippedLevel ; <nl> void PtsWaiter : : clearSkippedUpdates ( ) { <nl> _applySkippedLevel = 0 ; <nl> } <nl> <nl> - bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count ) { <nl> + bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count , const MTPUpdates & updates ) { <nl> if ( _requesting | | _applySkippedLevel ) { <nl> return true ; <nl> } else if ( pts < = _good & & count > 0 ) { <nl> return false ; <nl> + } else if ( check ( channel , pts , count ) ) { <nl> + return true ; <nl> } <nl> - return check ( channel , pts , count ) ; <nl> + _updatesQueue . insert ( ptsKey ( SkippedUpdates , pts ) , updates ) ; <nl> + return false ; <nl> } <nl> <nl> - bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count , const MTPUpdates & updates ) { <nl> + bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count , const MTPUpdate & update ) { <nl> if ( _requesting | | _applySkippedLevel ) { <nl> return true ; <nl> } else if ( pts < = _good & & count > 0 ) { <nl> bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count , const MTPU <nl> } else if ( check ( channel , pts , count ) ) { <nl> return true ; <nl> } <nl> - _updatesQueue . insert ( ptsKey ( SkippedUpdates ) , updates ) ; <nl> + _updateQueue . insert ( ptsKey ( SkippedUpdate , pts ) , update ) ; <nl> return false ; <nl> } <nl> <nl> - bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count , const MTPUpdate & update ) { <nl> + bool PtsWaiter : : updated ( ChannelData * channel , int32 pts , int32 count ) { <nl> if ( _requesting | | _applySkippedLevel ) { <nl> return true ; <nl> } else if ( pts < = _good & & count > 0 ) { <nl> return false ; <nl> - } else if ( check ( channel , pts , count ) ) { <nl> - return true ; <nl> } <nl> - _updateQueue . insert ( ptsKey ( SkippedUpdate ) , update ) ; <nl> - return false ; <nl> + return check ( channel , pts , count ) ; <nl> + } <nl> + <nl> + bool PtsWaiter : : updateAndApply ( ChannelData * channel , int32 pts , int32 count , const MTPUpdates & updates ) { <nl> + if ( ! updated ( channel , pts , count , updates ) ) { <nl> + return false ; <nl> + } <nl> + if ( ! _waitingForSkipped | | _queue . isEmpty ( ) ) { <nl> + / / Optimization - no need to put in queue and back . <nl> + App : : api ( ) - > applyUpdatesNoPtsCheck ( updates ) ; <nl> + } else { <nl> + _updatesQueue . insert ( ptsKey ( SkippedUpdates , pts ) , updates ) ; <nl> + applySkippedUpdates ( channel ) ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + bool PtsWaiter : : updateAndApply ( ChannelData * channel , int32 pts , int32 count , const MTPUpdate & update ) { <nl> + if ( ! updated ( channel , pts , count , update ) ) { <nl> + return false ; <nl> + } <nl> + if ( ! _waitingForSkipped | | _queue . isEmpty ( ) ) { <nl> + / / Optimization - no need to put in queue and back . <nl> + App : : api ( ) - > applyUpdateNoPtsCheck ( update ) ; <nl> + } else { <nl> + _updateQueue . insert ( ptsKey ( SkippedUpdate , pts ) , update ) ; <nl> + applySkippedUpdates ( channel ) ; <nl> + } <nl> + return true ; <nl> + } <nl> + <nl> + bool PtsWaiter : : updateAndApply ( ChannelData * channel , int32 pts , int32 count ) { <nl> + if ( ! updated ( channel , pts , count ) ) { <nl> + return false ; <nl> + } <nl> + applySkippedUpdates ( channel ) ; <nl> + return true ; <nl> } <nl> <nl> bool PtsWaiter : : check ( ChannelData * channel , int32 pts , int32 count ) { / / return false if need to save that update and apply later <nl> mmm a / Telegram / SourceFiles / structs . h <nl> ppp b / Telegram / SourceFiles / structs . h <nl> class PtsWaiter { <nl> int32 current ( ) const { <nl> return _good ; <nl> } <nl> - bool updated ( ChannelData * channel , int32 pts , int32 count ) ; <nl> bool updated ( ChannelData * channel , int32 pts , int32 count , const MTPUpdates & updates ) ; <nl> bool updated ( ChannelData * channel , int32 pts , int32 count , const MTPUpdate & update ) ; <nl> + bool updated ( ChannelData * channel , int32 pts , int32 count ) ; <nl> + bool updateAndApply ( ChannelData * channel , int32 pts , int32 count , const MTPUpdates & updates ) ; <nl> + bool updateAndApply ( ChannelData * channel , int32 pts , int32 count , const MTPUpdate & update ) ; <nl> + bool updateAndApply ( ChannelData * channel , int32 pts , int32 count ) ; <nl> void applySkippedUpdates ( ChannelData * channel ) ; <nl> void clearSkippedUpdates ( ) ; <nl> <nl> private : <nl> bool check ( ChannelData * channel , int32 pts , int32 count ) ; / / return false if need to save that update and apply later <nl> - uint64 ptsKey ( PtsSkippedQueue queue ) ; <nl> + uint64 ptsKey ( PtsSkippedQueue queue , int32 pts ) ; <nl> void checkForWaiting ( ChannelData * channel ) ; <nl> QMap < uint64 , PtsSkippedQueue > _queue ; <nl> QMap < uint64 , MTPUpdate > _updateQueue ; <nl> class PtsWaiter { <nl> int32 _good , _last , _count ; <nl> int32 _applySkippedLevel ; <nl> bool _requesting , _waitingForSkipped , _waitingForShortPoll ; <nl> + uint32 _skippedKey = 0 ; <nl> } ; <nl> <nl> struct MegagroupInfo { <nl> class ChannelData : public PeerData { <nl> _ptsWaiter . init ( pts ) ; <nl> } <nl> void ptsReceived ( int32 pts ) { <nl> - if ( _ptsWaiter . updated ( this , pts , 0 ) ) { <nl> - _ptsWaiter . applySkippedUpdates ( this ) ; <nl> - } <nl> + _ptsWaiter . updateAndApply ( this , pts , 0 ) ; <nl> } <nl> - bool ptsUpdated ( int32 pts , int32 count ) { <nl> - return _ptsWaiter . updated ( this , pts , count ) ; <nl> + bool ptsUpdateAndApply ( int32 pts , int32 count ) { <nl> + return _ptsWaiter . updateAndApply ( this , pts , count ) ; <nl> } <nl> - bool ptsUpdated ( int32 pts , int32 count , const MTPUpdate & update ) { <nl> - return _ptsWaiter . updated ( this , pts , count , update ) ; <nl> + bool ptsUpdateAndApply ( int32 pts , int32 count , const MTPUpdate & update ) { <nl> + return _ptsWaiter . updateAndApply ( this , pts , count , update ) ; <nl> + } <nl> + bool ptsUpdateAndApply ( int32 pts , int32 count , const MTPUpdates & updates ) { <nl> + return _ptsWaiter . updateAndApply ( this , pts , count , updates ) ; <nl> } <nl> int32 pts ( ) const { <nl> return _ptsWaiter . current ( ) ; <nl> class ChannelData : public PeerData { <nl> void ptsSetRequesting ( bool isRequesting ) { <nl> return _ptsWaiter . setRequesting ( isRequesting ) ; <nl> } <nl> - void ptsApplySkippedUpdates ( ) { <nl> - return _ptsWaiter . applySkippedUpdates ( this ) ; <nl> - } <nl> void ptsWaitingForShortPoll ( int32 ms ) { / / < 0 - not waiting <nl> return _ptsWaiter . setWaitingForShortPoll ( this , ms ) ; <nl> } <nl>
|
Improve queued by pts updates handling .
|
telegramdesktop/tdesktop
|
949104d879f3d21b0c732abeaaa923a65048e9d1
|
2017-07-14T11:57:05Z
|
mmm a / include / grpc + + / impl / codegen / call_hook . h <nl> ppp b / include / grpc + + / impl / codegen / call_hook . h <nl> class CallHook { <nl> <nl> } / / namespace grpc <nl> <nl> - # endif / / GRPCXX_IMPL_CODEGEN_CALL_HOOK_H <nl> + # endif / / GRPCXX_IMPL_CODEGEN_CALL_HOOK_H <nl>
|
clang - format
|
grpc/grpc
|
1d9b8079cb92597ed9fef1a03c1af4e03e7ad7e4
|
2016-01-21T18:08:22Z
|
mmm a / tensorflow / python / data / kernel_tests / multi_device_iterator_test . py <nl> ppp b / tensorflow / python / data / kernel_tests / multi_device_iterator_test . py <nl> def testNotFullyDivisible ( self ) : <nl> sess . run ( elem_on_1 ) <nl> sess . run ( elem_on_2 ) <nl> <nl> + def testGetNextAsOptional ( self ) : <nl> + dataset = dataset_ops . Dataset . range ( 9 ) <nl> + multi_device_iterator = multi_device_iterator_ops . MultiDeviceIterator ( <nl> + dataset , [ " / cpu : 1 " , " / cpu : 2 " ] ) <nl> + elem_on_1 , elem_on_2 = multi_device_iterator . get_next_as_optional ( ) <nl> + elem_on_1_has_value_t = elem_on_1 . has_value ( ) <nl> + elem_on_1_t = elem_on_1 . get_value ( ) <nl> + elem_on_2_has_value_t = elem_on_2 . has_value ( ) <nl> + elem_on_2_t = elem_on_2 . get_value ( ) <nl> + <nl> + config = config_pb2 . ConfigProto ( device_count = { " CPU " : 3 } ) <nl> + with self . test_session ( config = config ) as sess : <nl> + sess . run ( multi_device_iterator . initializer ) <nl> + for i in range ( 0 , 8 , 2 ) : <nl> + elem_on_1_has_value , elem_on_1_value = sess . run ( <nl> + [ elem_on_1_has_value_t , elem_on_1_t ] ) <nl> + self . assertTrue ( elem_on_1_has_value ) <nl> + self . assertEqual ( i , elem_on_1_value ) <nl> + elem_on_2_has_value , elem_on_2_value = sess . run ( <nl> + [ elem_on_2_has_value_t , elem_on_2_t ] ) <nl> + self . assertTrue ( elem_on_2_has_value ) <nl> + self . assertEqual ( i + 1 , elem_on_2_value ) <nl> + elem_on_1_has_value , elem_on_1_value = sess . run ( <nl> + [ elem_on_1_has_value_t , elem_on_1_t ] ) <nl> + self . assertTrue ( elem_on_1_has_value ) <nl> + self . assertEqual ( 8 , elem_on_1_value ) <nl> + self . assertFalse ( sess . run ( elem_on_1_has_value_t ) ) <nl> + self . assertFalse ( sess . run ( elem_on_2_has_value_t ) ) <nl> + with self . assertRaises ( errors . InvalidArgumentError ) : <nl> + sess . run ( elem_on_1_t ) <nl> + with self . assertRaises ( errors . InvalidArgumentError ) : <nl> + sess . run ( elem_on_2_t ) <nl> + <nl> def testUneven ( self ) : <nl> dataset = dataset_ops . Dataset . range ( 10 ) <nl> multi_device_iterator = multi_device_iterator_ops . MultiDeviceIterator ( <nl> def testUnevenGpu ( self ) : <nl> sess . run ( elem_on_1 ) <nl> sess . run ( elem_on_2 ) <nl> <nl> + def testGetNextAsOptionalGpu ( self ) : <nl> + if not test_util . is_gpu_available ( ) : <nl> + self . skipTest ( " No GPU available " ) <nl> + <nl> + dataset = dataset_ops . Dataset . range ( 9 ) <nl> + multi_device_iterator = multi_device_iterator_ops . MultiDeviceIterator ( <nl> + dataset , [ " / cpu : 1 " , " / gpu : 0 " ] ) <nl> + elem_on_1 , elem_on_2 = multi_device_iterator . get_next_as_optional ( ) <nl> + elem_on_1_has_value_t = elem_on_1 . has_value ( ) <nl> + elem_on_1_t = elem_on_1 . get_value ( ) <nl> + elem_on_2_has_value_t = elem_on_2 . has_value ( ) <nl> + elem_on_2_t = elem_on_2 . get_value ( ) <nl> + <nl> + config = config_pb2 . ConfigProto ( device_count = { " CPU " : 2 , " GPU " : 1 } ) <nl> + with self . test_session ( config = config ) as sess : <nl> + sess . run ( multi_device_iterator . initializer ) <nl> + for i in range ( 0 , 8 , 2 ) : <nl> + elem_on_1_has_value , elem_on_1_value = sess . run ( <nl> + [ elem_on_1_has_value_t , elem_on_1_t ] ) <nl> + self . assertTrue ( elem_on_1_has_value ) <nl> + self . assertEqual ( i , elem_on_1_value ) <nl> + elem_on_2_has_value , elem_on_2_value = sess . run ( <nl> + [ elem_on_2_has_value_t , elem_on_2_t ] ) <nl> + self . assertTrue ( elem_on_2_has_value ) <nl> + self . assertEqual ( i + 1 , elem_on_2_value ) <nl> + elem_on_1_has_value , elem_on_1_value = sess . run ( <nl> + [ elem_on_1_has_value_t , elem_on_1_t ] ) <nl> + self . assertTrue ( elem_on_1_has_value ) <nl> + self . assertEqual ( 8 , elem_on_1_value ) <nl> + self . assertFalse ( sess . run ( elem_on_1_has_value_t ) ) <nl> + self . assertFalse ( sess . run ( elem_on_2_has_value_t ) ) <nl> + with self . assertRaises ( errors . InvalidArgumentError ) : <nl> + sess . run ( elem_on_1_t ) <nl> + with self . assertRaises ( errors . InvalidArgumentError ) : <nl> + sess . run ( elem_on_2_t ) <nl> + <nl> <nl> if __name__ = = " __main__ " : <nl> test . main ( ) <nl> mmm a / tensorflow / python / data / ops / BUILD <nl> ppp b / tensorflow / python / data / ops / BUILD <nl> py_library ( <nl> srcs_version = " PY2AND3 " , <nl> deps = [ <nl> " : dataset_ops " , <nl> + " : iterator_ops " , <nl> " / / tensorflow / python : array_ops " , <nl> " / / tensorflow / python : control_flow_ops " , <nl> " / / tensorflow / python : dataset_ops_gen " , <nl> mmm a / tensorflow / python / data / ops / multi_device_iterator_ops . py <nl> ppp b / tensorflow / python / data / ops / multi_device_iterator_ops . py <nl> <nl> from __future__ import print_function <nl> <nl> from tensorflow . python . data . ops import dataset_ops <nl> + from tensorflow . python . data . ops import iterator_ops <nl> from tensorflow . python . data . util import nest <nl> from tensorflow . python . data . util import sparse <nl> from tensorflow . python . eager import context <nl> def get_next ( self ) : <nl> i + = 1 <nl> return result <nl> <nl> + def get_next_as_optional ( self ) : <nl> + result = [ ] <nl> + i = 0 <nl> + for device in self . _devices : <nl> + with ops . device ( device ) : <nl> + result . append ( iterator_ops . get_next_as_optional ( <nl> + self . _device_iterators [ i ] ) ) <nl> + i + = 1 <nl> + return result <nl> + <nl> @ property <nl> def initializer ( self ) : <nl> return self . _initializer <nl>
|
Adding GetNextAsOptional support for MultiDeviceIterator
|
tensorflow/tensorflow
|
2acbbe480b1de8f1bc4936d272333fd812382198
|
2018-10-16T18:24:25Z
|
mmm a / . gitignore <nl> ppp b / . gitignore <nl> js / testproto_libs2 . js <nl> ruby / lib / <nl> ruby / tests / generated_code_pb . rb <nl> ruby / tests / test_import_pb . rb <nl> + ruby / tests / test_ruby_package_pb . rb <nl> ruby / Gemfile . lock <nl> ruby / compatibility_tests / v3 . 0 . 0 / protoc <nl> ruby / compatibility_tests / v3 . 0 . 0 / tests / generated_code_pb . rb <nl> mmm a / Makefile . am <nl> ppp b / Makefile . am <nl> php_EXTRA_DIST = \ <nl> php / src / Google / Protobuf / Field . php \ <nl> php / src / Google / Protobuf / FieldDescriptor . php \ <nl> php / src / Google / Protobuf / FieldMask . php \ <nl> + php / src / Google / Protobuf / Field / Cardinality . php \ <nl> php / src / Google / Protobuf / Field_Cardinality . php \ <nl> + php / src / Google / Protobuf / Field / Kind . php \ <nl> php / src / Google / Protobuf / Field_Kind . php \ <nl> php / src / Google / Protobuf / FloatValue . php \ <nl> php / src / Google / Protobuf / GPBEmpty . php \ <nl> php_EXTRA_DIST = \ <nl> php / src / Google / Protobuf / Internal / Descriptor . php \ <nl> php / src / Google / Protobuf / Internal / DescriptorPool . php \ <nl> php / src / Google / Protobuf / Internal / DescriptorProto . php \ <nl> - php / src / Google / Protobuf / Internal / DescriptorProto_ExtensionRange . php \ <nl> - php / src / Google / Protobuf / Internal / DescriptorProto_ReservedRange . php \ <nl> + php / src / Google / Protobuf / Internal / DescriptorProto / ExtensionRange . php \ <nl> + php / src / Google / Protobuf / Internal / DescriptorProto / ReservedRange . php \ <nl> php / src / Google / Protobuf / Internal / EnumBuilderContext . php \ <nl> php / src / Google / Protobuf / Internal / EnumDescriptor . php \ <nl> php / src / Google / Protobuf / Internal / EnumDescriptorProto . php \ <nl> - php / src / Google / Protobuf / Internal / EnumDescriptorProto_EnumReservedRange . php \ <nl> + php / src / Google / Protobuf / Internal / EnumDescriptorProto / EnumReservedRange . php \ <nl> php / src / Google / Protobuf / Internal / EnumOptions . php \ <nl> php / src / Google / Protobuf / Internal / EnumValueDescriptorProto . php \ <nl> php / src / Google / Protobuf / Internal / EnumValueOptions . php \ <nl> php / src / Google / Protobuf / Internal / ExtensionRangeOptions . php \ <nl> - php / src / Google / Protobuf / Internal / FieldDescriptorProto_Label . php \ <nl> php / src / Google / Protobuf / Internal / FieldDescriptorProto . php \ <nl> php / src / Google / Protobuf / Internal / FieldDescriptor . php \ <nl> php / src / Google / Protobuf / Internal / FieldDescriptorProto . php \ <nl> - php / src / Google / Protobuf / Internal / FieldDescriptorProto_Label . php \ <nl> - php / src / Google / Protobuf / Internal / FieldDescriptorProto_Type . php \ <nl> + php / src / Google / Protobuf / Internal / FieldDescriptorProto / Label . php \ <nl> + php / src / Google / Protobuf / Internal / FieldDescriptorProto / Type . php \ <nl> php / src / Google / Protobuf / Internal / FieldOptions . php \ <nl> - php / src / Google / Protobuf / Internal / FieldOptions_CType . php \ <nl> - php / src / Google / Protobuf / Internal / FieldOptions_JSType . php \ <nl> + php / src / Google / Protobuf / Internal / FieldOptions / CType . php \ <nl> + php / src / Google / Protobuf / Internal / FieldOptions / JSType . php \ <nl> php / src / Google / Protobuf / Internal / FileDescriptor . php \ <nl> php / src / Google / Protobuf / Internal / FileDescriptorProto . php \ <nl> php / src / Google / Protobuf / Internal / FileDescriptorSet . php \ <nl> php / src / Google / Protobuf / Internal / FileOptions . php \ <nl> - php / src / Google / Protobuf / Internal / FileOptions_OptimizeMode . php \ <nl> + php / src / Google / Protobuf / Internal / FileOptions / OptimizeMode . php \ <nl> php / src / Google / Protobuf / Internal / GPBDecodeException . php \ <nl> php / src / Google / Protobuf / Internal / GPBJsonWire . php \ <nl> php / src / Google / Protobuf / Internal / GPBLabel . php \ <nl> php_EXTRA_DIST = \ <nl> php / src / Google / Protobuf / Internal / GPBWire . php \ <nl> php / src / Google / Protobuf / Internal / GPBWireType . php \ <nl> php / src / Google / Protobuf / Internal / GeneratedCodeInfo . php \ <nl> - php / src / Google / Protobuf / Internal / GeneratedCodeInfo_Annotation . php \ <nl> + php / src / Google / Protobuf / Internal / GeneratedCodeInfo / Annotation . php \ <nl> php / src / Google / Protobuf / Internal / GetPublicDescriptorTrait . php \ <nl> php / src / Google / Protobuf / Internal / HasPublicDescriptorTrait . php \ <nl> php / src / Google / Protobuf / Internal / MapEntry . php \ <nl> php_EXTRA_DIST = \ <nl> php / src / Google / Protobuf / Internal / MessageOptions . php \ <nl> php / src / Google / Protobuf / Internal / MethodDescriptorProto . php \ <nl> php / src / Google / Protobuf / Internal / MethodOptions . php \ <nl> - php / src / Google / Protobuf / Internal / MethodOptions_IdempotencyLevel . php \ <nl> + php / src / Google / Protobuf / Internal / MethodOptions / IdempotencyLevel . php \ <nl> php / src / Google / Protobuf / Internal / OneofDescriptor . php \ <nl> php / src / Google / Protobuf / Internal / OneofDescriptorProto . php \ <nl> php / src / Google / Protobuf / Internal / OneofField . php \ <nl> php_EXTRA_DIST = \ <nl> php / src / Google / Protobuf / Internal / ServiceDescriptorProto . php \ <nl> php / src / Google / Protobuf / Internal / ServiceOptions . php \ <nl> php / src / Google / Protobuf / Internal / SourceCodeInfo . php \ <nl> - php / src / Google / Protobuf / Internal / SourceCodeInfo_Location . php \ <nl> + php / src / Google / Protobuf / Internal / SourceCodeInfo / Location . php \ <nl> php / src / Google / Protobuf / Internal / UninterpretedOption . php \ <nl> - php / src / Google / Protobuf / Internal / UninterpretedOption_NamePart . php \ <nl> + php / src / Google / Protobuf / Internal / UninterpretedOption / NamePart . php \ <nl> php / src / Google / Protobuf / ListValue . php \ <nl> php / src / Google / Protobuf / Method . php \ <nl> php / src / Google / Protobuf / Mixin . php \ <nl> php_EXTRA_DIST = \ <nl> php / tests / map_field_test . php \ <nl> php / tests / memory_leak_test . php \ <nl> php / tests / php_implementation_test . php \ <nl> + php / tests / proto / empty / echo . proto \ <nl> php / tests / proto / test . proto \ <nl> php / tests / proto / test_descriptors . proto \ <nl> php / tests / proto / test_empty_php_namespace . proto \ <nl> ruby_EXTRA_DIST = \ <nl> ruby / tests / stress . rb \ <nl> ruby / tests / generated_code . proto \ <nl> ruby / tests / test_import . proto \ <nl> + ruby / tests / test_ruby_package . proto \ <nl> ruby / tests / generated_code_test . rb \ <nl> ruby / tests / well_known_types_test . rb \ <nl> ruby / travis - test . sh <nl> mmm a / php / ext / google / protobuf / def . c <nl> ppp b / php / ext / google / protobuf / def . c <nl> PHP_METHOD ( InternalDescriptorPool , getGeneratedPool ) { <nl> # endif <nl> } <nl> <nl> - static void classname_no_prefix ( const char * fullname , const char * package_name , <nl> - char * class_name ) { <nl> - size_t i = 0 , j ; <nl> - bool first_char = true , is_reserved = false ; <nl> - size_t pkg_name_len = package_name = = NULL ? 0 : strlen ( package_name ) ; <nl> - size_t message_name_start = package_name = = NULL ? 0 : pkg_name_len + 1 ; <nl> - size_t message_len = ( strlen ( fullname ) - message_name_start ) ; <nl> + static size_t classname_len_max ( const char * fullname , <nl> + const char * package , <nl> + const char * php_namespace , <nl> + const char * prefix ) { <nl> + size_t fullname_len = strlen ( fullname ) ; <nl> + size_t package_len = 0 ; <nl> + size_t prefix_len = 0 ; <nl> + size_t namespace_len = 0 ; <nl> + size_t length = fullname_len ; <nl> + int i , segment , classname_start = 0 ; <nl> + <nl> + if ( package ! = NULL ) { <nl> + package_len = strlen ( package ) ; <nl> + } <nl> + if ( prefix ! = NULL ) { <nl> + prefix_len = strlen ( prefix ) ; <nl> + } <nl> + if ( php_namespace ! = NULL ) { <nl> + namespace_len = strlen ( php_namespace ) ; <nl> + } <nl> <nl> - / / Submessage is concatenated with its containing messages by ' _ ' . <nl> - for ( j = message_name_start ; j < message_name_start + message_len ; j + + ) { <nl> - if ( fullname [ j ] = = ' . ' ) { <nl> - class_name [ i + + ] = ' _ ' ; <nl> - } else { <nl> - class_name [ i + + ] = fullname [ j ] ; <nl> + / / Process package <nl> + if ( package_len > 0 ) { <nl> + segment = 1 ; <nl> + for ( i = 0 ; i < package_len ; i + + ) { <nl> + if ( package [ i ] = = ' . ' ) { <nl> + segment + + ; <nl> + } <nl> } <nl> - } <nl> - } <nl> + / / In case of reserved name in package . <nl> + length + = 3 * segment ; <nl> <nl> - static const char * classname_prefix ( const char * classname , <nl> - const char * prefix_given , <nl> - const char * package_name ) { <nl> - size_t i ; <nl> - bool is_reserved = false ; <nl> + classname_start = package_len + 1 ; <nl> + } <nl> <nl> - if ( prefix_given ! = NULL & & strcmp ( prefix_given , " " ) ! = 0 ) { <nl> - return prefix_given ; <nl> + / / Process class name <nl> + segment = 1 ; <nl> + for ( i = classname_start ; i < fullname_len ; i + + ) { <nl> + if ( fullname [ i ] = = ' . ' ) { <nl> + segment + + ; <nl> + } <nl> + } <nl> + if ( prefix_len = = 0 ) { <nl> + length + = 3 * segment ; <nl> + } else { <nl> + length + = prefix_len * segment ; <nl> } <nl> <nl> - char * lower = ALLOC_N ( char , strlen ( classname ) + 1 ) ; <nl> - i = 0 ; <nl> - while ( classname [ i ] ) { <nl> - lower [ i ] = ( char ) tolower ( classname [ i ] ) ; <nl> + / / The additional 2 , one is for preceding ' . ' and the other is for trailing 0 . <nl> + return length + namespace_len + 2 ; <nl> + } <nl> + <nl> + static bool is_reserved ( const char * segment , int length ) { <nl> + bool result ; <nl> + char * lower = ALLOC_N ( char , length + 1 ) ; <nl> + memcpy ( lower , segment , length ) ; <nl> + int i = 0 ; <nl> + while ( lower [ i ] ) { <nl> + lower [ i ] = ( char ) tolower ( lower [ i ] ) ; <nl> i + + ; <nl> } <nl> - lower [ i ] = 0 ; <nl> - <nl> - is_reserved = is_reserved_name ( lower ) ; <nl> + lower [ length ] = 0 ; <nl> + result = is_reserved_name ( lower ) ; <nl> FREE ( lower ) ; <nl> + return result ; <nl> + } <nl> <nl> - if ( is_reserved ) { <nl> - if ( package_name ! = NULL & & strcmp ( " google . protobuf " , package_name ) = = 0 ) { <nl> - return " GPB " ; <nl> - } else { <nl> - return " PB " ; <nl> + static char * fill_prefix ( const char * segment , int length , <nl> + const char * prefix_given , <nl> + const char * package_name , char * classname ) { <nl> + size_t i ; <nl> + <nl> + if ( prefix_given ! = NULL & & strcmp ( prefix_given , " " ) ! = 0 ) { <nl> + size_t prefix_len = strlen ( prefix_given ) ; <nl> + memcpy ( classname , prefix_given , strlen ( prefix_given ) ) ; <nl> + classname + = prefix_len ; <nl> + } else { <nl> + if ( is_reserved ( segment , length ) ) { <nl> + if ( package_name ! = NULL & & <nl> + strcmp ( " google . protobuf " , package_name ) = = 0 ) { <nl> + memcpy ( classname , " GPB " , 3 ) ; <nl> + classname + = 3 ; <nl> + } else { <nl> + memcpy ( classname , " PB " , 2 ) ; <nl> + classname + = 2 ; <nl> + } <nl> } <nl> } <nl> + return classname ; <nl> + } <nl> <nl> - return " " ; <nl> + static char * fill_segment ( const char * segment , int length , <nl> + char * classname , bool use_camel ) { <nl> + memcpy ( classname , segment , length ) ; <nl> + if ( use_camel & & ( segment [ 0 ] < ' A ' | | segment [ 0 ] > ' Z ' ) ) { <nl> + classname [ 0 ] + = ' A ' - ' a ' ; <nl> + } <nl> + return classname + length ; <nl> } <nl> <nl> - static void convert_to_class_name_inplace ( const char * package , <nl> - const char * namespace_given , <nl> - const char * prefix , char * classname ) { <nl> - size_t prefix_len = prefix = = NULL ? 0 : strlen ( prefix ) ; <nl> - size_t classname_len = strlen ( classname ) ; <nl> - int i = 0 , j ; <nl> - bool first_char = true ; <nl> + static char * fill_namespace ( const char * package , const char * namespace_given , <nl> + char * classname ) { <nl> + if ( namespace_given ! = NULL ) { <nl> + size_t namespace_len = strlen ( namespace_given ) ; <nl> + memcpy ( classname , namespace_given , namespace_len ) ; <nl> + classname + = namespace_len ; <nl> + * classname = ' \ \ ' ; <nl> + classname + + ; <nl> + } else if ( package ! = NULL ) { <nl> + int i = 0 , j , offset = 0 ; <nl> + size_t package_len = strlen ( package ) ; <nl> + while ( i < package_len ) { <nl> + j = i ; <nl> + while ( j < package_len & & package [ j ] ! = ' . ' ) { <nl> + j + + ; <nl> + } <nl> + classname = fill_prefix ( package + i , j - i , " " , package , classname ) ; <nl> + classname = fill_segment ( package + i , j - i , classname , true ) ; <nl> + classname [ 0 ] = ' \ \ ' ; <nl> + classname + + ; <nl> + i = j + 1 ; <nl> + } <nl> + } <nl> + return classname ; <nl> + } <nl> <nl> - size_t package_len = package = = NULL ? 0 : strlen ( package ) ; <nl> - size_t namespace_given_len = <nl> - namespace_given = = NULL ? 0 : strlen ( namespace_given ) ; <nl> - bool use_namespace_given = namespace_given ! = NULL ; <nl> - size_t namespace_len = <nl> - use_namespace_given ? namespace_given_len : package_len ; <nl> + static char * fill_classname ( const char * fullname , <nl> + const char * package , <nl> + const char * namespace_given , <nl> + const char * prefix , char * classname ) { <nl> + int classname_start = 0 ; <nl> + if ( package ! = NULL ) { <nl> + size_t package_len = strlen ( package ) ; <nl> + classname_start = package_len = = 0 ? 0 : package_len + 1 ; <nl> + } <nl> + size_t fullname_len = strlen ( fullname ) ; <nl> + classname = fill_prefix ( fullname + classname_start , <nl> + fullname_len - classname_start , <nl> + prefix , package , classname ) ; <nl> + <nl> + int i = classname_start , j ; <nl> + while ( i < fullname_len ) { <nl> + j = i ; <nl> + while ( j < fullname_len & & fullname [ j ] ! = ' . ' ) { <nl> + j + + ; <nl> + } <nl> + classname = fill_segment ( fullname + i , j - i , classname , false ) ; <nl> + if ( j ! = fullname_len ) { <nl> + * classname = ' _ ' ; <nl> + classname + + ; <nl> + } <nl> + i = j + 1 ; <nl> + } <nl> + return classname ; <nl> + } <nl> <nl> - int offset = namespace_len ! = 0 ? 2 : 0 ; <nl> + static char * fill_qualified_classname ( const char * fullname , <nl> + const char * package , <nl> + const char * namespace_given , <nl> + const char * prefix , char * classname ) { <nl> + classname = fill_namespace ( package , namespace_given , classname ) ; <nl> + return fill_classname ( fullname , package , namespace_given , prefix , classname ) ; <nl> + } <nl> <nl> - for ( j = 0 ; j < classname_len ; j + + ) { <nl> - classname [ namespace_len + prefix_len + classname_len + offset - 1 - j ] = <nl> - classname [ classname_len - j - 1 ] ; <nl> - } <nl> + static void classname_no_prefix ( const char * fullname , const char * package_name , <nl> + char * class_name ) { <nl> + size_t i = 0 , j ; <nl> + bool first_char = true , is_reserved = false ; <nl> + size_t pkg_name_len = package_name = = NULL ? 0 : strlen ( package_name ) ; <nl> + size_t message_name_start = package_name = = NULL ? 0 : pkg_name_len + 1 ; <nl> + size_t message_len = ( strlen ( fullname ) - message_name_start ) ; <nl> <nl> - if ( namespace_len ! = 0 ) { <nl> - classname [ i + + ] = ' \ \ ' ; <nl> - for ( j = 0 ; j < namespace_len ; j + + ) { <nl> - if ( use_namespace_given ) { <nl> - classname [ i + + ] = namespace_given [ j ] ; <nl> - continue ; <nl> - } <nl> - / / php packages are divided by ' \ ' . <nl> - if ( package [ j ] = = ' . ' ) { <nl> - classname [ i + + ] = ' \ \ ' ; <nl> - first_char = true ; <nl> - } else if ( first_char ) { <nl> - / / PHP package uses camel case . <nl> - if ( package [ j ] < ' A ' | | package [ j ] > ' Z ' ) { <nl> - classname [ i + + ] = package [ j ] + ' A ' - ' a ' ; <nl> - } else { <nl> - classname [ i + + ] = package [ j ] ; <nl> - } <nl> - first_char = false ; <nl> - } else { <nl> - classname [ i + + ] = package [ j ] ; <nl> - } <nl> + / / Submessage is concatenated with its containing messages by ' _ ' . <nl> + for ( j = message_name_start ; j < message_name_start + message_len ; j + + ) { <nl> + if ( fullname [ j ] = = ' . ' ) { <nl> + class_name [ i + + ] = ' _ ' ; <nl> + } else { <nl> + class_name [ i + + ] = fullname [ j ] ; <nl> } <nl> - classname [ i + + ] = ' \ \ ' ; <nl> } <nl> - <nl> - memcpy ( classname + i , prefix , prefix_len ) ; <nl> } <nl> <nl> void internal_add_generated_file ( const char * data , PHP_PROTO_SIZE data_len , <nl> void internal_add_generated_file ( const char * data , PHP_PROTO_SIZE data_len , <nl> * bytes allocated , one for ' . ' , one for trailing 0 , and 3 for ' GPB ' if \ <nl> * given message is google . protobuf . Empty . * / \ <nl> const char * fullname = upb_ # # def_type_lower # # _fullname ( def_type_lower ) ; \ <nl> + const char * package = upb_filedef_package ( files [ 0 ] ) ; \ <nl> const char * php_namespace = upb_filedef_phpnamespace ( files [ 0 ] ) ; \ <nl> const char * prefix_given = upb_filedef_phpprefix ( files [ 0 ] ) ; \ <nl> - size_t classname_len = strlen ( fullname ) + 5 ; \ <nl> - if ( prefix_given ! = NULL ) { \ <nl> - classname_len + = strlen ( prefix_given ) ; \ <nl> - } \ <nl> - if ( php_namespace ! = NULL ) { \ <nl> - classname_len + = strlen ( php_namespace ) ; \ <nl> - } \ <nl> + size_t classname_len = classname_len_max ( fullname , package , \ <nl> + php_namespace , prefix_given ) ; \ <nl> char * classname = ecalloc ( sizeof ( char ) , classname_len ) ; \ <nl> - const char * package = upb_filedef_package ( files [ 0 ] ) ; \ <nl> - classname_no_prefix ( fullname , package , classname ) ; \ <nl> - const char * prefix = classname_prefix ( classname , prefix_given , package ) ; \ <nl> - convert_to_class_name_inplace ( package , php_namespace , prefix , classname ) ; \ <nl> + fill_qualified_classname ( fullname , package , php_namespace , \ <nl> + prefix_given , classname ) ; \ <nl> PHP_PROTO_CE_DECLARE pce ; \ <nl> if ( php_proto_zend_lookup_class ( classname , strlen ( classname ) , & pce ) = = \ <nl> FAILURE ) { \ <nl> mmm a / php / ext / google / protobuf / message . c <nl> ppp b / php / ext / google / protobuf / message . c <nl> void build_class_from_descriptor ( <nl> / / PHP Methods <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> <nl> + void Message_construct ( zval * msg , zval * array_wrapper ) { <nl> + zend_class_entry * ce = Z_OBJCE_P ( msg ) ; <nl> + MessageHeader * intern = NULL ; <nl> + if ( EXPECTED ( class_added ( ce ) ) ) { <nl> + intern = UNBOX ( MessageHeader , msg ) ; <nl> + custom_data_init ( ce , intern PHP_PROTO_TSRMLS_CC ) ; <nl> + } <nl> + <nl> + if ( array_wrapper = = NULL ) { <nl> + return ; <nl> + } <nl> + <nl> + HashTable * array = Z_ARRVAL_P ( array_wrapper ) ; <nl> + HashPosition pointer ; <nl> + zval key ; <nl> + void * value ; <nl> + const upb_fielddef * field ; <nl> + <nl> + for ( zend_hash_internal_pointer_reset_ex ( array , & pointer ) ; <nl> + php_proto_zend_hash_get_current_data_ex ( array , ( void * * ) & value , <nl> + & pointer ) = = SUCCESS ; <nl> + zend_hash_move_forward_ex ( array , & pointer ) ) { <nl> + zend_hash_get_current_key_zval_ex ( array , & key , & pointer ) ; <nl> + field = upb_msgdef_ntofz ( intern - > descriptor - > msgdef , Z_STRVAL_P ( & key ) ) ; <nl> + if ( field = = NULL ) { <nl> + zend_error ( E_USER_ERROR , " Unknown field : % s " , Z_STRVAL_P ( & key ) ) ; <nl> + } <nl> + if ( upb_fielddef_ismap ( field ) ) { <nl> + PHP_PROTO_FAKE_SCOPE_BEGIN ( Z_OBJCE_P ( msg ) ) ; <nl> + zval * submap = message_get_property_internal ( msg , & key TSRMLS_CC ) ; <nl> + PHP_PROTO_FAKE_SCOPE_END ; <nl> + HashTable * subtable = HASH_OF ( <nl> + CACHED_PTR_TO_ZVAL_PTR ( ( CACHED_VALUE * ) value ) ) ; <nl> + HashPosition subpointer ; <nl> + zval subkey ; <nl> + void * memory ; <nl> + for ( zend_hash_internal_pointer_reset_ex ( subtable , & subpointer ) ; <nl> + php_proto_zend_hash_get_current_data_ex ( subtable , ( void * * ) & memory , <nl> + & subpointer ) = = SUCCESS ; <nl> + zend_hash_move_forward_ex ( subtable , & subpointer ) ) { <nl> + zend_hash_get_current_key_zval_ex ( subtable , & subkey , & subpointer ) ; <nl> + map_field_handlers - > write_dimension ( <nl> + submap , & subkey , <nl> + CACHED_PTR_TO_ZVAL_PTR ( ( CACHED_VALUE * ) memory ) TSRMLS_CC ) ; <nl> + zval_dtor ( & subkey ) ; <nl> + } <nl> + } else if ( upb_fielddef_isseq ( field ) ) { <nl> + PHP_PROTO_FAKE_SCOPE_BEGIN ( Z_OBJCE_P ( msg ) ) ; <nl> + zval * subarray = message_get_property_internal ( msg , & key TSRMLS_CC ) ; <nl> + PHP_PROTO_FAKE_SCOPE_END ; <nl> + HashTable * subtable = HASH_OF ( <nl> + CACHED_PTR_TO_ZVAL_PTR ( ( CACHED_VALUE * ) value ) ) ; <nl> + HashPosition subpointer ; <nl> + void * memory ; <nl> + for ( zend_hash_internal_pointer_reset_ex ( subtable , & subpointer ) ; <nl> + php_proto_zend_hash_get_current_data_ex ( subtable , ( void * * ) & memory , <nl> + & subpointer ) = = SUCCESS ; <nl> + zend_hash_move_forward_ex ( subtable , & subpointer ) ) { <nl> + repeated_field_handlers - > write_dimension ( <nl> + subarray , NULL , <nl> + CACHED_PTR_TO_ZVAL_PTR ( ( CACHED_VALUE * ) memory ) TSRMLS_CC ) ; <nl> + } <nl> + } else if ( upb_fielddef_issubmsg ( field ) ) { <nl> + const upb_msgdef * submsgdef = upb_fielddef_msgsubdef ( field ) ; <nl> + PHP_PROTO_HASHTABLE_VALUE desc_php = get_def_obj ( submsgdef ) ; <nl> + Descriptor * desc = UNBOX_HASHTABLE_VALUE ( Descriptor , desc_php ) ; <nl> + zend_property_info * property_info ; <nl> + PHP_PROTO_FAKE_SCOPE_BEGIN ( Z_OBJCE_P ( msg ) ) ; <nl> + # if PHP_MAJOR_VERSION < 7 <nl> + property_info = <nl> + zend_get_property_info ( Z_OBJCE_P ( msg ) , & key , true TSRMLS_CC ) ; <nl> + # else <nl> + property_info = <nl> + zend_get_property_info ( Z_OBJCE_P ( msg ) , Z_STR_P ( & key ) , true ) ; <nl> + # endif <nl> + PHP_PROTO_FAKE_SCOPE_END ; <nl> + CACHED_VALUE * cached = OBJ_PROP ( Z_OBJ_P ( msg ) , property_info - > offset ) ; <nl> + # if PHP_MAJOR_VERSION < 7 <nl> + SEPARATE_ZVAL_IF_NOT_REF ( cached ) ; <nl> + # endif <nl> + zval * submsg = CACHED_PTR_TO_ZVAL_PTR ( cached ) ; <nl> + ZVAL_OBJ ( submsg , desc - > klass - > create_object ( desc - > klass TSRMLS_CC ) ) ; <nl> + Message_construct ( submsg , NULL ) ; <nl> + MessageHeader * from = UNBOX ( MessageHeader , <nl> + CACHED_PTR_TO_ZVAL_PTR ( ( CACHED_VALUE * ) value ) ) ; <nl> + MessageHeader * to = UNBOX ( MessageHeader , submsg ) ; <nl> + if ( from - > descriptor ! = to - > descriptor ) { <nl> + zend_error ( E_USER_ERROR , " Cannot merge messages with different class . " ) ; <nl> + return ; <nl> + } <nl> + <nl> + layout_merge ( from - > descriptor - > layout , from , to TSRMLS_CC ) ; <nl> + } else { <nl> + message_set_property_internal ( msg , & key , <nl> + CACHED_PTR_TO_ZVAL_PTR ( ( CACHED_VALUE * ) value ) TSRMLS_CC ) ; <nl> + } <nl> + zval_dtor ( & key ) ; <nl> + } <nl> + } <nl> + <nl> / / At the first time the message is created , the class entry hasn ' t been <nl> / / modified . As a result , the first created instance will be a normal zend <nl> / / object . Here , we manually modify it to our message in such a case . <nl> PHP_METHOD ( Message , __construct ) { <nl> - zend_class_entry * ce = Z_OBJCE_P ( getThis ( ) ) ; <nl> - if ( EXPECTED ( class_added ( ce ) ) ) { <nl> - MessageHeader * intern = UNBOX ( MessageHeader , getThis ( ) ) ; <nl> - custom_data_init ( ce , intern PHP_PROTO_TSRMLS_CC ) ; <nl> + / / Init message with array <nl> + zval * array_wrapper = NULL ; <nl> + if ( zend_parse_parameters ( ZEND_NUM_ARGS ( ) TSRMLS_CC , <nl> + " | a ! " , & array_wrapper ) = = FAILURE ) { <nl> + return ; <nl> } <nl> + <nl> + Message_construct ( getThis ( ) , array_wrapper ) ; <nl> } <nl> <nl> PHP_METHOD ( Message , clear ) { <nl> static zend_function_entry field_cardinality_methods [ ] = { <nl> zend_class_entry * field_cardinality_type ; <nl> <nl> / / Init class entry . <nl> - PHP_PROTO_INIT_ENUMCLASS_START ( " Google \ \ Protobuf \ \ Field_Cardinality " , <nl> + PHP_PROTO_INIT_ENUMCLASS_START ( " Google \ \ Protobuf \ \ Field \ \ Cardinality " , <nl> Field_Cardinality , field_cardinality ) <nl> zend_declare_class_constant_long ( field_cardinality_type , <nl> " CARDINALITY_UNKNOWN " , 19 , 0 TSRMLS_CC ) ; <nl> PHP_PROTO_INIT_ENUMCLASS_START ( " Google \ \ Protobuf \ \ Field_Cardinality " , <nl> " CARDINALITY_REQUIRED " , 20 , 2 TSRMLS_CC ) ; <nl> zend_declare_class_constant_long ( field_cardinality_type , <nl> " CARDINALITY_REPEATED " , 20 , 3 TSRMLS_CC ) ; <nl> + const char * alias = " Google \ \ Protobuf \ \ Field_Cardinality " ; <nl> + zend_register_class_alias_ex ( alias , strlen ( alias ) , field_cardinality_type TSRMLS_CC ) ; <nl> PHP_PROTO_INIT_ENUMCLASS_END <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> static zend_function_entry field_kind_methods [ ] = { <nl> zend_class_entry * field_kind_type ; <nl> <nl> / / Init class entry . <nl> - PHP_PROTO_INIT_ENUMCLASS_START ( " Google \ \ Protobuf \ \ Field_Kind " , <nl> + PHP_PROTO_INIT_ENUMCLASS_START ( " Google \ \ Protobuf \ \ Field \ \ Kind " , <nl> Field_Kind , field_kind ) <nl> zend_declare_class_constant_long ( field_kind_type , <nl> " TYPE_UNKNOWN " , 12 , 0 TSRMLS_CC ) ; <nl> PHP_PROTO_INIT_ENUMCLASS_START ( " Google \ \ Protobuf \ \ Field_Kind " , <nl> " TYPE_SINT32 " , 11 , 17 TSRMLS_CC ) ; <nl> zend_declare_class_constant_long ( field_kind_type , <nl> " TYPE_SINT64 " , 11 , 18 TSRMLS_CC ) ; <nl> + const char * alias = " Google \ \ Protobuf \ \ Field_Kind " ; <nl> + zend_register_class_alias_ex ( alias , strlen ( alias ) , field_kind_type TSRMLS_CC ) ; <nl> PHP_PROTO_INIT_ENUMCLASS_END <nl> <nl> / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - - <nl> mmm a / php / src / GPBMetadata / Google / Protobuf / Internal / Descriptor . php <nl> ppp b / php / src / GPBMetadata / Google / Protobuf / Internal / Descriptor . php <nl> public static function initOnce ( ) { <nl> - > repeated ( ' reserved_name ' , \ Google \ Protobuf \ Internal \ GPBType : : STRING , 10 ) <nl> - > finalizeToPool ( ) ; <nl> <nl> - $ pool - > addMessage ( ' google . protobuf . internal . DescriptorProto . ExtensionRange ' , \ Google \ Protobuf \ Internal \ DescriptorProto_ExtensionRange : : class ) <nl> + $ pool - > addMessage ( ' google . protobuf . internal . DescriptorProto . ExtensionRange ' , \ Google \ Protobuf \ Internal \ DescriptorProto \ ExtensionRange : : class ) <nl> - > optional ( ' start ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 1 ) <nl> - > optional ( ' end ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 2 ) <nl> - > optional ( ' options ' , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , 3 , ' google . protobuf . internal . ExtensionRangeOptions ' ) <nl> - > finalizeToPool ( ) ; <nl> <nl> - $ pool - > addMessage ( ' google . protobuf . internal . DescriptorProto . ReservedRange ' , \ Google \ Protobuf \ Internal \ DescriptorProto_ReservedRange : : class ) <nl> + $ pool - > addMessage ( ' google . protobuf . internal . DescriptorProto . ReservedRange ' , \ Google \ Protobuf \ Internal \ DescriptorProto \ ReservedRange : : class ) <nl> - > optional ( ' start ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 1 ) <nl> - > optional ( ' end ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 2 ) <nl> - > finalizeToPool ( ) ; <nl> public static function initOnce ( ) { <nl> - > repeated ( ' reserved_name ' , \ Google \ Protobuf \ Internal \ GPBType : : STRING , 5 ) <nl> - > finalizeToPool ( ) ; <nl> <nl> - $ pool - > addMessage ( ' google . protobuf . internal . EnumDescriptorProto . EnumReservedRange ' , \ Google \ Protobuf \ Internal \ EnumDescriptorProto_EnumReservedRange : : class ) <nl> + $ pool - > addMessage ( ' google . protobuf . internal . EnumDescriptorProto . EnumReservedRange ' , \ Google \ Protobuf \ Internal \ EnumDescriptorProto \ EnumReservedRange : : class ) <nl> - > optional ( ' start ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 1 ) <nl> - > optional ( ' end ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 2 ) <nl> - > finalizeToPool ( ) ; <nl> public static function initOnce ( ) { <nl> - > optional ( ' aggregate_value ' , \ Google \ Protobuf \ Internal \ GPBType : : STRING , 8 ) <nl> - > finalizeToPool ( ) ; <nl> <nl> - $ pool - > addMessage ( ' google . protobuf . internal . UninterpretedOption . NamePart ' , \ Google \ Protobuf \ Internal \ UninterpretedOption_NamePart : : class ) <nl> + $ pool - > addMessage ( ' google . protobuf . internal . UninterpretedOption . NamePart ' , \ Google \ Protobuf \ Internal \ UninterpretedOption \ NamePart : : class ) <nl> - > required ( ' name_part ' , \ Google \ Protobuf \ Internal \ GPBType : : STRING , 1 ) <nl> - > required ( ' is_extension ' , \ Google \ Protobuf \ Internal \ GPBType : : BOOL , 2 ) <nl> - > finalizeToPool ( ) ; <nl> public static function initOnce ( ) { <nl> - > repeated ( ' location ' , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , 1 , ' google . protobuf . internal . SourceCodeInfo . Location ' ) <nl> - > finalizeToPool ( ) ; <nl> <nl> - $ pool - > addMessage ( ' google . protobuf . internal . SourceCodeInfo . Location ' , \ Google \ Protobuf \ Internal \ SourceCodeInfo_Location : : class ) <nl> + $ pool - > addMessage ( ' google . protobuf . internal . SourceCodeInfo . Location ' , \ Google \ Protobuf \ Internal \ SourceCodeInfo \ Location : : class ) <nl> - > repeated ( ' path ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 1 ) <nl> - > repeated ( ' span ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 2 ) <nl> - > optional ( ' leading_comments ' , \ Google \ Protobuf \ Internal \ GPBType : : STRING , 3 ) <nl> public static function initOnce ( ) { <nl> - > repeated ( ' annotation ' , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , 1 , ' google . protobuf . internal . GeneratedCodeInfo . Annotation ' ) <nl> - > finalizeToPool ( ) ; <nl> <nl> - $ pool - > addMessage ( ' google . protobuf . internal . GeneratedCodeInfo . Annotation ' , \ Google \ Protobuf \ Internal \ GeneratedCodeInfo_Annotation : : class ) <nl> + $ pool - > addMessage ( ' google . protobuf . internal . GeneratedCodeInfo . Annotation ' , \ Google \ Protobuf \ Internal \ GeneratedCodeInfo \ Annotation : : class ) <nl> - > repeated ( ' path ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 1 ) <nl> - > optional ( ' source_file ' , \ Google \ Protobuf \ Internal \ GPBType : : STRING , 2 ) <nl> - > optional ( ' begin ' , \ Google \ Protobuf \ Internal \ GPBType : : INT32 , 3 ) <nl> mmm a / php / src / Google / Protobuf / Any . php <nl> ppp b / php / src / Google / Protobuf / Any . php <nl> <nl> namespace Google \ Protobuf ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> - use Google \ Protobuf \ Internal \ GPBUtil ; <nl> use Google \ Protobuf \ Internal \ Message ; <nl> use Google \ Protobuf \ Internal \ RepeatedField ; <nl> + use Google \ Protobuf \ Internal \ GPBUtil ; <nl> <nl> / * * <nl> * ` Any ` contains an arbitrary serialized protocol buffer message along with a <nl> <nl> * if any . Is ( Foo . DESCRIPTOR ) : <nl> * any . Unpack ( foo ) <nl> * . . . <nl> + * Example 4 : Pack and unpack a message in Go <nl> + * foo : = & pb . Foo { . . . } <nl> + * any , err : = ptypes . MarshalAny ( foo ) <nl> + * . . . <nl> + * foo : = & pb . Foo { } <nl> + * if err : = ptypes . UnmarshalAny ( any , foo ) ; err ! = nil { <nl> + * . . . <nl> + * } <nl> * The pack methods provided by protobuf library will by default use <nl> * ' type . googleapis . com / full . type . name ' as the type URL and the unpack <nl> * methods only use the fully qualified type name after the last ' / ' <nl> <nl> class Any extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> - * A URL / resource name whose content describes the type of the <nl> - * serialized protocol buffer message . <nl> - * For URLs which use the scheme ` http ` , ` https ` , or no scheme , the <nl> - * following restrictions and interpretations apply : <nl> + * A URL / resource name that uniquely identifies the type of the serialized <nl> + * protocol buffer message . The last segment of the URL ' s path must represent <nl> + * the fully qualified name of the type ( as in <nl> + * ` path / google . protobuf . Duration ` ) . The name should be in a canonical form <nl> + * ( e . g . , leading " . " is not accepted ) . <nl> + * In practice , teams usually precompile into the binary all types that they <nl> + * expect it to use in the context of Any . However , for URLs which use the <nl> + * scheme ` http ` , ` https ` , or no scheme , one can optionally set up a type <nl> + * server that maps type URLs to message definitions as follows : <nl> * * If no scheme is provided , ` https ` is assumed . <nl> - * * The last segment of the URL ' s path must represent the fully <nl> - * qualified name of the type ( as in ` path / google . protobuf . Duration ` ) . <nl> - * The name should be in a canonical form ( e . g . , leading " . " is <nl> - * not accepted ) . <nl> * * An HTTP GET on the URL must yield a [ google . protobuf . Type ] [ ] <nl> * value in binary format , or produce an error . <nl> * * Applications are allowed to cache lookup results based on the <nl> class Any extends \ Google \ Protobuf \ Internal \ Message <nl> * lookup . Therefore , binary compatibility needs to be preserved <nl> * on changes to types . ( Use versioned type names to manage <nl> * breaking changes . ) <nl> + * Note : this functionality is not currently available in the official <nl> + * protobuf release , and it is not used for type URLs beginning with <nl> + * type . googleapis . com . <nl> * Schemes other than ` http ` , ` https ` ( or the empty scheme ) might be <nl> * used with implementation specific semantics . <nl> * <nl> class Any extends \ Google \ Protobuf \ Internal \ Message <nl> <nl> const TYPE_URL_PREFIX = ' type . googleapis . com / ' ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ type_url <nl> + * A URL / resource name that uniquely identifies the type of the serialized <nl> + * protocol buffer message . The last segment of the URL ' s path must represent <nl> + * the fully qualified name of the type ( as in <nl> + * ` path / google . protobuf . Duration ` ) . The name should be in a canonical form <nl> + * ( e . g . , leading " . " is not accepted ) . <nl> + * In practice , teams usually precompile into the binary all types that they <nl> + * expect it to use in the context of Any . However , for URLs which use the <nl> + * scheme ` http ` , ` https ` , or no scheme , one can optionally set up a type <nl> + * server that maps type URLs to message definitions as follows : <nl> + * * If no scheme is provided , ` https ` is assumed . <nl> + * * An HTTP GET on the URL must yield a [ google . protobuf . Type ] [ ] <nl> + * value in binary format , or produce an error . <nl> + * * Applications are allowed to cache lookup results based on the <nl> + * URL , or have them precompiled into a binary to avoid any <nl> + * lookup . Therefore , binary compatibility needs to be preserved <nl> + * on changes to types . ( Use versioned type names to manage <nl> + * breaking changes . ) <nl> + * Note : this functionality is not currently available in the official <nl> + * protobuf release , and it is not used for type URLs beginning with <nl> + * type . googleapis . com . <nl> + * Schemes other than ` http ` , ` https ` ( or the empty scheme ) might be <nl> + * used with implementation specific semantics . <nl> + * @ type string $ value <nl> + * Must be a valid serialized protocol buffer of the above specified type . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Any : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> - * A URL / resource name whose content describes the type of the <nl> - * serialized protocol buffer message . <nl> - * For URLs which use the scheme ` http ` , ` https ` , or no scheme , the <nl> - * following restrictions and interpretations apply : <nl> + * A URL / resource name that uniquely identifies the type of the serialized <nl> + * protocol buffer message . The last segment of the URL ' s path must represent <nl> + * the fully qualified name of the type ( as in <nl> + * ` path / google . protobuf . Duration ` ) . The name should be in a canonical form <nl> + * ( e . g . , leading " . " is not accepted ) . <nl> + * In practice , teams usually precompile into the binary all types that they <nl> + * expect it to use in the context of Any . However , for URLs which use the <nl> + * scheme ` http ` , ` https ` , or no scheme , one can optionally set up a type <nl> + * server that maps type URLs to message definitions as follows : <nl> * * If no scheme is provided , ` https ` is assumed . <nl> - * * The last segment of the URL ' s path must represent the fully <nl> - * qualified name of the type ( as in ` path / google . protobuf . Duration ` ) . <nl> - * The name should be in a canonical form ( e . g . , leading " . " is <nl> - * not accepted ) . <nl> * * An HTTP GET on the URL must yield a [ google . protobuf . Type ] [ ] <nl> * value in binary format , or produce an error . <nl> * * Applications are allowed to cache lookup results based on the <nl> public function __construct ( ) { <nl> * lookup . Therefore , binary compatibility needs to be preserved <nl> * on changes to types . ( Use versioned type names to manage <nl> * breaking changes . ) <nl> + * Note : this functionality is not currently available in the official <nl> + * protobuf release , and it is not used for type URLs beginning with <nl> + * type . googleapis . com . <nl> * Schemes other than ` http ` , ` https ` ( or the empty scheme ) might be <nl> * used with implementation specific semantics . <nl> * <nl> public function getTypeUrl ( ) <nl> } <nl> <nl> / * * <nl> - * A URL / resource name whose content describes the type of the <nl> - * serialized protocol buffer message . <nl> - * For URLs which use the scheme ` http ` , ` https ` , or no scheme , the <nl> - * following restrictions and interpretations apply : <nl> + * A URL / resource name that uniquely identifies the type of the serialized <nl> + * protocol buffer message . The last segment of the URL ' s path must represent <nl> + * the fully qualified name of the type ( as in <nl> + * ` path / google . protobuf . Duration ` ) . The name should be in a canonical form <nl> + * ( e . g . , leading " . " is not accepted ) . <nl> + * In practice , teams usually precompile into the binary all types that they <nl> + * expect it to use in the context of Any . However , for URLs which use the <nl> + * scheme ` http ` , ` https ` , or no scheme , one can optionally set up a type <nl> + * server that maps type URLs to message definitions as follows : <nl> * * If no scheme is provided , ` https ` is assumed . <nl> - * * The last segment of the URL ' s path must represent the fully <nl> - * qualified name of the type ( as in ` path / google . protobuf . Duration ` ) . <nl> - * The name should be in a canonical form ( e . g . , leading " . " is <nl> - * not accepted ) . <nl> * * An HTTP GET on the URL must yield a [ google . protobuf . Type ] [ ] <nl> * value in binary format , or produce an error . <nl> * * Applications are allowed to cache lookup results based on the <nl> public function getTypeUrl ( ) <nl> * lookup . Therefore , binary compatibility needs to be preserved <nl> * on changes to types . ( Use versioned type names to manage <nl> * breaking changes . ) <nl> + * Note : this functionality is not currently available in the official <nl> + * protobuf release , and it is not used for type URLs beginning with <nl> + * type . googleapis . com . <nl> * Schemes other than ` http ` , ` https ` ( or the empty scheme ) might be <nl> * used with implementation specific semantics . <nl> * <nl> public function is ( $ klass ) <nl> return $ this - > type_url = = = $ type_url ; <nl> } <nl> } <nl> + <nl> mmm a / php / src / Google / Protobuf / Api . php <nl> ppp b / php / src / Google / Protobuf / Api . php <nl> class Api extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ syntax = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * The fully qualified name of this interface , including package name <nl> + * followed by the interface ' s simple name . <nl> + * @ type \ Google \ Protobuf \ Method [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ methods <nl> + * The methods of this interface , in unspecified order . <nl> + * @ type \ Google \ Protobuf \ Option [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ options <nl> + * Any metadata attached to the interface . <nl> + * @ type string $ version <nl> + * A version string for this interface . If specified , must have the form <nl> + * ` major - version . minor - version ` , as in ` 1 . 10 ` . If the minor version is <nl> + * omitted , it defaults to zero . If the entire version field is empty , the <nl> + * major version is derived from the package name , as outlined below . If the <nl> + * field is not empty , the version in the package name will be verified to be <nl> + * consistent with what is provided here . <nl> + * The versioning schema uses [ semantic <nl> + * versioning ] ( http : / / semver . org ) where the major version number <nl> + * indicates a breaking change and the minor version an additive , <nl> + * non - breaking change . Both version numbers are signals to users <nl> + * what to expect from different versions , and should be carefully <nl> + * chosen based on the product plan . <nl> + * The major version is also reflected in the package name of the <nl> + * interface , which must end in ` v < major - version > ` , as in <nl> + * ` google . feature . v1 ` . For major versions 0 and 1 , the suffix can <nl> + * be omitted . Zero major versions must only be used for <nl> + * experimental , non - GA interfaces . <nl> + * @ type \ Google \ Protobuf \ SourceContext $ source_context <nl> + * Source context for the protocol buffer service represented by this <nl> + * message . <nl> + * @ type \ Google \ Protobuf \ Mixin [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ mixins <nl> + * Included interfaces . See [ Mixin ] [ ] . <nl> + * @ type int $ syntax <nl> + * The source syntax of the service . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Api : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / BoolValue . php <nl> ppp b / php / src / Google / Protobuf / BoolValue . php <nl> class BoolValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type bool $ value <nl> + * The bool value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / BytesValue . php <nl> ppp b / php / src / Google / Protobuf / BytesValue . php <nl> class BytesValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = ' ' ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ value <nl> + * The bytes value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / DoubleValue . php <nl> ppp b / php / src / Google / Protobuf / DoubleValue . php <nl> class DoubleValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = 0 . 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type float $ value <nl> + * The double value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Duration . php <nl> ppp b / php / src / Google / Protobuf / Duration . php <nl> class Duration extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ nanos = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int | string $ seconds <nl> + * Signed seconds of the span of time . Must be from - 315 , 576 , 000 , 000 <nl> + * to + 315 , 576 , 000 , 000 inclusive . Note : these bounds are computed from : <nl> + * 60 sec / min * 60 min / hr * 24 hr / day * 365 . 25 days / year * 10000 years <nl> + * @ type int $ nanos <nl> + * Signed fractions of a second at nanosecond resolution of the span <nl> + * of time . Durations less than one second are represented with a 0 <nl> + * ` seconds ` field and a positive or negative ` nanos ` field . For durations <nl> + * of one second or more , a non - zero value for the ` nanos ` field must be <nl> + * of the same sign as the ` seconds ` field . Must be from - 999 , 999 , 999 <nl> + * to + 999 , 999 , 999 inclusive . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Duration : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function setNanos ( $ var ) <nl> <nl> return $ this ; <nl> } <nl> + <nl> } <nl> <nl> mmm a / php / src / Google / Protobuf / Enum . php <nl> ppp b / php / src / Google / Protobuf / Enum . php <nl> class Enum extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ syntax = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * Enum type name . <nl> + * @ type \ Google \ Protobuf \ EnumValue [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ enumvalue <nl> + * Enum value definitions . <nl> + * @ type \ Google \ Protobuf \ Option [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ options <nl> + * Protocol buffer options . <nl> + * @ type \ Google \ Protobuf \ SourceContext $ source_context <nl> + * The source context . <nl> + * @ type int $ syntax <nl> + * The source syntax . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Type : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / EnumValue . php <nl> ppp b / php / src / Google / Protobuf / EnumValue . php <nl> class EnumValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ options ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * Enum value name . <nl> + * @ type int $ number <nl> + * Enum value number . <nl> + * @ type \ Google \ Protobuf \ Option [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ options <nl> + * Protocol buffer options . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Type : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Field . php <nl> ppp b / php / src / Google / Protobuf / Field . php <nl> class Field extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ default_value = ' ' ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ kind <nl> + * The field type . <nl> + * @ type int $ cardinality <nl> + * The field cardinality . <nl> + * @ type int $ number <nl> + * The field number . <nl> + * @ type string $ name <nl> + * The field name . <nl> + * @ type string $ type_url <nl> + * The field type URL , without the scheme , for message or enumeration <nl> + * types . Example : ` " type . googleapis . com / google . protobuf . Timestamp " ` . <nl> + * @ type int $ oneof_index <nl> + * The index of the field type in ` Type . oneofs ` , for message or enumeration <nl> + * types . The first type has index 1 ; zero means the type is not in the list . <nl> + * @ type bool $ packed <nl> + * Whether to use alternative packed wire representation . <nl> + * @ type \ Google \ Protobuf \ Option [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ options <nl> + * The protocol buffer options . <nl> + * @ type string $ json_name <nl> + * The field JSON name . <nl> + * @ type string $ default_value <nl> + * The string value of the default value of this field . Proto2 syntax only . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Type : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> new file mode 100644 <nl> index 0000000000 . . c887f6d31d <nl> mmm / dev / null <nl> ppp b / php / src / Google / Protobuf / Field / Cardinality . php <nl> <nl> + < ? php <nl> + # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> + # source : google / protobuf / type . proto <nl> + <nl> + namespace Google \ Protobuf \ Field ; <nl> + <nl> + / * * <nl> + * Whether a field is optional , required , or repeated . <nl> + * <nl> + * Protobuf type < code > google . protobuf . Field . Cardinality < / code > <nl> + * / <nl> + class Cardinality <nl> + { <nl> + / * * <nl> + * For fields with unknown cardinality . <nl> + * <nl> + * Generated from protobuf enum < code > CARDINALITY_UNKNOWN = 0 ; < / code > <nl> + * / <nl> + const CARDINALITY_UNKNOWN = 0 ; <nl> + / * * <nl> + * For optional fields . <nl> + * <nl> + * Generated from protobuf enum < code > CARDINALITY_OPTIONAL = 1 ; < / code > <nl> + * / <nl> + const CARDINALITY_OPTIONAL = 1 ; <nl> + / * * <nl> + * For required fields . Proto2 syntax only . <nl> + * <nl> + * Generated from protobuf enum < code > CARDINALITY_REQUIRED = 2 ; < / code > <nl> + * / <nl> + const CARDINALITY_REQUIRED = 2 ; <nl> + / * * <nl> + * For repeated fields . <nl> + * <nl> + * Generated from protobuf enum < code > CARDINALITY_REPEATED = 3 ; < / code > <nl> + * / <nl> + const CARDINALITY_REPEATED = 3 ; <nl> + } <nl> + <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( Cardinality : : class , \ Google \ Protobuf \ Field_Cardinality : : class ) ; <nl> + <nl> new file mode 100644 <nl> index 0000000000 . . a2bbbdebbf <nl> mmm / dev / null <nl> ppp b / php / src / Google / Protobuf / Field / Kind . php <nl> <nl> + < ? php <nl> + # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> + # source : google / protobuf / type . proto <nl> + <nl> + namespace Google \ Protobuf \ Field ; <nl> + <nl> + / * * <nl> + * Basic field types . <nl> + * <nl> + * Protobuf type < code > google . protobuf . Field . Kind < / code > <nl> + * / <nl> + class Kind <nl> + { <nl> + / * * <nl> + * Field type unknown . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_UNKNOWN = 0 ; < / code > <nl> + * / <nl> + const TYPE_UNKNOWN = 0 ; <nl> + / * * <nl> + * Field type double . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_DOUBLE = 1 ; < / code > <nl> + * / <nl> + const TYPE_DOUBLE = 1 ; <nl> + / * * <nl> + * Field type float . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_FLOAT = 2 ; < / code > <nl> + * / <nl> + const TYPE_FLOAT = 2 ; <nl> + / * * <nl> + * Field type int64 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_INT64 = 3 ; < / code > <nl> + * / <nl> + const TYPE_INT64 = 3 ; <nl> + / * * <nl> + * Field type uint64 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_UINT64 = 4 ; < / code > <nl> + * / <nl> + const TYPE_UINT64 = 4 ; <nl> + / * * <nl> + * Field type int32 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_INT32 = 5 ; < / code > <nl> + * / <nl> + const TYPE_INT32 = 5 ; <nl> + / * * <nl> + * Field type fixed64 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_FIXED64 = 6 ; < / code > <nl> + * / <nl> + const TYPE_FIXED64 = 6 ; <nl> + / * * <nl> + * Field type fixed32 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_FIXED32 = 7 ; < / code > <nl> + * / <nl> + const TYPE_FIXED32 = 7 ; <nl> + / * * <nl> + * Field type bool . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_BOOL = 8 ; < / code > <nl> + * / <nl> + const TYPE_BOOL = 8 ; <nl> + / * * <nl> + * Field type string . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_STRING = 9 ; < / code > <nl> + * / <nl> + const TYPE_STRING = 9 ; <nl> + / * * <nl> + * Field type group . Proto2 syntax only , and deprecated . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_GROUP = 10 ; < / code > <nl> + * / <nl> + const TYPE_GROUP = 10 ; <nl> + / * * <nl> + * Field type message . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_MESSAGE = 11 ; < / code > <nl> + * / <nl> + const TYPE_MESSAGE = 11 ; <nl> + / * * <nl> + * Field type bytes . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_BYTES = 12 ; < / code > <nl> + * / <nl> + const TYPE_BYTES = 12 ; <nl> + / * * <nl> + * Field type uint32 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_UINT32 = 13 ; < / code > <nl> + * / <nl> + const TYPE_UINT32 = 13 ; <nl> + / * * <nl> + * Field type enum . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_ENUM = 14 ; < / code > <nl> + * / <nl> + const TYPE_ENUM = 14 ; <nl> + / * * <nl> + * Field type sfixed32 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_SFIXED32 = 15 ; < / code > <nl> + * / <nl> + const TYPE_SFIXED32 = 15 ; <nl> + / * * <nl> + * Field type sfixed64 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_SFIXED64 = 16 ; < / code > <nl> + * / <nl> + const TYPE_SFIXED64 = 16 ; <nl> + / * * <nl> + * Field type sint32 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_SINT32 = 17 ; < / code > <nl> + * / <nl> + const TYPE_SINT32 = 17 ; <nl> + / * * <nl> + * Field type sint64 . <nl> + * <nl> + * Generated from protobuf enum < code > TYPE_SINT64 = 18 ; < / code > <nl> + * / <nl> + const TYPE_SINT64 = 18 ; <nl> + } <nl> + <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( Kind : : class , \ Google \ Protobuf \ Field_Kind : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / FieldMask . php <nl> ppp b / php / src / Google / Protobuf / FieldMask . php <nl> <nl> * } <nl> * Note that oneof type names ( " test_oneof " in this case ) cannot be used in <nl> * paths . <nl> + * # # Field Mask Verification <nl> + * The implementation of any API method which has a FieldMask type field in the <nl> + * request should verify the included field paths , and return an <nl> + * ` INVALID_ARGUMENT ` error if any path is duplicated or unmappable . <nl> * <nl> * Generated from protobuf message < code > google . protobuf . FieldMask < / code > <nl> * / <nl> class FieldMask extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ paths ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ paths <nl> + * The set of field mask paths . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ FieldMask : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Field_Cardinality . php <nl> ppp b / php / src / Google / Protobuf / Field_Cardinality . php <nl> <nl> <nl> namespace Google \ Protobuf ; <nl> <nl> - / * * <nl> - * Whether a field is optional , required , or repeated . <nl> - * <nl> - * Protobuf enum < code > Google \ Protobuf \ Field \ Cardinality < / code > <nl> - * / <nl> - class Field_Cardinality <nl> - { <nl> + if ( false ) { <nl> / * * <nl> - * For fields with unknown cardinality . <nl> - * <nl> - * Generated from protobuf enum < code > CARDINALITY_UNKNOWN = 0 ; < / code > <nl> + * This class is deprecated . Use Google \ Protobuf \ Field \ Cardinality instead . <nl> + * @ deprecated <nl> * / <nl> - const CARDINALITY_UNKNOWN = 0 ; <nl> - / * * <nl> - * For optional fields . <nl> - * <nl> - * Generated from protobuf enum < code > CARDINALITY_OPTIONAL = 1 ; < / code > <nl> - * / <nl> - const CARDINALITY_OPTIONAL = 1 ; <nl> - / * * <nl> - * For required fields . Proto2 syntax only . <nl> - * <nl> - * Generated from protobuf enum < code > CARDINALITY_REQUIRED = 2 ; < / code > <nl> - * / <nl> - const CARDINALITY_REQUIRED = 2 ; <nl> - / * * <nl> - * For repeated fields . <nl> - * <nl> - * Generated from protobuf enum < code > CARDINALITY_REPEATED = 3 ; < / code > <nl> - * / <nl> - const CARDINALITY_REPEATED = 3 ; <nl> + class Field_Cardinality { } <nl> } <nl> + class_exists ( Field \ Cardinality : : class ) ; <nl> + @ trigger_error ( ' Google \ Protobuf \ Field_Cardinality is deprecated and will be removed in the next major release . Use Google \ Protobuf \ Field \ Cardinality instead ' , E_USER_DEPRECATED ) ; <nl> <nl> mmm a / php / src / Google / Protobuf / Field_Kind . php <nl> ppp b / php / src / Google / Protobuf / Field_Kind . php <nl> <nl> <nl> namespace Google \ Protobuf ; <nl> <nl> - / * * <nl> - * Basic field types . <nl> - * <nl> - * Protobuf enum < code > Google \ Protobuf \ Field \ Kind < / code > <nl> - * / <nl> - class Field_Kind <nl> - { <nl> + if ( false ) { <nl> / * * <nl> - * Field type unknown . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_UNKNOWN = 0 ; < / code > <nl> + * This class is deprecated . Use Google \ Protobuf \ Field \ Kind instead . <nl> + * @ deprecated <nl> * / <nl> - const TYPE_UNKNOWN = 0 ; <nl> - / * * <nl> - * Field type double . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_DOUBLE = 1 ; < / code > <nl> - * / <nl> - const TYPE_DOUBLE = 1 ; <nl> - / * * <nl> - * Field type float . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_FLOAT = 2 ; < / code > <nl> - * / <nl> - const TYPE_FLOAT = 2 ; <nl> - / * * <nl> - * Field type int64 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_INT64 = 3 ; < / code > <nl> - * / <nl> - const TYPE_INT64 = 3 ; <nl> - / * * <nl> - * Field type uint64 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_UINT64 = 4 ; < / code > <nl> - * / <nl> - const TYPE_UINT64 = 4 ; <nl> - / * * <nl> - * Field type int32 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_INT32 = 5 ; < / code > <nl> - * / <nl> - const TYPE_INT32 = 5 ; <nl> - / * * <nl> - * Field type fixed64 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_FIXED64 = 6 ; < / code > <nl> - * / <nl> - const TYPE_FIXED64 = 6 ; <nl> - / * * <nl> - * Field type fixed32 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_FIXED32 = 7 ; < / code > <nl> - * / <nl> - const TYPE_FIXED32 = 7 ; <nl> - / * * <nl> - * Field type bool . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_BOOL = 8 ; < / code > <nl> - * / <nl> - const TYPE_BOOL = 8 ; <nl> - / * * <nl> - * Field type string . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_STRING = 9 ; < / code > <nl> - * / <nl> - const TYPE_STRING = 9 ; <nl> - / * * <nl> - * Field type group . Proto2 syntax only , and deprecated . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_GROUP = 10 ; < / code > <nl> - * / <nl> - const TYPE_GROUP = 10 ; <nl> - / * * <nl> - * Field type message . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_MESSAGE = 11 ; < / code > <nl> - * / <nl> - const TYPE_MESSAGE = 11 ; <nl> - / * * <nl> - * Field type bytes . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_BYTES = 12 ; < / code > <nl> - * / <nl> - const TYPE_BYTES = 12 ; <nl> - / * * <nl> - * Field type uint32 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_UINT32 = 13 ; < / code > <nl> - * / <nl> - const TYPE_UINT32 = 13 ; <nl> - / * * <nl> - * Field type enum . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_ENUM = 14 ; < / code > <nl> - * / <nl> - const TYPE_ENUM = 14 ; <nl> - / * * <nl> - * Field type sfixed32 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_SFIXED32 = 15 ; < / code > <nl> - * / <nl> - const TYPE_SFIXED32 = 15 ; <nl> - / * * <nl> - * Field type sfixed64 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_SFIXED64 = 16 ; < / code > <nl> - * / <nl> - const TYPE_SFIXED64 = 16 ; <nl> - / * * <nl> - * Field type sint32 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_SINT32 = 17 ; < / code > <nl> - * / <nl> - const TYPE_SINT32 = 17 ; <nl> - / * * <nl> - * Field type sint64 . <nl> - * <nl> - * Generated from protobuf enum < code > TYPE_SINT64 = 18 ; < / code > <nl> - * / <nl> - const TYPE_SINT64 = 18 ; <nl> + class Field_Kind { } <nl> } <nl> + class_exists ( Field \ Kind : : class ) ; <nl> + @ trigger_error ( ' Google \ Protobuf \ Field_Kind is deprecated and will be removed in the next major release . Use Google \ Protobuf \ Field \ Kind instead ' , E_USER_DEPRECATED ) ; <nl> <nl> mmm a / php / src / Google / Protobuf / FloatValue . php <nl> ppp b / php / src / Google / Protobuf / FloatValue . php <nl> class FloatValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = 0 . 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type float $ value <nl> + * The float value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / GPBEmpty . php <nl> ppp b / php / src / Google / Protobuf / GPBEmpty . php <nl> <nl> class GPBEmpty extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ GPBEmpty : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> } <nl> mmm a / php / src / Google / Protobuf / Int32Value . php <nl> ppp b / php / src / Google / Protobuf / Int32Value . php <nl> class Int32Value extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ value <nl> + * The int32 value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Int64Value . php <nl> ppp b / php / src / Google / Protobuf / Int64Value . php <nl> class Int64Value extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int | string $ value <nl> + * The int64 value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / DescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / DescriptorProto . php <nl> class DescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ reserved_name ; <nl> private $ has_reserved_name = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type \ Google \ Protobuf \ Internal \ FieldDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ field <nl> + * @ type \ Google \ Protobuf \ Internal \ FieldDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ extension <nl> + * @ type \ Google \ Protobuf \ Internal \ DescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ nested_type <nl> + * @ type \ Google \ Protobuf \ Internal \ EnumDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ enum_type <nl> + * @ type \ Google \ Protobuf \ Internal \ DescriptorProto \ ExtensionRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ extension_range <nl> + * @ type \ Google \ Protobuf \ Internal \ OneofDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ oneof_decl <nl> + * @ type \ Google \ Protobuf \ Internal \ MessageOptions $ options <nl> + * @ type \ Google \ Protobuf \ Internal \ DescriptorProto \ ReservedRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ reserved_range <nl> + * @ type string [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ reserved_name <nl> + * Reserved field names , which may not be used by fields in the same message . <nl> + * A given name may only be reserved once . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function getExtensionRange ( ) <nl> <nl> / * * <nl> * Generated from protobuf field < code > repeated . google . protobuf . DescriptorProto . ExtensionRange extension_range = 5 ; < / code > <nl> - * @ param \ Google \ Protobuf \ Internal \ DescriptorProto_ExtensionRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> + * @ param \ Google \ Protobuf \ Internal \ DescriptorProto \ ExtensionRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> * @ return $ this <nl> * / <nl> public function setExtensionRange ( $ var ) <nl> { <nl> - $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ DescriptorProto_ExtensionRange : : class ) ; <nl> + $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ DescriptorProto \ ExtensionRange : : class ) ; <nl> $ this - > extension_range = $ arr ; <nl> $ this - > has_extension_range = true ; <nl> <nl> public function getReservedRange ( ) <nl> <nl> / * * <nl> * Generated from protobuf field < code > repeated . google . protobuf . DescriptorProto . ReservedRange reserved_range = 9 ; < / code > <nl> - * @ param \ Google \ Protobuf \ Internal \ DescriptorProto_ReservedRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> + * @ param \ Google \ Protobuf \ Internal \ DescriptorProto \ ReservedRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> * @ return $ this <nl> * / <nl> public function setReservedRange ( $ var ) <nl> { <nl> - $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ DescriptorProto_ReservedRange : : class ) ; <nl> + $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ DescriptorProto \ ReservedRange : : class ) ; <nl> $ this - > reserved_range = $ arr ; <nl> $ this - > has_reserved_range = true ; <nl> <nl> similarity index 81 % <nl> rename from php / src / Google / Protobuf / Internal / DescriptorProto_ExtensionRange . php <nl> rename to php / src / Google / Protobuf / Internal / DescriptorProto / ExtensionRange . php <nl> mmm a / php / src / Google / Protobuf / Internal / DescriptorProto_ExtensionRange . php <nl> ppp b / php / src / Google / Protobuf / Internal / DescriptorProto / ExtensionRange . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ DescriptorProto ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ GPBWire ; <nl> <nl> / * * <nl> * Generated from protobuf message < code > google . protobuf . DescriptorProto . ExtensionRange < / code > <nl> * / <nl> - class DescriptorProto_ExtensionRange extends \ Google \ Protobuf \ Internal \ Message <nl> + class ExtensionRange extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> * Generated from protobuf field < code > optional int32 start = 1 ; < / code > <nl> class DescriptorProto_ExtensionRange extends \ Google \ Protobuf \ Internal \ Message <nl> private $ options = null ; <nl> private $ has_options = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ start <nl> + * @ type int $ end <nl> + * @ type \ Google \ Protobuf \ Internal \ ExtensionRangeOptions $ options <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function hasOptions ( ) <nl> <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( ExtensionRange : : class , \ Google \ Protobuf \ Internal \ DescriptorProto_ExtensionRange : : class ) ; <nl> + <nl> similarity index 77 % <nl> rename from php / src / Google / Protobuf / Internal / DescriptorProto_ReservedRange . php <nl> rename to php / src / Google / Protobuf / Internal / DescriptorProto / ReservedRange . php <nl> mmm a / php / src / Google / Protobuf / Internal / DescriptorProto_ReservedRange . php <nl> ppp b / php / src / Google / Protobuf / Internal / DescriptorProto / ReservedRange . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ DescriptorProto ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ GPBWire ; <nl> <nl> * <nl> * Generated from protobuf message < code > google . protobuf . DescriptorProto . ReservedRange < / code > <nl> * / <nl> - class DescriptorProto_ReservedRange extends \ Google \ Protobuf \ Internal \ Message <nl> + class ReservedRange extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> * Inclusive . <nl> class DescriptorProto_ReservedRange extends \ Google \ Protobuf \ Internal \ Message <nl> private $ end = 0 ; <nl> private $ has_end = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ start <nl> + * Inclusive . <nl> + * @ type int $ end <nl> + * Exclusive . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function hasEnd ( ) <nl> <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( ReservedRange : : class , \ Google \ Protobuf \ Internal \ DescriptorProto_ReservedRange : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / EnumDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / EnumDescriptorProto . php <nl> class EnumDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ reserved_name ; <nl> private $ has_reserved_name = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type \ Google \ Protobuf \ Internal \ EnumValueDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ value <nl> + * @ type \ Google \ Protobuf \ Internal \ EnumOptions $ options <nl> + * @ type \ Google \ Protobuf \ Internal \ EnumDescriptorProto \ EnumReservedRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ reserved_range <nl> + * Range of reserved numeric values . Reserved numeric values may not be used <nl> + * by enum values in the same enum declaration . Reserved ranges may not <nl> + * overlap . <nl> + * @ type string [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ reserved_name <nl> + * Reserved enum value names , which may not be reused . A given name may only <nl> + * be reserved once . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function getReservedRange ( ) <nl> * overlap . <nl> * <nl> * Generated from protobuf field < code > repeated . google . protobuf . EnumDescriptorProto . EnumReservedRange reserved_range = 4 ; < / code > <nl> - * @ param \ Google \ Protobuf \ Internal \ EnumDescriptorProto_EnumReservedRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> + * @ param \ Google \ Protobuf \ Internal \ EnumDescriptorProto \ EnumReservedRange [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> * @ return $ this <nl> * / <nl> public function setReservedRange ( $ var ) <nl> { <nl> - $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ EnumDescriptorProto_EnumReservedRange : : class ) ; <nl> + $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ EnumDescriptorProto \ EnumReservedRange : : class ) ; <nl> $ this - > reserved_range = $ arr ; <nl> $ this - > has_reserved_range = true ; <nl> <nl> similarity index 78 % <nl> rename from php / src / Google / Protobuf / Internal / EnumDescriptorProto_EnumReservedRange . php <nl> rename to php / src / Google / Protobuf / Internal / EnumDescriptorProto / EnumReservedRange . php <nl> mmm a / php / src / Google / Protobuf / Internal / EnumDescriptorProto_EnumReservedRange . php <nl> ppp b / php / src / Google / Protobuf / Internal / EnumDescriptorProto / EnumReservedRange . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ EnumDescriptorProto ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ GPBWire ; <nl> <nl> * <nl> * Generated from protobuf message < code > google . protobuf . EnumDescriptorProto . EnumReservedRange < / code > <nl> * / <nl> - class EnumDescriptorProto_EnumReservedRange extends \ Google \ Protobuf \ Internal \ Message <nl> + class EnumReservedRange extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> * Inclusive . <nl> class EnumDescriptorProto_EnumReservedRange extends \ Google \ Protobuf \ Internal \ Me <nl> private $ end = 0 ; <nl> private $ has_end = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ start <nl> + * Inclusive . <nl> + * @ type int $ end <nl> + * Inclusive . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function hasEnd ( ) <nl> <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( EnumReservedRange : : class , \ Google \ Protobuf \ Internal \ EnumDescriptorProto_EnumReservedRange : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / EnumOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / EnumOptions . php <nl> class EnumOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type bool $ allow_alias <nl> + * Set this option to true to allow mapping different tag names to the same <nl> + * value . <nl> + * @ type bool $ deprecated <nl> + * Is this enum deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for the enum , or it will be completely ignored ; in the very least , this <nl> + * is a formalization for deprecating enums . <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / EnumValueDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / EnumValueDescriptorProto . php <nl> class EnumValueDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ options = null ; <nl> private $ has_options = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type int $ number <nl> + * @ type \ Google \ Protobuf \ Internal \ EnumValueOptions $ options <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / EnumValueOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / EnumValueOptions . php <nl> class EnumValueOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type bool $ deprecated <nl> + * Is this enum value deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for the enum value , or it will be completely ignored ; in the very least , <nl> + * this is a formalization for deprecating enum values . <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / ExtensionRangeOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / ExtensionRangeOptions . php <nl> class ExtensionRangeOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / FieldDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / FieldDescriptorProto . php <nl> class FieldDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ options = null ; <nl> private $ has_options = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type int $ number <nl> + * @ type int $ label <nl> + * @ type int $ type <nl> + * If type_name is set , this need not be set . If both this and type_name <nl> + * are set , this must be one of TYPE_ENUM , TYPE_MESSAGE or TYPE_GROUP . <nl> + * @ type string $ type_name <nl> + * For message and enum types , this is the name of the type . If the name <nl> + * starts with a ' . ' , it is fully - qualified . Otherwise , C + + - like scoping <nl> + * rules are used to find the type ( i . e . first the nested types within this <nl> + * message are searched , then within the parent , on up to the root <nl> + * namespace ) . <nl> + * @ type string $ extendee <nl> + * For extensions , this is the name of the type being extended . It is <nl> + * resolved in the same manner as type_name . <nl> + * @ type string $ default_value <nl> + * For numeric types , contains the original text representation of the value . <nl> + * For booleans , " true " or " false " . <nl> + * For strings , contains the default text contents ( not escaped in any way ) . <nl> + * For bytes , contains the C escaped value . All bytes > = 128 are escaped . <nl> + * TODO ( kenton ) : Base - 64 encode ? <nl> + * @ type int $ oneof_index <nl> + * If set , gives the index of a oneof in the containing type ' s oneof_decl <nl> + * list . This field is a member of that oneof . <nl> + * @ type string $ json_name <nl> + * JSON name of this field . The value is set by protocol compiler . If the <nl> + * user has set a " json_name " option on this field , that option ' s value <nl> + * will be used . Otherwise , it ' s deduced from the field ' s name by converting <nl> + * it to camelCase . <nl> + * @ type \ Google \ Protobuf \ Internal \ FieldOptions $ options <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> similarity index 61 % <nl> rename from php / src / Google / Protobuf / Internal / FieldDescriptorProto_Label . php <nl> rename to php / src / Google / Protobuf / Internal / FieldDescriptorProto / Label . php <nl> mmm a / php / src / Google / Protobuf / Internal / FieldDescriptorProto_Label . php <nl> ppp b / php / src / Google / Protobuf / Internal / FieldDescriptorProto / Label . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ FieldDescriptorProto ; <nl> <nl> / * * <nl> - * Protobuf enum < code > Google \ Protobuf \ Internal < / code > <nl> + * Protobuf type < code > google . protobuf . FieldDescriptorProto . Label < / code > <nl> * / <nl> - class FieldDescriptorProto_Label <nl> + class Label <nl> { <nl> / * * <nl> * 0 is reserved for errors <nl> class FieldDescriptorProto_Label <nl> const LABEL_REPEATED = 3 ; <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( Label : : class , \ Google \ Protobuf \ Internal \ FieldDescriptorProto_Label : : class ) ; <nl> + <nl> similarity index 90 % <nl> rename from php / src / Google / Protobuf / Internal / FieldDescriptorProto_Type . php <nl> rename to php / src / Google / Protobuf / Internal / FieldDescriptorProto / Type . php <nl> mmm a / php / src / Google / Protobuf / Internal / FieldDescriptorProto_Type . php <nl> ppp b / php / src / Google / Protobuf / Internal / FieldDescriptorProto / Type . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ FieldDescriptorProto ; <nl> <nl> / * * <nl> - * Protobuf enum < code > Google \ Protobuf \ Internal < / code > <nl> + * Protobuf type < code > google . protobuf . FieldDescriptorProto . Type < / code > <nl> * / <nl> - class FieldDescriptorProto_Type <nl> + class Type <nl> { <nl> / * * <nl> * 0 is reserved for errors . <nl> class FieldDescriptorProto_Type <nl> const TYPE_SINT64 = 18 ; <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( Type : : class , \ Google \ Protobuf \ Internal \ FieldDescriptorProto_Type : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / FieldOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / FieldOptions . php <nl> class FieldOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ ctype <nl> + * The ctype option instructs the C + + code generator to use a different <nl> + * representation of the field than it normally would . See the specific <nl> + * options below . This option is not yet implemented in the open source <nl> + * release - - sorry , we ' ll try to include it in a future version ! <nl> + * @ type bool $ packed <nl> + * The packed option can be enabled for repeated primitive fields to enable <nl> + * a more efficient representation on the wire . Rather than repeatedly <nl> + * writing the tag and type for each element , the entire array is encoded as <nl> + * a single length - delimited blob . In proto3 , only explicit setting it to <nl> + * false will avoid using packed encoding . <nl> + * @ type int $ jstype <nl> + * The jstype option determines the JavaScript type used for values of the <nl> + * field . The option is permitted only for 64 bit integral and fixed types <nl> + * ( int64 , uint64 , sint64 , fixed64 , sfixed64 ) . A field with jstype JS_STRING <nl> + * is represented as JavaScript string , which avoids loss of precision that <nl> + * can happen when a large value is converted to a floating point JavaScript . <nl> + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to <nl> + * use the JavaScript " number " type . The behavior of the default option <nl> + * JS_NORMAL is implementation dependent . <nl> + * This option is an enum to permit additional types to be added , e . g . <nl> + * goog . math . Integer . <nl> + * @ type bool $ lazy <nl> + * Should this field be parsed lazily ? Lazy applies only to message - type <nl> + * fields . It means that when the outer message is initially parsed , the <nl> + * inner message ' s contents will not be parsed but instead stored in encoded <nl> + * form . The inner message will actually be parsed when it is first accessed . <nl> + * This is only a hint . Implementations are free to choose whether to use <nl> + * eager or lazy parsing regardless of the value of this option . However , <nl> + * setting this option true suggests that the protocol author believes that <nl> + * using lazy parsing on this field is worth the additional bookkeeping <nl> + * overhead typically needed to implement it . <nl> + * This option does not affect the public interface of any generated code ; <nl> + * all method signatures remain the same . Furthermore , thread - safety of the <nl> + * interface is not affected by this option ; const methods remain safe to <nl> + * call from multiple threads concurrently , while non - const methods continue <nl> + * to require exclusive access . <nl> + * Note that implementations may choose not to check required fields within <nl> + * a lazy sub - message . That is , calling IsInitialized ( ) on the outer message <nl> + * may return true even if the inner message has missing required fields . <nl> + * This is necessary because otherwise the inner message would have to be <nl> + * parsed in order to perform the check , defeating the purpose of lazy <nl> + * parsing . An implementation which chooses not to check required fields <nl> + * must be consistent about it . That is , for any particular sub - message , the <nl> + * implementation must either * always * check its required fields , or * never * <nl> + * check its required fields , regardless of whether or not the message has <nl> + * been parsed . <nl> + * @ type bool $ deprecated <nl> + * Is this field deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for accessors , or it will be completely ignored ; in the very least , this <nl> + * is a formalization for deprecating fields . <nl> + * @ type bool $ weak <nl> + * For Google - internal migration only . Do not use . <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> similarity index 61 % <nl> rename from php / src / Google / Protobuf / Internal / FieldOptions_CType . php <nl> rename to php / src / Google / Protobuf / Internal / FieldOptions / CType . php <nl> mmm a / php / src / Google / Protobuf / Internal / FieldOptions_CType . php <nl> ppp b / php / src / Google / Protobuf / Internal / FieldOptions / CType . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ FieldOptions ; <nl> <nl> / * * <nl> - * Protobuf enum < code > Google \ Protobuf \ Internal < / code > <nl> + * Protobuf type < code > google . protobuf . FieldOptions . CType < / code > <nl> * / <nl> - class FieldOptions_CType <nl> + class CType <nl> { <nl> / * * <nl> * Default mode . <nl> class FieldOptions_CType <nl> const STRING_PIECE = 2 ; <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( CType : : class , \ Google \ Protobuf \ Internal \ FieldOptions_CType : : class ) ; <nl> + <nl> similarity index 65 % <nl> rename from php / src / Google / Protobuf / Internal / FieldOptions_JSType . php <nl> rename to php / src / Google / Protobuf / Internal / FieldOptions / JSType . php <nl> mmm a / php / src / Google / Protobuf / Internal / FieldOptions_JSType . php <nl> ppp b / php / src / Google / Protobuf / Internal / FieldOptions / JSType . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ FieldOptions ; <nl> <nl> / * * <nl> - * Protobuf enum < code > Google \ Protobuf \ Internal < / code > <nl> + * Protobuf type < code > google . protobuf . FieldOptions . JSType < / code > <nl> * / <nl> - class FieldOptions_JSType <nl> + class JSType <nl> { <nl> / * * <nl> * Use the default type . <nl> class FieldOptions_JSType <nl> const JS_NUMBER = 2 ; <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( JSType : : class , \ Google \ Protobuf \ Internal \ FieldOptions_JSType : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / FileDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / FileDescriptorProto . php <nl> class FileDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ syntax = ' ' ; <nl> private $ has_syntax = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * file name , relative to root of source tree <nl> + * @ type string $ package <nl> + * e . g . " foo " , " foo . bar " , etc . <nl> + * @ type string [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ dependency <nl> + * Names of files imported by this file . <nl> + * @ type int [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ public_dependency <nl> + * Indexes of the public imported files in the dependency list above . <nl> + * @ type int [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ weak_dependency <nl> + * Indexes of the weak imported files in the dependency list . <nl> + * For Google - internal migration only . Do not use . <nl> + * @ type \ Google \ Protobuf \ Internal \ DescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ message_type <nl> + * All top - level definitions in this file . <nl> + * @ type \ Google \ Protobuf \ Internal \ EnumDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ enum_type <nl> + * @ type \ Google \ Protobuf \ Internal \ ServiceDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ service <nl> + * @ type \ Google \ Protobuf \ Internal \ FieldDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ extension <nl> + * @ type \ Google \ Protobuf \ Internal \ FileOptions $ options <nl> + * @ type \ Google \ Protobuf \ Internal \ SourceCodeInfo $ source_code_info <nl> + * This field contains optional information about the original source code . <nl> + * You may safely remove this entire field without harming runtime <nl> + * functionality of the descriptors - - the information is needed only by <nl> + * development tools . <nl> + * @ type string $ syntax <nl> + * The syntax of the proto file . <nl> + * The supported values are " proto2 " and " proto3 " . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / FileDescriptorSet . php <nl> ppp b / php / src / Google / Protobuf / Internal / FileDescriptorSet . php <nl> class FileDescriptorSet extends \ Google \ Protobuf \ Internal \ Message <nl> private $ file ; <nl> private $ has_file = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Internal \ FileDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ file <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / FileOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / FileOptions . php <nl> class FileOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ java_package <nl> + * Sets the Java package where classes generated from this . proto will be <nl> + * placed . By default , the proto package is used , but this is often <nl> + * inappropriate because proto packages do not normally start with backwards <nl> + * domain names . <nl> + * @ type string $ java_outer_classname <nl> + * If set , all the classes from the . proto file are wrapped in a single <nl> + * outer class with the given name . This applies to both Proto1 <nl> + * ( equivalent to the old " - - one_java_file " option ) and Proto2 ( where <nl> + * a . proto always translates to a single class , but you may want to <nl> + * explicitly choose the class name ) . <nl> + * @ type bool $ java_multiple_files <nl> + * If set true , then the Java code generator will generate a separate . java <nl> + * file for each top - level message , enum , and service defined in the . proto <nl> + * file . Thus , these types will * not * be nested inside the outer class <nl> + * named by java_outer_classname . However , the outer class will still be <nl> + * generated to contain the file ' s getDescriptor ( ) method as well as any <nl> + * top - level extensions defined in the file . <nl> + * @ type bool $ java_generate_equals_and_hash <nl> + * This option does nothing . <nl> + * @ type bool $ java_string_check_utf8 <nl> + * If set true , then the Java2 code generator will generate code that <nl> + * throws an exception whenever an attempt is made to assign a non - UTF - 8 <nl> + * byte sequence to a string field . <nl> + * Message reflection will do the same . <nl> + * However , an extension field still accepts non - UTF - 8 byte sequences . <nl> + * This option has no effect on when used with the lite runtime . <nl> + * @ type int $ optimize_for <nl> + * @ type string $ go_package <nl> + * Sets the Go package where structs generated from this . proto will be <nl> + * placed . If omitted , the Go package will be derived from the following : <nl> + * - The basename of the package import path , if provided . <nl> + * - Otherwise , the package statement in the . proto file , if present . <nl> + * - Otherwise , the basename of the . proto file , without extension . <nl> + * @ type bool $ cc_generic_services <nl> + * Should generic services be generated in each language ? " Generic " services <nl> + * are not specific to any particular RPC system . They are generated by the <nl> + * main code generators in each language ( without additional plugins ) . <nl> + * Generic services were the only kind of service generation supported by <nl> + * early versions of google . protobuf . <nl> + * Generic services are now considered deprecated in favor of using plugins <nl> + * that generate code specific to your particular RPC system . Therefore , <nl> + * these default to false . Old code which depends on generic services should <nl> + * explicitly set them to true . <nl> + * @ type bool $ java_generic_services <nl> + * @ type bool $ py_generic_services <nl> + * @ type bool $ php_generic_services <nl> + * @ type bool $ deprecated <nl> + * Is this file deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for everything in the file , or it will be completely ignored ; in the very <nl> + * least , this is a formalization for deprecating files . <nl> + * @ type bool $ cc_enable_arenas <nl> + * Enables the use of arenas for the proto messages in this file . This applies <nl> + * only to generated classes for C + + . <nl> + * @ type string $ objc_class_prefix <nl> + * Sets the objective c class prefix which is prepended to all objective c <nl> + * generated classes from this . proto . There is no default . <nl> + * @ type string $ csharp_namespace <nl> + * Namespace for generated classes ; defaults to the package . <nl> + * @ type string $ swift_prefix <nl> + * By default Swift generators will take the proto package and CamelCase it <nl> + * replacing ' . ' with underscore and use that to prefix the types / symbols <nl> + * defined . When this options is provided , they will use this value instead <nl> + * to prefix the types / symbols defined . <nl> + * @ type string $ php_class_prefix <nl> + * Sets the php class prefix which is prepended to all php generated classes <nl> + * from this . proto . Default is empty . <nl> + * @ type string $ php_namespace <nl> + * Use this option to change the namespace of php generated classes . Default <nl> + * is empty . When this option is empty , the package name will be used for <nl> + * determining the namespace . <nl> + * @ type string $ php_metadata_namespace <nl> + * Use this option to change the namespace of php generated metadata classes . <nl> + * Default is empty . When this option is empty , the proto file name will be used <nl> + * for determining the namespace . <nl> + * @ type string $ ruby_package <nl> + * Use this option to change the package of ruby generated classes . Default <nl> + * is empty . When this option is not set , the package name will be used for <nl> + * determining the ruby package . <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . <nl> + * See the documentation for the " Options " section above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> similarity index 67 % <nl> rename from php / src / Google / Protobuf / Internal / FileOptions_OptimizeMode . php <nl> rename to php / src / Google / Protobuf / Internal / FileOptions / OptimizeMode . php <nl> mmm a / php / src / Google / Protobuf / Internal / FileOptions_OptimizeMode . php <nl> ppp b / php / src / Google / Protobuf / Internal / FileOptions / OptimizeMode . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ FileOptions ; <nl> <nl> / * * <nl> * Generated classes can be optimized for speed or code size . <nl> * <nl> - * Protobuf enum < code > Google \ Protobuf \ Internal < / code > <nl> + * Protobuf type < code > google . protobuf . FileOptions . OptimizeMode < / code > <nl> * / <nl> - class FileOptions_OptimizeMode <nl> + class OptimizeMode <nl> { <nl> / * * <nl> * Generate complete code for parsing , serialization , <nl> class FileOptions_OptimizeMode <nl> const LITE_RUNTIME = 3 ; <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( OptimizeMode : : class , \ Google \ Protobuf \ Internal \ FileOptions_OptimizeMode : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / GPBUtil . php <nl> ppp b / php / src / Google / Protobuf / Internal / GPBUtil . php <nl> public static function checkBool ( & $ var ) <nl> $ var = boolval ( $ var ) ; <nl> } <nl> <nl> - public static function checkMessage ( & $ var , $ klass ) <nl> + public static function checkMessage ( & $ var , $ klass , $ newClass = null ) <nl> { <nl> if ( ! $ var instanceof $ klass & & ! is_null ( $ var ) ) { <nl> throw new \ Exception ( " Expect $ klass . " ) ; <nl> public static function getClassNameWithoutPackage ( <nl> $ name , <nl> $ file_proto ) <nl> { <nl> - $ classname = implode ( ' _ ' , explode ( ' . ' , $ name ) ) ; <nl> - return static : : getClassNamePrefix ( $ classname , $ file_proto ) . $ classname ; <nl> + $ parts = explode ( ' . ' , $ name ) ; <nl> + foreach ( $ parts as $ i = > $ part ) { <nl> + $ parts [ $ i ] = static : : getClassNamePrefix ( $ parts [ $ i ] , $ file_proto ) . $ parts [ $ i ] ; <nl> + } <nl> + return implode ( ' \ \ ' , $ parts ) ; <nl> } <nl> <nl> public static function getFullClassName ( <nl> public static function getFullClassName ( <nl> if ( $ package = = = " " ) { <nl> $ classname = $ class_name_without_package ; <nl> } else { <nl> + $ parts = array_map ( ' ucwords ' , explode ( ' . ' , $ package ) ) ; <nl> + foreach ( $ parts as $ i = > $ part ) { <nl> + $ parts [ $ i ] = self : : getClassNamePrefix ( $ part , $ file_proto ) . $ part ; <nl> + } <nl> $ classname = <nl> - implode ( ' \ \ ' , array_map ( ' ucwords ' , explode ( ' . ' , $ package ) ) ) . <nl> - " \ \ " . $ class_name_without_package ; <nl> + implode ( ' \ \ ' , $ parts ) . <nl> + " \ \ " . self : : getClassNamePrefix ( $ class_name_without_package , $ file_proto ) . <nl> + $ class_name_without_package ; <nl> } <nl> } <nl> <nl> mmm a / php / src / Google / Protobuf / Internal / GeneratedCodeInfo . php <nl> ppp b / php / src / Google / Protobuf / Internal / GeneratedCodeInfo . php <nl> class GeneratedCodeInfo extends \ Google \ Protobuf \ Internal \ Message <nl> private $ annotation ; <nl> private $ has_annotation = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Internal \ GeneratedCodeInfo \ Annotation [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ annotation <nl> + * An Annotation connects some span of text in generated code to an element <nl> + * of its generating . proto file . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function getAnnotation ( ) <nl> * of its generating . proto file . <nl> * <nl> * Generated from protobuf field < code > repeated . google . protobuf . GeneratedCodeInfo . Annotation annotation = 1 ; < / code > <nl> - * @ param \ Google \ Protobuf \ Internal \ GeneratedCodeInfo_Annotation [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> + * @ param \ Google \ Protobuf \ Internal \ GeneratedCodeInfo \ Annotation [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> * @ return $ this <nl> * / <nl> public function setAnnotation ( $ var ) <nl> { <nl> - $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ GeneratedCodeInfo_Annotation : : class ) ; <nl> + $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ GeneratedCodeInfo \ Annotation : : class ) ; <nl> $ this - > annotation = $ arr ; <nl> $ this - > has_annotation = true ; <nl> <nl> similarity index 80 % <nl> rename from php / src / Google / Protobuf / Internal / GeneratedCodeInfo_Annotation . php <nl> rename to php / src / Google / Protobuf / Internal / GeneratedCodeInfo / Annotation . php <nl> mmm a / php / src / Google / Protobuf / Internal / GeneratedCodeInfo_Annotation . php <nl> ppp b / php / src / Google / Protobuf / Internal / GeneratedCodeInfo / Annotation . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ GeneratedCodeInfo ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ GPBWire ; <nl> <nl> / * * <nl> * Generated from protobuf message < code > google . protobuf . GeneratedCodeInfo . Annotation < / code > <nl> * / <nl> - class GeneratedCodeInfo_Annotation extends \ Google \ Protobuf \ Internal \ Message <nl> + class Annotation extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> * Identifies the element in the original source . proto file . This field <nl> class GeneratedCodeInfo_Annotation extends \ Google \ Protobuf \ Internal \ Message <nl> private $ end = 0 ; <nl> private $ has_end = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ path <nl> + * Identifies the element in the original source . proto file . This field <nl> + * is formatted the same as SourceCodeInfo . Location . path . <nl> + * @ type string $ source_file <nl> + * Identifies the filesystem path to the original source . proto . <nl> + * @ type int $ begin <nl> + * Identifies the starting offset in bytes in the generated code <nl> + * that relates to the identified object . <nl> + * @ type int $ end <nl> + * Identifies the ending offset in bytes in the generated code that <nl> + * relates to the identified offset . The end offset should be one past <nl> + * the last relevant byte ( so the length of the text = end - begin ) . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function hasEnd ( ) <nl> <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( Annotation : : class , \ Google \ Protobuf \ Internal \ GeneratedCodeInfo_Annotation : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / Message . php <nl> ppp b / php / src / Google / Protobuf / Internal / Message . php <nl> class Message <nl> / * * <nl> * @ ignore <nl> * / <nl> - public function __construct ( $ desc = NULL ) <nl> + public function __construct ( $ data = NULL ) <nl> { <nl> / / MapEntry message is shared by all types of map fields , whose <nl> / / descriptors are different from each other . Thus , we cannot find a <nl> / / specific descriptor from the descriptor pool . <nl> - if ( get_class ( $ this ) = = = ' Google \ Protobuf \ Internal \ MapEntry ' ) { <nl> - $ this - > desc = $ desc ; <nl> - foreach ( $ desc - > getField ( ) as $ field ) { <nl> - $ setter = $ field - > getSetter ( ) ; <nl> - $ this - > $ setter ( $ this - > defaultValue ( $ field ) ) ; <nl> + if ( $ this instanceof MapEntry ) { <nl> + $ this - > initWithDescriptor ( $ data ) ; <nl> + } else { <nl> + $ this - > initWithGeneratedPool ( ) ; <nl> + if ( is_array ( $ data ) ) { <nl> + $ this - > mergeFromArray ( $ data ) ; <nl> + } else if ( ! empty ( $ data ) ) { <nl> + throw new \ InvalidArgumentException ( <nl> + ' Message constructor must be an array or null . ' <nl> + ) ; <nl> } <nl> - return ; <nl> } <nl> + } <nl> + <nl> + / * * <nl> + * @ ignore <nl> + * / <nl> + private function initWithGeneratedPool ( ) <nl> + { <nl> $ pool = DescriptorPool : : getGeneratedPool ( ) ; <nl> $ this - > desc = $ pool - > getDescriptorByClassName ( get_class ( $ this ) ) ; <nl> if ( is_null ( $ this - > desc ) ) { <nl> public function __construct ( $ desc = NULL ) <nl> } <nl> } <nl> <nl> + / * * <nl> + * @ ignore <nl> + * / <nl> + private function initWithDescriptor ( Descriptor $ desc ) <nl> + { <nl> + $ this - > desc = $ desc ; <nl> + foreach ( $ desc - > getField ( ) as $ field ) { <nl> + $ setter = $ field - > getSetter ( ) ; <nl> + $ defaultValue = $ this - > defaultValue ( $ field ) ; <nl> + $ this - > $ setter ( $ defaultValue ) ; <nl> + } <nl> + } <nl> + <nl> protected function readOneof ( $ number ) <nl> { <nl> $ field = $ this - > desc - > getFieldByNumber ( $ number ) ; <nl> public function discardUnknownFields ( ) <nl> * / <nl> public function mergeFrom ( $ msg ) <nl> { <nl> - if ( get_class ( $ this ) ! = = get_class ( $ msg ) ) { <nl> - user_error ( " Cannot merge messages with different class . " ) ; <nl> - return ; <nl> - } <nl> - <nl> - foreach ( $ this - > desc - > getField ( ) as $ field ) { <nl> - $ setter = $ field - > getSetter ( ) ; <nl> - $ getter = $ field - > getGetter ( ) ; <nl> - if ( $ field - > isMap ( ) ) { <nl> - if ( count ( $ msg - > $ getter ( ) ) ! = 0 ) { <nl> - $ value_field = $ field - > getMessageType ( ) - > getFieldByNumber ( 2 ) ; <nl> - foreach ( $ msg - > $ getter ( ) as $ key = > $ value ) { <nl> - if ( $ value_field - > getType ( ) = = GPBType : : MESSAGE ) { <nl> - $ klass = $ value_field - > getMessageType ( ) - > getClass ( ) ; <nl> - $ copy = new $ klass ; <nl> - $ copy - > mergeFrom ( $ value ) ; <nl> - <nl> - $ this - > kvUpdateHelper ( $ field , $ key , $ copy ) ; <nl> - } else { <nl> - $ this - > kvUpdateHelper ( $ field , $ key , $ value ) ; <nl> - } <nl> - } <nl> - } <nl> - } else if ( $ field - > getLabel ( ) = = = GPBLabel : : REPEATED ) { <nl> - if ( count ( $ msg - > $ getter ( ) ) ! = 0 ) { <nl> - foreach ( $ msg - > $ getter ( ) as $ tmp ) { <nl> - if ( $ field - > getType ( ) = = GPBType : : MESSAGE ) { <nl> - $ klass = $ field - > getMessageType ( ) - > getClass ( ) ; <nl> - $ copy = new $ klass ; <nl> - $ copy - > mergeFrom ( $ tmp ) ; <nl> - $ this - > appendHelper ( $ field , $ copy ) ; <nl> - } else { <nl> - $ this - > appendHelper ( $ field , $ tmp ) ; <nl> - } <nl> - } <nl> - } <nl> - } else if ( $ field - > getLabel ( ) = = = GPBLabel : : OPTIONAL ) { <nl> - if ( $ msg - > $ getter ( ) ! = = $ this - > defaultValue ( $ field ) ) { <nl> - $ tmp = $ msg - > $ getter ( ) ; <nl> - if ( $ field - > getType ( ) = = GPBType : : MESSAGE ) { <nl> - if ( is_null ( $ this - > $ getter ( ) ) ) { <nl> - $ klass = $ field - > getMessageType ( ) - > getClass ( ) ; <nl> - $ new_msg = new $ klass ; <nl> - $ this - > $ setter ( $ new_msg ) ; <nl> - } <nl> - $ this - > $ getter ( ) - > mergeFrom ( $ tmp ) ; <nl> - } else { <nl> - $ this - > $ setter ( $ tmp ) ; <nl> - } <nl> - } <nl> - } <nl> - } <nl> + if ( get_class ( $ this ) ! = = get_class ( $ msg ) ) { <nl> + user_error ( " Cannot merge messages with different class . " ) ; <nl> + return ; <nl> + } <nl> + <nl> + foreach ( $ this - > desc - > getField ( ) as $ field ) { <nl> + $ setter = $ field - > getSetter ( ) ; <nl> + $ getter = $ field - > getGetter ( ) ; <nl> + if ( $ field - > isMap ( ) ) { <nl> + if ( count ( $ msg - > $ getter ( ) ) ! = 0 ) { <nl> + $ value_field = $ field - > getMessageType ( ) - > getFieldByNumber ( 2 ) ; <nl> + foreach ( $ msg - > $ getter ( ) as $ key = > $ value ) { <nl> + if ( $ value_field - > getType ( ) = = GPBType : : MESSAGE ) { <nl> + $ klass = $ value_field - > getMessageType ( ) - > getClass ( ) ; <nl> + $ copy = new $ klass ; <nl> + $ copy - > mergeFrom ( $ value ) ; <nl> + <nl> + $ this - > kvUpdateHelper ( $ field , $ key , $ copy ) ; <nl> + } else { <nl> + $ this - > kvUpdateHelper ( $ field , $ key , $ value ) ; <nl> + } <nl> + } <nl> + } <nl> + } else if ( $ field - > getLabel ( ) = = = GPBLabel : : REPEATED ) { <nl> + if ( count ( $ msg - > $ getter ( ) ) ! = 0 ) { <nl> + foreach ( $ msg - > $ getter ( ) as $ tmp ) { <nl> + if ( $ field - > getType ( ) = = GPBType : : MESSAGE ) { <nl> + $ klass = $ field - > getMessageType ( ) - > getClass ( ) ; <nl> + $ copy = new $ klass ; <nl> + $ copy - > mergeFrom ( $ tmp ) ; <nl> + $ this - > appendHelper ( $ field , $ copy ) ; <nl> + } else { <nl> + $ this - > appendHelper ( $ field , $ tmp ) ; <nl> + } <nl> + } <nl> + } <nl> + } else if ( $ field - > getLabel ( ) = = = GPBLabel : : OPTIONAL ) { <nl> + if ( $ msg - > $ getter ( ) ! = = $ this - > defaultValue ( $ field ) ) { <nl> + $ tmp = $ msg - > $ getter ( ) ; <nl> + if ( $ field - > getType ( ) = = GPBType : : MESSAGE ) { <nl> + if ( is_null ( $ this - > $ getter ( ) ) ) { <nl> + $ klass = $ field - > getMessageType ( ) - > getClass ( ) ; <nl> + $ new_msg = new $ klass ; <nl> + $ this - > $ setter ( $ new_msg ) ; <nl> + } <nl> + $ this - > $ getter ( ) - > mergeFrom ( $ tmp ) ; <nl> + } else { <nl> + $ this - > $ setter ( $ tmp ) ; <nl> + } <nl> + } <nl> + } <nl> + } <nl> } <nl> <nl> / * * <nl> private function convertJsonValueToProtoValue ( <nl> try { <nl> $ timestamp = GPBUtil : : parseTimestamp ( $ value ) ; <nl> } catch ( \ Exception $ e ) { <nl> - throw new GPBDecodeException ( " Invalid RFC 3339 timestamp : " . $ e - > getMessage ( ) ) ; <nl> + throw new GPBDecodeException ( <nl> + " Invalid RFC 3339 timestamp : " . $ e - > getMessage ( ) ) ; <nl> } <nl> <nl> $ submsg - > setSeconds ( $ timestamp - > getSeconds ( ) ) ; <nl> private function convertJsonValueToProtoValue ( <nl> try { <nl> return GPBUtil : : parseFieldMask ( $ value ) ; <nl> } catch ( \ Exception $ e ) { <nl> - throw new GPBDecodeException ( " Invalid FieldMask : " . $ e - > getMessage ( ) ) ; <nl> + throw new GPBDecodeException ( <nl> + " Invalid FieldMask : " . $ e - > getMessage ( ) ) ; <nl> } <nl> } else { <nl> if ( is_null ( $ value ) & & <nl> private function convertJsonValueToProtoValue ( <nl> case GPBType : : ENUM : <nl> if ( is_null ( $ value ) ) { <nl> return $ this - > defaultValue ( $ field ) ; <nl> - } else if ( is_integer ( $ value ) ) { <nl> + } <nl> + if ( is_integer ( $ value ) ) { <nl> return $ value ; <nl> - } else { <nl> - $ enum_value = <nl> - $ field - > getEnumType ( ) - > getValueByName ( $ value ) ; <nl> } <nl> + $ enum_value = $ field - > getEnumType ( ) - > getValueByName ( $ value ) ; <nl> if ( ! is_null ( $ enum_value ) ) { <nl> return $ enum_value - > getNumber ( ) ; <nl> } <nl> + throw new GPBDecodeException ( <nl> + " Enum field only accepts integer or enum value name " ) ; <nl> case GPBType : : STRING : <nl> if ( is_null ( $ value ) ) { <nl> return $ this - > defaultValue ( $ field ) ; <nl> } <nl> if ( ! is_string ( $ value ) ) { <nl> - throw new GPBDecodeException ( " Expect string " ) ; <nl> + throw new GPBDecodeException ( <nl> + " String field only accepts string value " ) ; <nl> } <nl> return $ value ; <nl> case GPBType : : BYTES : <nl> private function convertJsonValueToProtoValue ( <nl> return $ this - > defaultValue ( $ field ) ; <nl> } <nl> if ( ! is_string ( $ value ) ) { <nl> - throw new GPBDecodeException ( " Expect string " ) ; <nl> + throw new GPBDecodeException ( <nl> + " Byte field only accepts string value " ) ; <nl> } <nl> $ proto_value = base64_decode ( $ value , true ) ; <nl> if ( $ proto_value = = = false ) { <nl> - throw new GPBDecodeException ( <nl> - " Invalid base64 characters " ) ; <nl> + throw new GPBDecodeException ( " Invalid base64 characters " ) ; <nl> } <nl> return $ proto_value ; <nl> case GPBType : : BOOL : <nl> private function convertJsonValueToProtoValue ( <nl> return false ; <nl> } <nl> throw new GPBDecodeException ( <nl> - " Bool field only accept bool value " ) ; <nl> + " Bool field only accepts bool value " ) ; <nl> } <nl> if ( ! is_bool ( $ value ) ) { <nl> throw new GPBDecodeException ( <nl> - " Bool field only accept bool value " ) ; <nl> + " Bool field only accepts bool value " ) ; <nl> } <nl> return $ value ; <nl> case GPBType : : FLOAT : <nl> - if ( is_null ( $ value ) ) { <nl> - return $ this - > defaultValue ( $ field ) ; <nl> - } <nl> - if ( $ value = = = " Infinity " ) { <nl> - return INF ; <nl> - } <nl> - if ( $ value = = = " - Infinity " ) { <nl> - return - INF ; <nl> - } <nl> - if ( $ value = = = " NaN " ) { <nl> - return NAN ; <nl> - } <nl> - return $ value ; <nl> case GPBType : : DOUBLE : <nl> if ( is_null ( $ value ) ) { <nl> return $ this - > defaultValue ( $ field ) ; <nl> private function convertJsonValueToProtoValue ( <nl> } <nl> } <nl> <nl> + / * * <nl> + * Populates the message from a user - supplied PHP array . Array keys <nl> + * correspond to Message properties and nested message properties . <nl> + * <nl> + * Example : <nl> + * ` ` ` <nl> + * $ message - > mergeFromArray ( [ <nl> + * ' name ' = > ' This is a message name ' , <nl> + * ' interval ' = > [ <nl> + * ' startTime ' = > time ( ) - 60 , <nl> + * ' endTime ' = > time ( ) , <nl> + * ] <nl> + * ] ) ; <nl> + * ` ` ` <nl> + * <nl> + * @ param array $ array An array containing message properties and values . <nl> + * @ return null . <nl> + * @ throws Exception Invalid data . <nl> + * / <nl> + protected function mergeFromArray ( array $ array ) <nl> + { <nl> + / / Just call the setters for the field names <nl> + foreach ( $ array as $ key = > $ value ) { <nl> + $ field = $ this - > desc - > getFieldByName ( $ key ) ; <nl> + if ( is_null ( $ field ) ) { <nl> + throw new \ UnexpectedValueException ( <nl> + ' Invalid message property : ' . $ key ) ; <nl> + } <nl> + $ setter = $ field - > getSetter ( ) ; <nl> + $ this - > $ setter ( $ value ) ; <nl> + } <nl> + } <nl> + <nl> protected function mergeFromJsonArray ( $ array ) <nl> { <nl> if ( is_a ( $ this , " Google \ Protobuf \ Any " ) ) { <nl> protected function mergeFromJsonArray ( $ array ) <nl> } <nl> return ; <nl> } <nl> + $ this - > mergeFromArrayJsonImpl ( $ array ) ; <nl> + } <nl> + <nl> + private function mergeFromArrayJsonImpl ( $ array ) <nl> + { <nl> foreach ( $ array as $ key = > $ value ) { <nl> $ field = $ this - > desc - > getFieldByJsonName ( $ key ) ; <nl> if ( is_null ( $ field ) ) { <nl> protected function mergeFromJsonArray ( $ array ) <nl> continue ; <nl> } <nl> } <nl> - $ setter = $ field - > getSetter ( ) ; <nl> if ( $ field - > isMap ( ) ) { <nl> if ( is_null ( $ value ) ) { <nl> continue ; <nl> protected function mergeFromJsonArray ( $ array ) <nl> throw new \ Exception ( <nl> " Map value field element cannot be null . " ) ; <nl> } <nl> - $ proto_key = <nl> - $ this - > convertJsonValueToProtoValue ( <nl> - $ tmp_key , <nl> - $ key_field , <nl> - true ) ; <nl> - $ proto_value = <nl> - $ this - > convertJsonValueToProtoValue ( <nl> - $ tmp_value , <nl> - $ value_field ) ; <nl> + $ proto_key = $ this - > convertJsonValueToProtoValue ( <nl> + $ tmp_key , <nl> + $ key_field , <nl> + true ) ; <nl> + $ proto_value = $ this - > convertJsonValueToProtoValue ( <nl> + $ tmp_value , <nl> + $ value_field ) ; <nl> self : : kvUpdateHelper ( $ field , $ proto_key , $ proto_value ) ; <nl> } <nl> } else if ( $ field - > isRepeated ( ) ) { <nl> protected function mergeFromJsonArray ( $ array ) <nl> throw new \ Exception ( <nl> " Repeated field elements cannot be null . " ) ; <nl> } <nl> - $ proto_value = <nl> - $ this - > convertJsonValueToProtoValue ( $ tmp , $ field ) ; <nl> + $ proto_value = $ this - > convertJsonValueToProtoValue ( <nl> + $ tmp , <nl> + $ field ) ; <nl> self : : appendHelper ( $ field , $ proto_value ) ; <nl> } <nl> } else { <nl> $ setter = $ field - > getSetter ( ) ; <nl> - $ proto_value = <nl> - $ this - > convertJsonValueToProtoValue ( $ value , $ field ) ; <nl> + $ proto_value = $ this - > convertJsonValueToProtoValue ( <nl> + $ value , <nl> + $ field ) ; <nl> if ( $ field - > getType ( ) = = = GPBType : : MESSAGE ) { <nl> if ( is_null ( $ proto_value ) ) { <nl> continue ; <nl> mmm a / php / src / Google / Protobuf / Internal / MessageOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / MessageOptions . php <nl> class MessageOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type bool $ message_set_wire_format <nl> + * Set true to use the old proto1 MessageSet wire format for extensions . <nl> + * This is provided for backwards - compatibility with the MessageSet wire <nl> + * format . You should not use this for any other reason : It ' s less <nl> + * efficient , has fewer features , and is more complicated . <nl> + * The message must be defined exactly as follows : <nl> + * message Foo { <nl> + * option message_set_wire_format = true ; <nl> + * extensions 4 to max ; <nl> + * } <nl> + * Note that the message cannot have any defined fields ; MessageSets only <nl> + * have extensions . <nl> + * All extensions of your type must be singular messages ; e . g . they cannot <nl> + * be int32s , enums , or repeated messages . <nl> + * Because this is an option , the above two restrictions are not enforced by <nl> + * the protocol compiler . <nl> + * @ type bool $ no_standard_descriptor_accessor <nl> + * Disables the generation of the standard " descriptor ( ) " accessor , which can <nl> + * conflict with a field of the same name . This is meant to make migration <nl> + * from proto1 easier ; new code should avoid fields named " descriptor " . <nl> + * @ type bool $ deprecated <nl> + * Is this message deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for the message , or it will be completely ignored ; in the very least , <nl> + * this is a formalization for deprecating messages . <nl> + * @ type bool $ map_entry <nl> + * Whether the message is an automatically generated map entry type for the <nl> + * maps field . <nl> + * For maps fields : <nl> + * map < KeyType , ValueType > map_field = 1 ; <nl> + * The parsed descriptor looks like : <nl> + * message MapFieldEntry { <nl> + * option map_entry = true ; <nl> + * optional KeyType key = 1 ; <nl> + * optional ValueType value = 2 ; <nl> + * } <nl> + * repeated MapFieldEntry map_field = 1 ; <nl> + * Implementations may choose not to generate the map_entry = true message , but <nl> + * use a native map in the target language to hold the keys and values . <nl> + * The reflection APIs in such implementions still need to work as <nl> + * if the field is a repeated message field . <nl> + * NOTE : Do not set the option in . proto files . Always use the maps syntax <nl> + * instead . The option should only be implicitly set by the proto compiler <nl> + * parser . <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / MethodDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / MethodDescriptorProto . php <nl> class MethodDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ server_streaming = false ; <nl> private $ has_server_streaming = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type string $ input_type <nl> + * Input and output type names . These are resolved in the same way as <nl> + * FieldDescriptorProto . type_name , but must refer to a message type . <nl> + * @ type string $ output_type <nl> + * @ type \ Google \ Protobuf \ Internal \ MethodOptions $ options <nl> + * @ type bool $ client_streaming <nl> + * Identifies if client streams multiple client messages <nl> + * @ type bool $ server_streaming <nl> + * Identifies if server streams multiple server messages <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / MethodOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / MethodOptions . php <nl> class MethodOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type bool $ deprecated <nl> + * Is this method deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for the method , or it will be completely ignored ; in the very least , <nl> + * this is a formalization for deprecating methods . <nl> + * @ type int $ idempotency_level <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> similarity index 70 % <nl> rename from php / src / Google / Protobuf / Internal / MethodOptions_IdempotencyLevel . php <nl> rename to php / src / Google / Protobuf / Internal / MethodOptions / IdempotencyLevel . php <nl> mmm a / php / src / Google / Protobuf / Internal / MethodOptions_IdempotencyLevel . php <nl> ppp b / php / src / Google / Protobuf / Internal / MethodOptions / IdempotencyLevel . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ MethodOptions ; <nl> <nl> / * * <nl> * Is this method side - effect - free ( or safe in HTTP parlance ) , or idempotent , <nl> * or neither ? HTTP based RPC implementation may choose GET verb for safe <nl> * methods , and PUT verb for idempotent methods instead of the default POST . <nl> * <nl> - * Protobuf enum < code > Google \ Protobuf \ Internal < / code > <nl> + * Protobuf type < code > google . protobuf . MethodOptions . IdempotencyLevel < / code > <nl> * / <nl> - class MethodOptions_IdempotencyLevel <nl> + class IdempotencyLevel <nl> { <nl> / * * <nl> * Generated from protobuf enum < code > IDEMPOTENCY_UNKNOWN = 0 ; < / code > <nl> class MethodOptions_IdempotencyLevel <nl> const IDEMPOTENT = 2 ; <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( IdempotencyLevel : : class , \ Google \ Protobuf \ Internal \ MethodOptions_IdempotencyLevel : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / OneofDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / OneofDescriptorProto . php <nl> class OneofDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ options = null ; <nl> private $ has_options = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type \ Google \ Protobuf \ Internal \ OneofOptions $ options <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / OneofOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / OneofOptions . php <nl> class OneofOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / ServiceDescriptorProto . php <nl> ppp b / php / src / Google / Protobuf / Internal / ServiceDescriptorProto . php <nl> class ServiceDescriptorProto extends \ Google \ Protobuf \ Internal \ Message <nl> private $ options = null ; <nl> private $ has_options = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * @ type \ Google \ Protobuf \ Internal \ MethodDescriptorProto [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ method <nl> + * @ type \ Google \ Protobuf \ Internal \ ServiceOptions $ options <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / ServiceOptions . php <nl> ppp b / php / src / Google / Protobuf / Internal / ServiceOptions . php <nl> class ServiceOptions extends \ Google \ Protobuf \ Internal \ Message <nl> private $ uninterpreted_option ; <nl> private $ has_uninterpreted_option = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type bool $ deprecated <nl> + * Is this service deprecated ? <nl> + * Depending on the target platform , this can emit Deprecated annotations <nl> + * for the service , or it will be completely ignored ; in the very least , <nl> + * this is a formalization for deprecating services . <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ uninterpreted_option <nl> + * The parser stores options it doesn ' t recognize here . See above . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Internal / SourceCodeInfo . php <nl> ppp b / php / src / Google / Protobuf / Internal / SourceCodeInfo . php <nl> class SourceCodeInfo extends \ Google \ Protobuf \ Internal \ Message <nl> private $ location ; <nl> private $ has_location = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Internal \ SourceCodeInfo \ Location [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ location <nl> + * A Location identifies a piece of source code in a . proto file which <nl> + * corresponds to a particular definition . This information is intended <nl> + * to be useful to IDEs , code indexers , documentation generators , and similar <nl> + * tools . <nl> + * For example , say we have a file like : <nl> + * message Foo { <nl> + * optional string foo = 1 ; <nl> + * } <nl> + * Let ' s look at just the field definition : <nl> + * optional string foo = 1 ; <nl> + * ^ ^ ^ ^ ^ ^ ^ ^ ^ <nl> + * a bc de f ghi <nl> + * We have the following locations : <nl> + * span path represents <nl> + * [ a , i ) [ 4 , 0 , 2 , 0 ] The whole field definition . <nl> + * [ a , b ) [ 4 , 0 , 2 , 0 , 4 ] The label ( optional ) . <nl> + * [ c , d ) [ 4 , 0 , 2 , 0 , 5 ] The type ( string ) . <nl> + * [ e , f ) [ 4 , 0 , 2 , 0 , 1 ] The name ( foo ) . <nl> + * [ g , h ) [ 4 , 0 , 2 , 0 , 3 ] The number ( 1 ) . <nl> + * Notes : <nl> + * - A location may refer to a repeated field itself ( i . e . not to any <nl> + * particular index within it ) . This is used whenever a set of elements are <nl> + * logically enclosed in a single code segment . For example , an entire <nl> + * extend block ( possibly containing multiple extension definitions ) will <nl> + * have an outer location whose path refers to the " extensions " repeated <nl> + * field without an index . <nl> + * - Multiple locations may have the same path . This happens when a single <nl> + * logical declaration is spread out across multiple places . The most <nl> + * obvious example is the " extend " block again - - there may be multiple <nl> + * extend blocks in the same scope , each of which will have the same path . <nl> + * - A location ' s span is not always a subset of its parent ' s span . For <nl> + * example , the " extendee " of an extension declaration appears at the <nl> + * beginning of the " extend " block and is shared by all extensions within <nl> + * the block . <nl> + * - Just because a location ' s span is a subset of some other location ' s span <nl> + * does not mean that it is a descendent . For example , a " group " defines <nl> + * both a type and a field in a single declaration . Thus , the locations <nl> + * corresponding to the type and field and their components will overlap . <nl> + * - Code which tries to interpret locations should probably be designed to <nl> + * ignore those that it doesn ' t understand , as more types of locations could <nl> + * be recorded in the future . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function getLocation ( ) <nl> * be recorded in the future . <nl> * <nl> * Generated from protobuf field < code > repeated . google . protobuf . SourceCodeInfo . Location location = 1 ; < / code > <nl> - * @ param \ Google \ Protobuf \ Internal \ SourceCodeInfo_Location [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> + * @ param \ Google \ Protobuf \ Internal \ SourceCodeInfo \ Location [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> * @ return $ this <nl> * / <nl> public function setLocation ( $ var ) <nl> { <nl> - $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ SourceCodeInfo_Location : : class ) ; <nl> + $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ SourceCodeInfo \ Location : : class ) ; <nl> $ this - > location = $ arr ; <nl> $ this - > has_location = true ; <nl> <nl> similarity index 76 % <nl> rename from php / src / Google / Protobuf / Internal / SourceCodeInfo_Location . php <nl> rename to php / src / Google / Protobuf / Internal / SourceCodeInfo / Location . php <nl> mmm a / php / src / Google / Protobuf / Internal / SourceCodeInfo_Location . php <nl> ppp b / php / src / Google / Protobuf / Internal / SourceCodeInfo / Location . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ SourceCodeInfo ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ GPBWire ; <nl> <nl> / * * <nl> * Generated from protobuf message < code > google . protobuf . SourceCodeInfo . Location < / code > <nl> * / <nl> - class SourceCodeInfo_Location extends \ Google \ Protobuf \ Internal \ Message <nl> + class Location extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> * Identifies which part of the FileDescriptorProto was defined at this <nl> class SourceCodeInfo_Location extends \ Google \ Protobuf \ Internal \ Message <nl> private $ leading_detached_comments ; <nl> private $ has_leading_detached_comments = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ path <nl> + * Identifies which part of the FileDescriptorProto was defined at this <nl> + * location . <nl> + * Each element is a field number or an index . They form a path from <nl> + * the root FileDescriptorProto to the place where the definition . For <nl> + * example , this path : <nl> + * [ 4 , 3 , 2 , 7 , 1 ] <nl> + * refers to : <nl> + * file . message_type ( 3 ) / / 4 , 3 <nl> + * . field ( 7 ) / / 2 , 7 <nl> + * . name ( ) / / 1 <nl> + * This is because FileDescriptorProto . message_type has field number 4 : <nl> + * repeated DescriptorProto message_type = 4 ; <nl> + * and DescriptorProto . field has field number 2 : <nl> + * repeated FieldDescriptorProto field = 2 ; <nl> + * and FieldDescriptorProto . name has field number 1 : <nl> + * optional string name = 1 ; <nl> + * Thus , the above path gives the location of a field name . If we removed <nl> + * the last element : <nl> + * [ 4 , 3 , 2 , 7 ] <nl> + * this path refers to the whole field declaration ( from the beginning <nl> + * of the label to the terminating semicolon ) . <nl> + * @ type int [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ span <nl> + * Always has exactly three or four elements : start line , start column , <nl> + * end line ( optional , otherwise assumed same as start line ) , end column . <nl> + * These are packed into a single field for efficiency . Note that line <nl> + * and column numbers are zero - based - - typically you will want to add <nl> + * 1 to each before displaying to a user . <nl> + * @ type string $ leading_comments <nl> + * If this SourceCodeInfo represents a complete declaration , these are any <nl> + * comments appearing before and after the declaration which appear to be <nl> + * attached to the declaration . <nl> + * A series of line comments appearing on consecutive lines , with no other <nl> + * tokens appearing on those lines , will be treated as a single comment . <nl> + * leading_detached_comments will keep paragraphs of comments that appear <nl> + * before ( but not connected to ) the current element . Each paragraph , <nl> + * separated by empty lines , will be one comment element in the repeated <nl> + * field . <nl> + * Only the comment content is provided ; comment markers ( e . g . / / ) are <nl> + * stripped out . For block comments , leading whitespace and an asterisk <nl> + * will be stripped from the beginning of each line other than the first . <nl> + * Newlines are included in the output . <nl> + * Examples : <nl> + * optional int32 foo = 1 ; / / Comment attached to foo . <nl> + * / / Comment attached to bar . <nl> + * optional int32 bar = 2 ; <nl> + * optional string baz = 3 ; <nl> + * / / Comment attached to baz . <nl> + * / / Another line attached to baz . <nl> + * / / Comment attached to qux . <nl> + * / / <nl> + * / / Another line attached to qux . <nl> + * optional double qux = 4 ; <nl> + * / / Detached comment for corge . This is not leading or trailing comments <nl> + * / / to qux or corge because there are blank lines separating it from <nl> + * / / both . <nl> + * / / Detached comment for corge paragraph 2 . <nl> + * optional string corge = 5 ; <nl> + * / & # 42 ; Block comment attached <nl> + * * to corge . Leading asterisks <nl> + * * will be removed . * & # 47 ; <nl> + * / & # 42 ; Block comment attached to <nl> + * * grault . * & # 47 ; <nl> + * optional int32 grault = 6 ; <nl> + * / / ignored detached comments . <nl> + * @ type string $ trailing_comments <nl> + * @ type string [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ leading_detached_comments <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function hasLeadingDetachedComments ( ) <nl> <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( Location : : class , \ Google \ Protobuf \ Internal \ SourceCodeInfo_Location : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / Internal / UninterpretedOption . php <nl> ppp b / php / src / Google / Protobuf / Internal / UninterpretedOption . php <nl> class UninterpretedOption extends \ Google \ Protobuf \ Internal \ Message <nl> private $ aggregate_value = ' ' ; <nl> private $ has_aggregate_value = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Internal \ UninterpretedOption \ NamePart [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ name <nl> + * @ type string $ identifier_value <nl> + * The value of the uninterpreted option , in whatever type the tokenizer <nl> + * identified it as during parsing . Exactly one of these should be set . <nl> + * @ type int | string $ positive_int_value <nl> + * @ type int | string $ negative_int_value <nl> + * @ type float $ double_value <nl> + * @ type string $ string_value <nl> + * @ type string $ aggregate_value <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function getName ( ) <nl> <nl> / * * <nl> * Generated from protobuf field < code > repeated . google . protobuf . UninterpretedOption . NamePart name = 2 ; < / code > <nl> - * @ param \ Google \ Protobuf \ Internal \ UninterpretedOption_NamePart [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> + * @ param \ Google \ Protobuf \ Internal \ UninterpretedOption \ NamePart [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var <nl> * @ return $ this <nl> * / <nl> public function setName ( $ var ) <nl> { <nl> - $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ UninterpretedOption_NamePart : : class ) ; <nl> + $ arr = GPBUtil : : checkRepeatedField ( $ var , \ Google \ Protobuf \ Internal \ GPBType : : MESSAGE , \ Google \ Protobuf \ Internal \ UninterpretedOption \ NamePart : : class ) ; <nl> $ this - > name = $ arr ; <nl> $ this - > has_name = true ; <nl> <nl> similarity index 80 % <nl> rename from php / src / Google / Protobuf / Internal / UninterpretedOption_NamePart . php <nl> rename to php / src / Google / Protobuf / Internal / UninterpretedOption / NamePart . php <nl> mmm a / php / src / Google / Protobuf / Internal / UninterpretedOption_NamePart . php <nl> ppp b / php / src / Google / Protobuf / Internal / UninterpretedOption / NamePart . php <nl> <nl> # Generated by the protocol buffer compiler . DO NOT EDIT ! <nl> # source : google / protobuf / descriptor . proto <nl> <nl> - namespace Google \ Protobuf \ Internal ; <nl> + namespace Google \ Protobuf \ Internal \ UninterpretedOption ; <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ GPBWire ; <nl> <nl> * <nl> * Generated from protobuf message < code > google . protobuf . UninterpretedOption . NamePart < / code > <nl> * / <nl> - class UninterpretedOption_NamePart extends \ Google \ Protobuf \ Internal \ Message <nl> + class NamePart extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> / * * <nl> * Generated from protobuf field < code > required string name_part = 1 ; < / code > <nl> class UninterpretedOption_NamePart extends \ Google \ Protobuf \ Internal \ Message <nl> private $ is_extension = false ; <nl> private $ has_is_extension = false ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name_part <nl> + * @ type bool $ is_extension <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Internal \ Descriptor : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function hasIsExtension ( ) <nl> <nl> } <nl> <nl> + / / Adding a class alias for backwards compatibility with the previous class name . <nl> + class_alias ( NamePart : : class , \ Google \ Protobuf \ Internal \ UninterpretedOption_NamePart : : class ) ; <nl> + <nl> mmm a / php / src / Google / Protobuf / ListValue . php <nl> ppp b / php / src / Google / Protobuf / ListValue . php <nl> class ListValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ values ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type \ Google \ Protobuf \ Value [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ values <nl> + * Repeated field of dynamically typed values . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Struct : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Method . php <nl> ppp b / php / src / Google / Protobuf / Method . php <nl> class Method extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ syntax = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * The simple name of this method . <nl> + * @ type string $ request_type_url <nl> + * A URL of the input message type . <nl> + * @ type bool $ request_streaming <nl> + * If true , the request is streamed . <nl> + * @ type string $ response_type_url <nl> + * The URL of the output message type . <nl> + * @ type bool $ response_streaming <nl> + * If true , the response is streamed . <nl> + * @ type \ Google \ Protobuf \ Option [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ options <nl> + * Any metadata attached to the method . <nl> + * @ type int $ syntax <nl> + * The source syntax of this method . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Api : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Mixin . php <nl> ppp b / php / src / Google / Protobuf / Mixin . php <nl> class Mixin extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ root = ' ' ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * The fully qualified name of the interface which is included . <nl> + * @ type string $ root <nl> + * If non - empty specifies a path under which inherited HTTP paths <nl> + * are rooted . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Api : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / NullValue . php <nl> ppp b / php / src / Google / Protobuf / NullValue . php <nl> <nl> * ` Value ` type union . <nl> * The JSON representation for ` NullValue ` is JSON ` null ` . <nl> * <nl> - * Protobuf enum < code > Google \ Protobuf \ NullValue < / code > <nl> + * Protobuf type < code > google . protobuf . NullValue < / code > <nl> * / <nl> class NullValue <nl> { <nl> mmm a / php / src / Google / Protobuf / Option . php <nl> ppp b / php / src / Google / Protobuf / Option . php <nl> class Option extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = null ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * The option ' s name . For protobuf built - in options ( options defined in <nl> + * descriptor . proto ) , this is the short name . For example , ` " map_entry " ` . <nl> + * For custom options , it should be the fully - qualified name . For example , <nl> + * ` " google . api . http " ` . <nl> + * @ type \ Google \ Protobuf \ Any $ value <nl> + * The option ' s value packed in an Any message . If the value is a primitive , <nl> + * the corresponding wrapper type defined in google / protobuf / wrappers . proto <nl> + * should be used . If the value is an enum , it should be stored as an int32 <nl> + * value using the google . protobuf . Int32Value type . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Type : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / SourceContext . php <nl> ppp b / php / src / Google / Protobuf / SourceContext . php <nl> class SourceContext extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ file_name = ' ' ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ file_name <nl> + * The path - qualified name of the . proto file that contained the associated <nl> + * protobuf element . For example : ` " google / protobuf / source_context . proto " ` . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ SourceContext : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / StringValue . php <nl> ppp b / php / src / Google / Protobuf / StringValue . php <nl> class StringValue extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = ' ' ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ value <nl> + * The string value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Struct . php <nl> ppp b / php / src / Google / Protobuf / Struct . php <nl> class Struct extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ fields ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type array | \ Google \ Protobuf \ Internal \ MapField $ fields <nl> + * Unordered map of dynamically typed values . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Struct : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Syntax . php <nl> ppp b / php / src / Google / Protobuf / Syntax . php <nl> <nl> / * * <nl> * The syntax in which a protocol buffer element is defined . <nl> * <nl> - * Protobuf enum < code > Google \ Protobuf \ Syntax < / code > <nl> + * Protobuf type < code > google . protobuf . Syntax < / code > <nl> * / <nl> class Syntax <nl> { <nl> mmm a / php / src / Google / Protobuf / Timestamp . php <nl> ppp b / php / src / Google / Protobuf / Timestamp . php <nl> class Timestamp extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ nanos = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int | string $ seconds <nl> + * Represents seconds of UTC time since Unix epoch <nl> + * 1970 - 01 - 01T00 : 00 : 00Z . Must be from 0001 - 01 - 01T00 : 00 : 00Z to <nl> + * 9999 - 12 - 31T23 : 59 : 59Z inclusive . <nl> + * @ type int $ nanos <nl> + * Non - negative fractions of a second at nanosecond resolution . Negative <nl> + * second values with fractions must still have non - negative nanos values <nl> + * that count forward in time . Must be from 0 to 999 , 999 , 999 <nl> + * inclusive . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Timestamp : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> public function setNanos ( $ var ) <nl> return $ this ; <nl> } <nl> <nl> - / * * <nl> + / * <nl> * Converts PHP DateTime to Timestamp . <nl> * <nl> * @ param \ DateTime $ datetime <nl> mmm a / php / src / Google / Protobuf / Type . php <nl> ppp b / php / src / Google / Protobuf / Type . php <nl> class Type extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ syntax = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type string $ name <nl> + * The fully qualified message name . <nl> + * @ type \ Google \ Protobuf \ Field [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ fields <nl> + * The list of fields . <nl> + * @ type string [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ oneofs <nl> + * The list of types appearing in ` oneof ` definitions in this type . <nl> + * @ type \ Google \ Protobuf \ Option [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ options <nl> + * The protocol buffer options . <nl> + * @ type \ Google \ Protobuf \ SourceContext $ source_context <nl> + * The source context . <nl> + * @ type int $ syntax <nl> + * The source syntax . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Type : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / UInt32Value . php <nl> ppp b / php / src / Google / Protobuf / UInt32Value . php <nl> class UInt32Value extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ value <nl> + * The uint32 value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / UInt64Value . php <nl> ppp b / php / src / Google / Protobuf / UInt64Value . php <nl> class UInt64Value extends \ Google \ Protobuf \ Internal \ Message <nl> * / <nl> private $ value = 0 ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int | string $ value <nl> + * The uint64 value . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Wrappers : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / src / Google / Protobuf / Value . php <nl> ppp b / php / src / Google / Protobuf / Value . php <nl> class Value extends \ Google \ Protobuf \ Internal \ Message <nl> { <nl> protected $ kind ; <nl> <nl> - public function __construct ( ) { <nl> + / * * <nl> + * Constructor . <nl> + * <nl> + * @ param array $ data { <nl> + * Optional . Data for populating the Message object . <nl> + * <nl> + * @ type int $ null_value <nl> + * Represents a null value . <nl> + * @ type float $ number_value <nl> + * Represents a double value . <nl> + * @ type string $ string_value <nl> + * Represents a string value . <nl> + * @ type bool $ bool_value <nl> + * Represents a boolean value . <nl> + * @ type \ Google \ Protobuf \ Struct $ struct_value <nl> + * Represents a structured value . <nl> + * @ type \ Google \ Protobuf \ ListValue $ list_value <nl> + * Represents a repeated ` Value ` . <nl> + * } <nl> + * / <nl> + public function __construct ( $ data = NULL ) { <nl> \ GPBMetadata \ Google \ Protobuf \ Struct : : initOnce ( ) ; <nl> - parent : : __construct ( ) ; <nl> + parent : : __construct ( $ data ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / tests / array_test . php <nl> ppp b / php / tests / array_test . php <nl> <nl> use Google \ Protobuf \ Internal \ RepeatedField ; <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> <nl> class RepeatedFieldTest extends PHPUnit_Framework_TestCase <nl> { <nl> public function testString ( ) <nl> <nl> public function testMessage ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> <nl> / / Test append . <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ sub_m - > setA ( 1 ) ; <nl> $ arr [ ] = $ sub_m ; <nl> $ this - > assertSame ( 1 , $ arr [ 0 ] - > getA ( ) ) ; <nl> public function testMessage ( ) <nl> $ this - > assertEquals ( 1 , count ( $ arr ) ) ; <nl> <nl> / / Test set . <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ sub_m - > setA ( 2 ) ; <nl> $ arr [ 0 ] = $ sub_m ; <nl> $ this - > assertSame ( 2 , $ arr [ 0 ] - > getA ( ) ) ; <nl> <nl> / / Test foreach . <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> for ( $ i = 0 ; $ i < 3 ; $ i + + ) { <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> $ arr [ $ i ] - > setA ( $ i ) ; <nl> } <nl> $ i = 0 ; <nl> mmm a / php / tests / descriptors_test . php <nl> ppp b / php / tests / descriptors_test . php <nl> <nl> use Google \ Protobuf \ Internal \ MapField ; <nl> use Descriptors \ TestDescriptorsEnum ; <nl> use Descriptors \ TestDescriptorsMessage ; <nl> - use Descriptors \ TestDescriptorsMessage_Sub ; <nl> + use Descriptors \ TestDescriptorsMessage \ Sub ; <nl> <nl> class DescriptorsTest extends TestBase <nl> { <nl> mmm a / php / tests / encode_decode_test . php <nl> ppp b / php / tests / encode_decode_test . php <nl> <nl> use Google \ Protobuf \ GPBType ; <nl> use Foo \ TestEnum ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> use Foo \ TestPackedMessage ; <nl> use Foo \ TestRandomFieldOrder ; <nl> use Foo \ TestUnpackedMessage ; <nl> public function testEncodeDecodeOneof ( ) <nl> $ n - > mergeFromString ( $ data ) ; <nl> $ this - > assertSame ( ' abc ' , $ n - > getOneofString ( ) ) ; <nl> <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ sub_m - > setA ( 1 ) ; <nl> $ m - > setOneofMessage ( $ sub_m ) ; <nl> $ data = $ m - > serializeToString ( ) ; <nl> public function testEncodeDecodeOneof ( ) <nl> $ this - > assertSame ( " oneof_string " , $ n - > getMyOneof ( ) ) ; <nl> $ this - > assertSame ( " " , $ n - > getOneofString ( ) ) ; <nl> <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ m - > setOneofMessage ( $ sub_m ) ; <nl> $ data = $ m - > serializeToString ( ) ; <nl> $ n = new TestMessage ( ) ; <nl> mmm a / php / tests / gdb_test . sh <nl> ppp b / php / tests / gdb_test . sh <nl> php - i | grep " Configuration " <nl> # gdb - - args php - dextension = . . / ext / google / protobuf / modules / protobuf . so ` which <nl> # phpunit ` - - bootstrap autoload . php tmp_test . php <nl> # <nl> - # gdb - - args php - dextension = . . / ext / google / protobuf / modules / protobuf . so ` which phpunit ` - - bootstrap autoload . php encode_decode_test . php <nl> + gdb - - args php - dextension = . . / ext / google / protobuf / modules / protobuf . so ` which phpunit ` - - bootstrap autoload . php generated_class_test . php <nl> # <nl> - gdb - - args php - dextension = . . / ext / google / protobuf / modules / protobuf . so memory_leak_test . php <nl> + # gdb - - args php - dextension = . . / ext / google / protobuf / modules / protobuf . so memory_leak_test . php <nl> # <nl> # USE_ZEND_ALLOC = 0 valgrind - - leak - check = yes php - dextension = . . / ext / google / protobuf / modules / protobuf . so memory_leak_test . php <nl> mmm a / php / tests / generated_class_test . php <nl> ppp b / php / tests / generated_class_test . php <nl> <nl> use Google \ Protobuf \ Internal \ RepeatedField ; <nl> use Google \ Protobuf \ Internal \ MapField ; <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> + use Bar \ TestLegacyMessage ; <nl> + use Bar \ TestLegacyMessage_NestedEnum ; <nl> + use Bar \ TestLegacyMessage_NestedMessage ; <nl> use Foo \ TestEnum ; <nl> use Foo \ TestIncludeNamespaceMessage ; <nl> use Foo \ TestIncludePrefixMessage ; <nl> use Foo \ TestMessage ; <nl> + use Foo \ TestMessage \ Sub ; <nl> use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ NestedEnum ; <nl> use Foo \ TestReverseFieldOrder ; <nl> use Foo \ testLowerCaseMessage ; <nl> use Foo \ testLowerCaseEnum ; <nl> + use PBEmpty \ PBEcho \ TestEmptyPackage ; <nl> use Php \ Test \ TestNamespace ; <nl> <nl> class GeneratedClassTest extends TestBase <nl> public function testEnumField ( ) <nl> } <nl> <nl> public function testNestedEnum ( ) <nl> + { <nl> + $ m = new TestMessage ( ) ; <nl> + $ m - > setOptionalNestedEnum ( NestedEnum : : ZERO ) ; <nl> + } <nl> + <nl> + public function testLegacyNestedEnum ( ) <nl> { <nl> $ m = new TestMessage ( ) ; <nl> $ m - > setOptionalNestedEnum ( \ Foo \ TestMessage_NestedEnum : : ZERO ) ; <nl> } <nl> <nl> + public function testLegacyTypehintWithNestedEnums ( ) <nl> + { <nl> + $ this - > legacyEnum ( new TestLegacyMessage \ NestedEnum ) ; <nl> + } <nl> + <nl> + private function legacyEnum ( TestLegacyMessage_NestedEnum $ enum ) <nl> + { <nl> + / / If we made it here without a PHP Fatal error , the typehint worked <nl> + $ this - > assertTrue ( true ) ; <nl> + } <nl> + <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # Test float field . <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> public function testMessageField ( ) <nl> { <nl> $ m = new TestMessage ( ) ; <nl> <nl> + $ sub_m = new Sub ( ) ; <nl> + $ sub_m - > setA ( 1 ) ; <nl> + $ m - > setOptionalMessage ( $ sub_m ) ; <nl> + $ this - > assertSame ( 1 , $ m - > getOptionalMessage ( ) - > getA ( ) ) ; <nl> + <nl> + $ null = null ; <nl> + $ m - > setOptionalMessage ( $ null ) ; <nl> + $ this - > assertNull ( $ m - > getOptionalMessage ( ) ) ; <nl> + } <nl> + <nl> + public function testLegacyMessageField ( ) <nl> + { <nl> + $ m = new TestMessage ( ) ; <nl> + <nl> $ sub_m = new TestMessage_Sub ( ) ; <nl> $ sub_m - > setA ( 1 ) ; <nl> $ m - > setOptionalMessage ( $ sub_m ) ; <nl> public function testMessageField ( ) <nl> $ this - > assertNull ( $ m - > getOptionalMessage ( ) ) ; <nl> } <nl> <nl> + public function testLegacyTypehintWithNestedMessages ( ) <nl> + { <nl> + $ this - > legacyMessage ( new TestLegacyMessage \ NestedMessage ) ; <nl> + } <nl> + <nl> + private function legacyMessage ( TestLegacyMessage_NestedMessage $ sub ) <nl> + { <nl> + / / If we made it here without a PHP Fatal error , the typehint worked <nl> + $ this - > assertTrue ( true ) ; <nl> + } <nl> + <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> # Test repeated field . <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> public function testOneofField ( ) { <nl> $ this - > assertSame ( NULL , $ m - > getOneofMessage ( ) ) ; <nl> $ this - > assertSame ( " oneof_string " , $ m - > getMyOneof ( ) ) ; <nl> <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ sub_m - > setA ( 1 ) ; <nl> $ m - > setOneofMessage ( $ sub_m ) ; <nl> $ this - > assertSame ( 0 , $ m - > getOneofInt32 ( ) ) ; <nl> public function testMessageMergeFrom ( ) <nl> <nl> / / Singular <nl> $ n - > setOptionalInt32 ( 100 ) ; <nl> - $ sub1 = new TestMessage_Sub ( ) ; <nl> + $ sub1 = new Sub ( ) ; <nl> $ sub1 - > setA ( 101 ) ; <nl> <nl> $ b = $ sub1 - > getB ( ) ; <nl> public function testMessageMergeFrom ( ) <nl> $ repeatedString [ ] = ' abc ' ; <nl> $ n - > setRepeatedString ( $ repeatedString ) ; <nl> <nl> - $ sub2 = new TestMessage_Sub ( ) ; <nl> + $ sub2 = new Sub ( ) ; <nl> $ sub2 - > setA ( 201 ) ; <nl> $ repeatedMessage = $ n - > getRepeatedMessage ( ) ; <nl> $ repeatedMessage [ ] = $ sub2 ; <nl> public function testMessageMergeFrom ( ) <nl> $ n - > setMapStringString ( $ mapStringString ) ; <nl> <nl> $ mapInt32Message = $ n - > getMapInt32Message ( ) ; <nl> - $ mapInt32Message [ 1 ] = new TestMessage_Sub ( ) ; <nl> + $ mapInt32Message [ 1 ] = new Sub ( ) ; <nl> $ mapInt32Message [ 1 ] - > setA ( 302 ) ; <nl> - $ mapInt32Message [ 2 ] = new TestMessage_Sub ( ) ; <nl> + $ mapInt32Message [ 2 ] = new Sub ( ) ; <nl> $ mapInt32Message [ 2 ] - > setA ( 303 ) ; <nl> $ n - > setMapInt32Message ( $ mapInt32Message ) ; <nl> <nl> public function testMessageMergeFrom ( ) <nl> $ m - > mergeFrom ( $ n ) ; <nl> $ this - > assertSame ( 1 , $ m - > getOneofInt32 ( ) ) ; <nl> <nl> - $ sub = new TestMessage_Sub ( ) ; <nl> + $ sub = new Sub ( ) ; <nl> $ n - > setOneofMessage ( $ sub ) ; <nl> $ n - > getOneofMessage ( ) - > setA ( 400 ) ; <nl> $ m - > mergeFrom ( $ n ) ; <nl> public function testMessageMergeFrom ( ) <nl> public function testMessageWithoutNamespace ( ) <nl> { <nl> $ m = new TestMessage ( ) ; <nl> - $ sub = new NoNameSpaceMessage ( ) ; <nl> - $ m - > setOptionalNoNamespaceMessage ( $ sub ) ; <nl> + $ n = new NoNameSpaceMessage ( ) ; <nl> + $ m - > setOptionalNoNamespaceMessage ( $ n ) ; <nl> $ repeatedNoNamespaceMessage = $ m - > getRepeatedNoNamespaceMessage ( ) ; <nl> $ repeatedNoNamespaceMessage [ ] = new NoNameSpaceMessage ( ) ; <nl> $ m - > setRepeatedNoNamespaceMessage ( $ repeatedNoNamespaceMessage ) ; <nl> <nl> - $ n = new NoNamespaceMessage ( ) ; <nl> - $ n - > setB ( NoNamespaceMessage_NestedEnum : : ZERO ) ; <nl> + / / test nested messages <nl> + $ sub = new NoNamespaceMessage \ NestedMessage ( ) ; <nl> + $ n - > setNestedMessage ( $ sub ) ; <nl> } <nl> <nl> public function testEnumWithoutNamespace ( ) <nl> public function testEnumWithoutNamespace ( ) <nl> } <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Test message with given prefix . <nl> + # Test message with given namespace . <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> <nl> - public function testPrefixMessage ( ) <nl> + public function testNestedMessagesAndEnums ( ) <nl> { <nl> + $ m = new TestMessage ( ) ; <nl> + $ n = new TestMessage \ Sub ( ) ; <nl> + $ m - > setOptionalMessage ( $ n ) ; <nl> + $ m - > setOptionalNestedEnum ( TestMessage \ NestedEnum : : ZERO ) ; <nl> + $ this - > assertSame ( $ n , $ m - > getOptionalMessage ( ) ) ; <nl> + $ this - > assertSame ( TestMessage \ NestedEnum : : ZERO , $ m - > getOptionalNestedEnum ( ) ) ; <nl> + } <nl> + <nl> + public function testMessagesAndEnumsWithPrefix ( ) <nl> + { <nl> + / / Test message prefix <nl> $ m = new TestIncludePrefixMessage ( ) ; <nl> $ n = new PrefixTestPrefix ( ) ; <nl> $ n - > setA ( 1 ) ; <nl> $ m - > setPrefixMessage ( $ n ) ; <nl> $ this - > assertSame ( 1 , $ m - > getPrefixMessage ( ) - > getA ( ) ) ; <nl> + <nl> + / / Test nested message prefix <nl> + $ o = new PrefixTestPrefix ( ) ; <nl> + $ p = new PrefixTestPrefix \ PrefixNestedMessage ( ) ; <nl> + $ o - > setNestedMessage ( $ p ) ; <nl> + $ o - > setNestedEnum ( PrefixTestPrefix \ PrefixNestedEnum : : ZERO ) ; <nl> + $ this - > assertSame ( $ p , $ o - > getNestedMessage ( ) ) ; <nl> + $ this - > assertSame ( PrefixTestPrefix \ PrefixNestedEnum : : ZERO , $ o - > getNestedEnum ( ) ) ; <nl> } <nl> <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> - # Test message with given namespace . <nl> - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + public function testMessagesAndEnumsWithPhpNamespace ( ) <nl> + { <nl> + $ m = new TestNamespace ( ) ; <nl> + $ n = new TestNamespace \ NestedMessage ( ) ; <nl> + $ m - > setNestedMessage ( $ n ) ; <nl> + $ m - > setNestedEnum ( TestNamespace \ NestedEnum : : ZERO ) ; <nl> + $ this - > assertSame ( $ n , $ m - > getNestedMessage ( ) ) ; <nl> + $ this - > assertSame ( TestNamespace \ NestedEnum : : ZERO , $ m - > getNestedEnum ( ) ) ; <nl> + } <nl> <nl> - public function testNamespaceMessage ( ) <nl> + public function testMesssagesAndEnumsWithEmptyPhpNamespace ( ) <nl> { <nl> - $ m = new TestIncludeNamespaceMessage ( ) ; <nl> + $ m = new TestEmptyNamespace ( ) ; <nl> + $ n = new TestEmptyNamespace \ NestedMessage ( ) ; <nl> + $ m - > setNestedMessage ( $ n ) ; <nl> + $ m - > setNestedEnum ( TestEmptyNamespace \ NestedEnum : : ZERO ) ; <nl> + $ this - > assertSame ( $ n , $ m - > getNestedMessage ( ) ) ; <nl> + $ this - > assertSame ( TestEmptyNamespace \ NestedEnum : : ZERO , $ m - > getNestedEnum ( ) ) ; <nl> + } <nl> <nl> - $ n = new TestNamespace ( ) ; <nl> - $ n - > setA ( 1 ) ; <nl> - $ m - > setNamespaceMessage ( $ n ) ; <nl> - $ this - > assertSame ( 1 , $ m - > getNamespaceMessage ( ) - > getA ( ) ) ; <nl> + public function testMessagesAndEnumsWithNoNamespace ( ) <nl> + { <nl> + $ m = new NoNamespaceMessage ( ) ; <nl> + $ n = new NoNamespaceMessage \ NestedMessage ( ) ; <nl> + $ m - > setNestedMessage ( $ n ) ; <nl> + $ m - > setNestedEnum ( NoNamespaceMessage \ NestedEnum : : ZERO ) ; <nl> + $ this - > assertSame ( $ n , $ m - > getNestedMessage ( ) ) ; <nl> + $ this - > assertSame ( NoNamespaceMessage \ NestedEnum : : ZERO , $ m - > getNestedEnum ( ) ) ; <nl> + } <nl> <nl> - $ n = new TestEmptyNamespace ( ) ; <nl> - $ n - > setA ( 1 ) ; <nl> - $ m - > setEmptyNamespaceMessage ( $ n ) ; <nl> - $ this - > assertSame ( 1 , $ m - > getEmptyNamespaceMessage ( ) - > getA ( ) ) ; <nl> + public function testReservedWordsInPackageName ( ) <nl> + { <nl> + $ m = new TestEmptyPackage ( ) ; <nl> + $ n = new TestEmptyPackage \ NestedMessage ( ) ; <nl> + $ m - > setNestedMessage ( $ n ) ; <nl> + $ m - > setNestedEnum ( TestEmptyPackage \ NestedEnum : : ZERO ) ; <nl> + $ this - > assertSame ( $ n , $ m - > getNestedMessage ( ) ) ; <nl> + $ this - > assertSame ( TestEmptyPackage \ NestedEnum : : ZERO , $ m - > getNestedEnum ( ) ) ; <nl> + } <nl> + <nl> + public function testReservedWordsInNamespace ( ) <nl> + { <nl> + $ m = new TestNamespace ( ) ; <nl> + $ n = new TestNamespace \ PBEmpty ( ) ; <nl> + $ o = new TestNamespace \ PBEmpty \ NestedMessage ( ) ; <nl> + $ n - > setNestedMessage ( $ o ) ; <nl> + $ n - > setNestedEnum ( TestNamespace \ PBEmpty \ NestedEnum : : ZERO ) ; <nl> + $ m - > setReservedName ( $ n ) ; <nl> + $ this - > assertSame ( $ n , $ m - > getReservedName ( ) ) ; <nl> + $ this - > assertSame ( $ o , $ n - > getNestedMessage ( ) ) ; <nl> + $ this - > assertSame ( <nl> + TestNamespace \ PBEmpty \ NestedEnum : : ZERO , <nl> + $ n - > getNestedEnum ( ) <nl> + ) ; <nl> } <nl> <nl> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> public function testNamespaceMessage ( ) <nl> <nl> public function testPrefixForReservedWords ( ) <nl> { <nl> - $ m = new \ Foo \ TestMessage_Empty ( ) ; <nl> + $ m = new \ Foo \ TestMessage \ PBEmpty ( ) ; <nl> $ m = new \ Foo \ PBEmpty ( ) ; <nl> $ m = new \ PrefixEmpty ( ) ; <nl> $ m = new \ Foo \ PBARRAY ( ) ; <nl> public function testLowerCase ( ) <nl> $ m = new testLowerCaseMessage ( ) ; <nl> $ n = testLowerCaseEnum : : VALUE ; <nl> } <nl> + <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + # Test Array Constructor . <nl> + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # <nl> + <nl> + public function testArrayConstructor ( ) <nl> + { <nl> + $ m = new TestMessage ( [ <nl> + ' optional_int32 ' = > - 42 , <nl> + ' optional_int64 ' = > - 43 , <nl> + ' optional_uint32 ' = > 42 , <nl> + ' optional_uint64 ' = > 43 , <nl> + ' optional_sint32 ' = > - 44 , <nl> + ' optional_sint64 ' = > - 45 , <nl> + ' optional_fixed32 ' = > 46 , <nl> + ' optional_fixed64 ' = > 47 , <nl> + ' optional_sfixed32 ' = > - 46 , <nl> + ' optional_sfixed64 ' = > - 47 , <nl> + ' optional_float ' = > 1 . 5 , <nl> + ' optional_double ' = > 1 . 6 , <nl> + ' optional_bool ' = > true , <nl> + ' optional_string ' = > ' a ' , <nl> + ' optional_bytes ' = > ' b ' , <nl> + ' optional_enum ' = > TestEnum : : ONE , <nl> + ' optional_message ' = > new Sub ( [ <nl> + ' a ' = > 33 <nl> + ] ) , <nl> + ' repeated_int32 ' = > [ - 42 , - 52 ] , <nl> + ' repeated_int64 ' = > [ - 43 , - 53 ] , <nl> + ' repeated_uint32 ' = > [ 42 , 52 ] , <nl> + ' repeated_uint64 ' = > [ 43 , 53 ] , <nl> + ' repeated_sint32 ' = > [ - 44 , - 54 ] , <nl> + ' repeated_sint64 ' = > [ - 45 , - 55 ] , <nl> + ' repeated_fixed32 ' = > [ 46 , 56 ] , <nl> + ' repeated_fixed64 ' = > [ 47 , 57 ] , <nl> + ' repeated_sfixed32 ' = > [ - 46 , - 56 ] , <nl> + ' repeated_sfixed64 ' = > [ - 47 , - 57 ] , <nl> + ' repeated_float ' = > [ 1 . 5 , 2 . 5 ] , <nl> + ' repeated_double ' = > [ 1 . 6 , 2 . 6 ] , <nl> + ' repeated_bool ' = > [ true , false ] , <nl> + ' repeated_string ' = > [ ' a ' , ' c ' ] , <nl> + ' repeated_bytes ' = > [ ' b ' , ' d ' ] , <nl> + ' repeated_enum ' = > [ TestEnum : : ZERO , TestEnum : : ONE ] , <nl> + ' repeated_message ' = > [ new Sub ( [ ' a ' = > 34 ] ) , <nl> + new Sub ( [ ' a ' = > 35 ] ) ] , <nl> + ' map_int32_int32 ' = > [ - 62 = > - 62 ] , <nl> + ' map_int64_int64 ' = > [ - 63 = > - 63 ] , <nl> + ' map_uint32_uint32 ' = > [ 62 = > 62 ] , <nl> + ' map_uint64_uint64 ' = > [ 63 = > 63 ] , <nl> + ' map_sint32_sint32 ' = > [ - 64 = > - 64 ] , <nl> + ' map_sint64_sint64 ' = > [ - 65 = > - 65 ] , <nl> + ' map_fixed32_fixed32 ' = > [ 66 = > 66 ] , <nl> + ' map_fixed64_fixed64 ' = > [ 67 = > 67 ] , <nl> + ' map_sfixed32_sfixed32 ' = > [ - 68 = > - 68 ] , <nl> + ' map_sfixed64_sfixed64 ' = > [ - 69 = > - 69 ] , <nl> + ' map_int32_float ' = > [ 1 = > 3 . 5 ] , <nl> + ' map_int32_double ' = > [ 1 = > 3 . 6 ] , <nl> + ' map_bool_bool ' = > [ true = > true ] , <nl> + ' map_string_string ' = > [ ' e ' = > ' e ' ] , <nl> + ' map_int32_bytes ' = > [ 1 = > ' f ' ] , <nl> + ' map_int32_enum ' = > [ 1 = > TestEnum : : ONE ] , <nl> + ' map_int32_message ' = > [ 1 = > new Sub ( [ ' a ' = > 36 ] ) ] , <nl> + ] ) ; <nl> + <nl> + TestUtil : : assertTestMessage ( $ m ) ; <nl> + } <nl> } <nl> mmm a / php / tests / generated_phpdoc_test . php <nl> ppp b / php / tests / generated_phpdoc_test . php <nl> public function testPhpDocForClass ( ) <nl> $ this - > assertContains ( ' foo . TestMessage ' , $ doc ) ; <nl> } <nl> <nl> + public function testPhpDocForConstructor ( ) <nl> + { <nl> + $ class = new ReflectionClass ( ' Foo \ TestMessage ' ) ; <nl> + $ doc = $ class - > getMethod ( ' __construct ' ) - > getDocComment ( ) ; <nl> + $ this - > assertContains ( ' @ param array $ data ' , $ doc ) ; <nl> + $ this - > assertContains ( ' @ type int $ optional_int32 ' , $ doc ) ; <nl> + } <nl> + <nl> / * * <nl> * @ dataProvider providePhpDocForGettersAndSetters <nl> * / <nl> public function providePhpDocForGettersAndSetters ( ) <nl> [ <nl> ' setRepeatedMessage ' , <nl> ] , <nl> - ' @ param \ Foo \ TestMessage_Sub [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var ' <nl> + ' @ param \ Foo \ TestMessage \ Sub [ ] | \ Google \ Protobuf \ Internal \ RepeatedField $ var ' <nl> ] , <nl> [ <nl> [ <nl> public function providePhpDocForGettersAndSetters ( ) <nl> ' getOptionalMessage ' , <nl> ' getOneofMessage ' <nl> ] , <nl> - ' @ return \ Foo \ TestMessage_Sub ' <nl> + ' @ return \ Foo \ TestMessage \ Sub ' <nl> ] , <nl> [ <nl> [ <nl> ' setOptionalMessage ' , <nl> ' setOneofMessage ' <nl> ] , <nl> - ' @ param \ Foo \ TestMessage_Sub $ var ' <nl> + ' @ param \ Foo \ TestMessage \ Sub $ var ' <nl> ] , <nl> [ <nl> [ <nl> mmm a / php / tests / map_field_test . php <nl> ppp b / php / tests / map_field_test . php <nl> <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Google \ Protobuf \ Internal \ MapField ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> <nl> class MapFieldTest extends PHPUnit_Framework_TestCase { <nl> <nl> public function testString ( ) { <nl> <nl> public function testMessage ( ) { <nl> $ arr = new MapField ( GPBType : : INT32 , <nl> - GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + GPBType : : MESSAGE , Sub : : class ) ; <nl> <nl> / / Test append . <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ sub_m - > setA ( 1 ) ; <nl> $ arr [ 0 ] = $ sub_m ; <nl> $ this - > assertSame ( 1 , $ arr [ 0 ] - > getA ( ) ) ; <nl> public function testMessage ( ) { <nl> <nl> / / Test foreach . <nl> $ arr = new MapField ( GPBType : : INT32 , <nl> - GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + GPBType : : MESSAGE , Sub : : class ) ; <nl> for ( $ i = 0 ; $ i < 3 ; $ i + + ) { <nl> - $ arr [ $ i ] = new TestMessage_Sub ( ) ; ; <nl> + $ arr [ $ i ] = new Sub ( ) ; ; <nl> $ arr [ $ i ] - > setA ( $ i ) ; <nl> } <nl> $ i = 0 ; <nl> mmm a / php / tests / memory_leak_test . php <nl> ppp b / php / tests / memory_leak_test . php <nl> <nl> require_once ( ' generated / Foo / TestIncludeNamespaceMessage . php ' ) ; <nl> require_once ( ' generated / Foo / TestIncludePrefixMessage . php ' ) ; <nl> require_once ( ' generated / Foo / TestMessage . php ' ) ; <nl> - require_once ( ' generated / Foo / TestMessage_Empty . php ' ) ; <nl> - require_once ( ' generated / Foo / TestMessage_NestedEnum . php ' ) ; <nl> - require_once ( ' generated / Foo / TestMessage_Sub . php ' ) ; <nl> + require_once ( ' generated / Foo / TestMessage / PBEmpty . php ' ) ; <nl> + require_once ( ' generated / Foo / TestMessage / NestedEnum . php ' ) ; <nl> + require_once ( ' generated / Foo / TestMessage / Sub . php ' ) ; <nl> require_once ( ' generated / Foo / TestPackedMessage . php ' ) ; <nl> require_once ( ' generated / Foo / TestPhpDoc . php ' ) ; <nl> require_once ( ' generated / Foo / TestRandomFieldOrder . php ' ) ; <nl> <nl> use Google \ Protobuf \ Internal \ RepeatedField ; <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> <nl> $ from = new TestMessage ( ) ; <nl> TestUtil : : setTestMessage ( $ from ) ; <nl> <nl> $ n - > mergeFromString ( $ data ) ; <nl> assert ( ' abc ' = = = $ n - > getOneofString ( ) ) ; <nl> <nl> - $ sub_m = new TestMessage_Sub ( ) ; <nl> + $ sub_m = new Sub ( ) ; <nl> $ sub_m - > setA ( 1 ) ; <nl> $ m - > setOneofMessage ( $ sub_m ) ; <nl> assert ( 0 = = = $ m - > getOneofInt32 ( ) ) ; <nl> mmm a / php / tests / php_implementation_test . php <nl> ppp b / php / tests / php_implementation_test . php <nl> <nl> require_once ( ' test_base . php ' ) ; <nl> require_once ( ' test_util . php ' ) ; <nl> <nl> + use Foo \ TestEnum ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> use Foo \ TestPackedMessage ; <nl> use Google \ Protobuf \ Internal \ CodedInputStream ; <nl> use Google \ Protobuf \ Internal \ FileDescriptorSet ; <nl> <nl> <nl> class ImplementationTest extends TestBase <nl> { <nl> - <nl> public function testReadInt32 ( ) <nl> { <nl> $ value = null ; <nl> public function testPackedByteSize ( ) <nl> TestUtil : : setTestPackedMessage ( $ m ) ; <nl> $ this - > assertSame ( 166 , $ m - > byteSize ( ) ) ; <nl> } <nl> + <nl> + / * * <nl> + * @ expectedException UnexpectedValueException <nl> + * @ expectedExceptionMessage Invalid message property : optionalInt32 <nl> + * / <nl> + public function testArrayConstructorJsonCaseThrowsException ( ) <nl> + { <nl> + $ m = new TestMessage ( [ <nl> + ' optionalInt32 ' = > - 42 , <nl> + ] ) ; <nl> + } <nl> + <nl> + / * * <nl> + * @ expectedException Exception <nl> + * @ expectedExceptionMessage Expect Foo \ TestMessage_Sub . <nl> + * / <nl> + public function testArraysForMessagesThrowsException ( ) <nl> + { <nl> + $ m = new TestMessage ( [ <nl> + ' optional_message ' = > [ <nl> + ' a ' = > 33 <nl> + ] <nl> + ] ) ; <nl> + } <nl> + <nl> + public function testArrayConstructorWithNullValues ( ) <nl> + { <nl> + $ requestData = [ <nl> + ' optional_bool ' = > null , <nl> + ' optional_string ' = > null , <nl> + ' optional_bytes ' = > null , <nl> + ' optional_message ' = > null , <nl> + ] ; <nl> + <nl> + $ m = new TestMessage ( $ requestData ) ; <nl> + <nl> + $ this - > assertSame ( false , $ m - > getOptionalBool ( ) ) ; <nl> + $ this - > assertSame ( ' ' , $ m - > getOptionalString ( ) ) ; <nl> + $ this - > assertSame ( ' ' , $ m - > getOptionalBytes ( ) ) ; <nl> + $ this - > assertSame ( null , $ m - > getOptionalMessage ( ) ) ; <nl> + } <nl> + <nl> + / * * <nl> + * @ dataProvider provideArrayConstructorWithNullValuesThrowsException <nl> + * @ expectedException Exception <nl> + * / <nl> + public function testArrayConstructorWithNullValuesThrowsException ( $ requestData ) <nl> + { <nl> + $ m = new TestMessage ( $ requestData ) ; <nl> + } <nl> + <nl> + public function provideArrayConstructorWithNullValuesThrowsException ( ) <nl> + { <nl> + return [ <nl> + [ [ ' optional_int32 ' = > null ] ] , <nl> + [ [ ' optional_int64 ' = > null ] ] , <nl> + [ [ ' optional_uint32 ' = > null ] ] , <nl> + [ [ ' optional_uint64 ' = > null ] ] , <nl> + [ [ ' optional_sint32 ' = > null ] ] , <nl> + [ [ ' optional_sint64 ' = > null ] ] , <nl> + [ [ ' optional_fixed32 ' = > null ] ] , <nl> + [ [ ' optional_fixed64 ' = > null ] ] , <nl> + [ [ ' optional_sfixed32 ' = > null ] ] , <nl> + [ [ ' optional_sfixed64 ' = > null ] ] , <nl> + [ [ ' optional_float ' = > null ] ] , <nl> + [ [ ' optional_double ' = > null ] ] , <nl> + [ [ ' optional_enum ' = > null ] ] , <nl> + [ [ ' repeated_int32 ' = > null ] ] , <nl> + [ [ ' map_int32_int32 ' = > null ] ] , <nl> + ] ; <nl> + } <nl> } <nl> new file mode 100644 <nl> index 0000000000 . . 1817018dd2 <nl> mmm / dev / null <nl> ppp b / php / tests / proto / empty / echo . proto <nl> <nl> + syntax = " proto3 " ; <nl> + <nl> + package empty . echo ; <nl> + <nl> + message TestEmptyPackage { <nl> + int32 a = 1 ; <nl> + <nl> + / / Test nested messages , enums , and reserved names <nl> + NestedMessage nested_message = 2 ; <nl> + NestedEnum nested_enum = 3 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> + } <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } ; <nl> + } <nl> mmm a / php / tests / proto / test_empty_php_namespace . proto <nl> ppp b / php / tests / proto / test_empty_php_namespace . proto <nl> syntax = " proto3 " ; <nl> <nl> package foo ; <nl> option php_namespace = " " ; <nl> + option php_metadata_namespace = " " ; <nl> <nl> message TestEmptyNamespace { <nl> int32 a = 1 ; <nl> + <nl> + / / Test nested messages , enums , and reserved names <nl> + NestedMessage nested_message = 2 ; <nl> + NestedEnum nested_enum = 3 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> + } <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } ; <nl> } <nl> mmm a / php / tests / proto / test_include . proto <nl> ppp b / php / tests / proto / test_include . proto <nl> package bar ; <nl> message TestInclude { <nl> int32 a = 1 ; <nl> } <nl> + <nl> + message TestLegacyMessage { <nl> + NestedMessage message = 1 ; <nl> + NestedEnum enum = 2 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> + } <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } <nl> + } <nl> mmm a / php / tests / proto / test_no_namespace . proto <nl> ppp b / php / tests / proto / test_no_namespace . proto <nl> <nl> syntax = " proto3 " ; <nl> <nl> + option php_metadata_namespace = " \ \ " ; <nl> + <nl> message NoNamespaceMessage { <nl> int32 a = 1 ; <nl> <nl> - enum NestedEnum { <nl> - ZERO = 0 ; <nl> + / / Test nested messages , enums , and reserved names <nl> + NestedMessage nested_message = 2 ; <nl> + NestedEnum nested_enum = 3 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> } <nl> - NestedEnum b = 2 ; <nl> - repeated NestedEnum c = 3 ; <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } ; <nl> } <nl> <nl> enum NoNamespaceEnum { <nl> mmm a / php / tests / proto / test_php_namespace . proto <nl> ppp b / php / tests / proto / test_php_namespace . proto <nl> syntax = " proto3 " ; <nl> <nl> package foo ; <nl> option php_namespace = " Php \ \ Test " ; <nl> + option php_metadata_namespace = " Metadata \ \ Php \ \ Test " ; <nl> <nl> message TestNamespace { <nl> int32 a = 1 ; <nl> + <nl> + / / Test nested messages , enums , and reserved names <nl> + NestedMessage nested_message = 2 ; <nl> + NestedEnum nested_enum = 3 ; <nl> + Empty reserved_name = 4 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> + } <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } ; <nl> + / / Test reserved name <nl> + message Empty { <nl> + NestedMessage nested_message = 1 ; <nl> + NestedEnum nested_enum = 2 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> + } <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } ; <nl> + } <nl> } <nl> mmm a / php / tests / proto / test_prefix . proto <nl> ppp b / php / tests / proto / test_prefix . proto <nl> option php_class_prefix = " Prefix " ; <nl> <nl> message TestPrefix { <nl> int32 a = 1 ; <nl> + NestedMessage nested_message = 2 ; <nl> + NestedEnum nested_enum = 3 ; <nl> + message NestedMessage { <nl> + int32 a = 1 ; <nl> + } <nl> + enum NestedEnum { <nl> + ZERO = 0 ; <nl> + } ; <nl> } <nl> <nl> / / Test prefix for reserved words . <nl> mmm a / php / tests / test_base . php <nl> ppp b / php / tests / test_base . php <nl> <nl> <nl> use Foo \ TestMessage ; <nl> use Foo \ TestEnum ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> <nl> class TestBase extends PHPUnit_Framework_TestCase <nl> { <nl> mmm a / php / tests / test_util . php <nl> ppp b / php / tests / test_util . php <nl> <nl> <nl> use Foo \ TestEnum ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> use Foo \ TestPackedMessage ; <nl> use Foo \ TestUnpackedMessage ; <nl> <nl> public static function setTestMessage ( TestMessage $ m ) <nl> $ m - > setOptionalString ( ' a ' ) ; <nl> $ m - > setOptionalBytes ( ' b ' ) ; <nl> $ m - > setOptionalEnum ( TestEnum : : ONE ) ; <nl> - $ sub = new TestMessage_Sub ( ) ; <nl> + $ sub = new Sub ( ) ; <nl> $ m - > setOptionalMessage ( $ sub ) ; <nl> $ m - > getOptionalMessage ( ) - > SetA ( 33 ) ; <nl> <nl> public static function setTestMessage ( TestMessage $ m ) <nl> self : : appendHelper ( $ m , ' RepeatedString ' , ' a ' ) ; <nl> self : : appendHelper ( $ m , ' RepeatedBytes ' , ' b ' ) ; <nl> self : : appendHelper ( $ m , ' RepeatedEnum ' , TestEnum : : ZERO ) ; <nl> - self : : appendHelper ( $ m , ' RepeatedMessage ' , new TestMessage_Sub ( ) ) ; <nl> + self : : appendHelper ( $ m , ' RepeatedMessage ' , new Sub ( ) ) ; <nl> $ m - > getRepeatedMessage ( ) [ 0 ] - > setA ( 34 ) ; <nl> <nl> self : : appendHelper ( $ m , ' RepeatedInt32 ' , - 52 ) ; <nl> public static function setTestMessage ( TestMessage $ m ) <nl> self : : appendHelper ( $ m , ' RepeatedString ' , ' c ' ) ; <nl> self : : appendHelper ( $ m , ' RepeatedBytes ' , ' d ' ) ; <nl> self : : appendHelper ( $ m , ' RepeatedEnum ' , TestEnum : : ONE ) ; <nl> - self : : appendHelper ( $ m , ' RepeatedMessage ' , new TestMessage_Sub ( ) ) ; <nl> + self : : appendHelper ( $ m , ' RepeatedMessage ' , new Sub ( ) ) ; <nl> $ m - > getRepeatedMessage ( ) [ 1 ] - > SetA ( 35 ) ; <nl> <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Int32 ' , - 62 , - 62 ) ; <nl> public static function setTestMessage ( TestMessage $ m ) <nl> self : : kvUpdateHelper ( $ m , ' MapStringString ' , ' e ' , ' e ' ) ; <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Bytes ' , 1 , ' f ' ) ; <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Enum ' , 1 , TestEnum : : ONE ) ; <nl> - self : : kvUpdateHelper ( $ m , ' MapInt32Message ' , 1 , new TestMessage_Sub ( ) ) ; <nl> + self : : kvUpdateHelper ( $ m , ' MapInt32Message ' , 1 , new Sub ( ) ) ; <nl> $ m - > getMapInt32Message ( ) [ 1 ] - > SetA ( 36 ) ; <nl> } <nl> <nl> public static function setTestMessage2 ( TestMessage $ m ) <nl> { <nl> - $ sub = new TestMessage_Sub ( ) ; <nl> + $ sub = new Sub ( ) ; <nl> <nl> $ m - > setOptionalInt32 ( - 142 ) ; <nl> $ m - > setOptionalInt64 ( - 143 ) ; <nl> public static function setTestMessage2 ( TestMessage $ m ) <nl> self : : appendHelper ( $ m , ' RepeatedString ' , ' aa ' ) ; <nl> self : : appendHelper ( $ m , ' RepeatedBytes ' , ' bb ' ) ; <nl> self : : appendHelper ( $ m , ' RepeatedEnum ' , TestEnum : : TWO ) ; <nl> - self : : appendHelper ( $ m , ' RepeatedMessage ' , new TestMessage_Sub ( ) ) ; <nl> + self : : appendHelper ( $ m , ' RepeatedMessage ' , new Sub ( ) ) ; <nl> $ m - > getRepeatedMessage ( ) [ 0 ] - > setA ( 134 ) ; <nl> <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Int32 ' , - 62 , - 162 ) ; <nl> public static function setTestMessage2 ( TestMessage $ m ) <nl> self : : kvUpdateHelper ( $ m , ' MapStringString ' , ' e ' , ' ee ' ) ; <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Bytes ' , 1 , ' ff ' ) ; <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Enum ' , 1 , TestEnum : : TWO ) ; <nl> - self : : kvUpdateHelper ( $ m , ' MapInt32Message ' , 1 , new TestMessage_Sub ( ) ) ; <nl> + self : : kvUpdateHelper ( $ m , ' MapInt32Message ' , 1 , new Sub ( ) ) ; <nl> $ m - > getMapInt32Message ( ) [ 1 ] - > SetA ( 136 ) ; <nl> <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Int32 ' , - 162 , - 162 ) ; <nl> public static function setTestMessage2 ( TestMessage $ m ) <nl> self : : kvUpdateHelper ( $ m , ' MapStringString ' , ' ee ' , ' ee ' ) ; <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Bytes ' , 2 , ' ff ' ) ; <nl> self : : kvUpdateHelper ( $ m , ' MapInt32Enum ' , 2 , TestEnum : : TWO ) ; <nl> - self : : kvUpdateHelper ( $ m , ' MapInt32Message ' , 2 , new TestMessage_Sub ( ) ) ; <nl> + self : : kvUpdateHelper ( $ m , ' MapInt32Message ' , 2 , new Sub ( ) ) ; <nl> $ m - > getMapInt32Message ( ) [ 2 ] - > SetA ( 136 ) ; <nl> } <nl> <nl> mmm a / php / tests / undefined_test . php <nl> ppp b / php / tests / undefined_test . php <nl> <nl> use Google \ Protobuf \ Internal \ RepeatedField ; <nl> use Google \ Protobuf \ Internal \ GPBType ; <nl> use Foo \ TestMessage ; <nl> - use Foo \ TestMessage_Sub ; <nl> + use Foo \ TestMessage \ Sub ; <nl> <nl> class UndefinedTest extends PHPUnit_Framework_TestCase <nl> { <nl> public function testInt32SetStringFail ( ) <nl> public function testInt32AppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : INT32 ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testInt32SetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : INT32 ) ; <nl> $ arr [ ] = 0 ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testUint32SetStringFail ( ) <nl> public function testUint32AppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : UINT32 ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testUint32SetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : UINT32 ) ; <nl> $ arr [ ] = 0 ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testInt64SetStringFail ( ) <nl> public function testInt64AppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : INT64 ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testInt64SetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : INT64 ) ; <nl> $ arr [ ] = 0 ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testUint64SetStringFail ( ) <nl> public function testUint64AppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : UINT64 ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testUint64SetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : UINT64 ) ; <nl> $ arr [ ] = 0 ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testFloatSetStringFail ( ) <nl> public function testFloatAppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : FLOAT ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testFloatSetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : FLOAT ) ; <nl> $ arr [ ] = 0 . 0 ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testDoubleSetStringFail ( ) <nl> public function testDoubleAppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : DOUBLE ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testDoubleSetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : DOUBLE ) ; <nl> $ arr [ ] = 0 . 0 ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testDoubleSetMessageFail ( ) <nl> public function testBoolAppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : BOOL ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testBoolSetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : BOOL ) ; <nl> $ arr [ ] = true ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testBoolSetMessageFail ( ) <nl> public function testStringAppendMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : STRING ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testStringSetMessageFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : STRING ) ; <nl> $ arr [ ] = ' abc ' ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testStringSetInvalidUTF8Fail ( ) <nl> * / <nl> public function testMessageAppendIntFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> $ arr [ ] = 1 ; <nl> } <nl> <nl> public function testMessageAppendIntFail ( ) <nl> * / <nl> public function testMessageSetIntFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> - $ arr [ ] = new TestMessage_Sub ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> + $ arr [ ] = new Sub ; <nl> $ arr [ 0 ] = ' abc ' ; <nl> } <nl> <nl> public function testMessageSetIntFail ( ) <nl> * / <nl> public function testMessageAppendStringFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> $ arr [ ] = ' abc ' ; <nl> } <nl> <nl> public function testMessageAppendStringFail ( ) <nl> * / <nl> public function testMessageSetStringFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> - $ arr [ ] = new TestMessage_Sub ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> + $ arr [ ] = new Sub ; <nl> $ arr [ 0 ] = ' abc ' ; <nl> } <nl> <nl> public function testMessageSetStringFail ( ) <nl> * / <nl> public function testMessageAppendOtherMessageFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> $ arr [ ] = new TestMessage ; <nl> } <nl> <nl> public function testMessageAppendOtherMessageFail ( ) <nl> * / <nl> public function testMessageAppendNullFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> $ null = null ; <nl> $ arr [ ] = $ null ; <nl> } <nl> public function testMessageAppendNullFail ( ) <nl> * / <nl> public function testMessageSetNullFail ( ) <nl> { <nl> - $ arr = new RepeatedField ( GPBType : : MESSAGE , TestMessage_Sub : : class ) ; <nl> - $ arr [ ] = new TestMessage_Sub ( ) ; <nl> + $ arr = new RepeatedField ( GPBType : : MESSAGE , Sub : : class ) ; <nl> + $ arr [ ] = new Sub ( ) ; <nl> $ null = null ; <nl> $ arr [ 0 ] = $ null ; <nl> } <nl> public function testMessageOffsetFail ( ) <nl> { <nl> $ arr = new RepeatedField ( GPBType : : INT32 ) ; <nl> $ arr [ ] = 0 ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = 0 ; <nl> + $ arr [ new Sub ( ) ] = 0 ; <nl> } <nl> <nl> / * * <nl> public function testMapFieldWrongRepeatedMessageClassFail ( ) <nl> public function testMessageMergeFromInvalidTypeFail ( ) <nl> { <nl> $ m = new TestMessage ( ) ; <nl> - $ n = new TestMessage_Sub ( ) ; <nl> + $ n = new Sub ( ) ; <nl> $ m - > mergeFrom ( $ n ) ; <nl> } <nl> <nl> public function testInt32SetStringValueFail ( ) <nl> public function testInt32SetMessageKeyFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : INT32 , GPBType : : INT32 ) ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = 0 ; <nl> + $ arr [ new Sub ( ) ] = 0 ; <nl> } <nl> <nl> / * * <nl> public function testInt32SetMessageKeyFail ( ) <nl> public function testInt32SetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : INT32 , GPBType : : INT32 ) ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testUint32SetStringValueFail ( ) <nl> public function testUint32SetMessageKeyFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : UINT32 , GPBType : : UINT32 ) ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = 0 ; <nl> + $ arr [ new Sub ( ) ] = 0 ; <nl> } <nl> <nl> / * * <nl> public function testUint32SetMessageKeyFail ( ) <nl> public function testUint32SetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : UINT32 , GPBType : : UINT32 ) ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testInt64SetStringValueFail ( ) <nl> public function testInt64SetMessageKeyFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : INT64 , GPBType : : INT64 ) ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = 0 ; <nl> + $ arr [ new Sub ( ) ] = 0 ; <nl> } <nl> <nl> / * * <nl> public function testInt64SetMessageKeyFail ( ) <nl> public function testInt64SetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : INT64 , GPBType : : INT64 ) ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testUint64SetStringValueFail ( ) <nl> public function testUint64SetMessageKeyFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : UINT64 , GPBType : : UINT64 ) ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = 0 ; <nl> + $ arr [ new Sub ( ) ] = 0 ; <nl> } <nl> <nl> / * * <nl> public function testUint64SetMessageKeyFail ( ) <nl> public function testUint64SetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : UINT64 , GPBType : : UINT64 ) ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testDoubleSetStringValueFail ( ) <nl> public function testDoubleSetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : INT64 , GPBType : : DOUBLE ) ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testDoubleSetMessageValueFail ( ) <nl> public function testBoolSetMessageKeyFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : BOOL , GPBType : : BOOL ) ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = true ; <nl> + $ arr [ new Sub ( ) ] = true ; <nl> } <nl> <nl> / * * <nl> public function testBoolSetMessageKeyFail ( ) <nl> public function testBoolSetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : BOOL , GPBType : : BOOL ) ; <nl> - $ arr [ true ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ true ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testStringSetInvalidUTF8ValueFail ( ) <nl> public function testStringSetMessageKeyFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : STRING , GPBType : : STRING ) ; <nl> - $ arr [ new TestMessage_Sub ( ) ] = ' abc ' ; <nl> + $ arr [ new Sub ( ) ] = ' abc ' ; <nl> } <nl> <nl> / * * <nl> public function testStringSetMessageKeyFail ( ) <nl> public function testStringSetMessageValueFail ( ) <nl> { <nl> $ arr = new MapField ( GPBType : : STRING , GPBType : : STRING ) ; <nl> - $ arr [ ' abc ' ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ ' abc ' ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> public function testMessageSetOtherMessageValueFail ( ) <nl> { <nl> $ arr = <nl> new MapField ( GPBType : : INT32 , GPBType : : MESSAGE , TestMessage : : class ) ; <nl> - $ arr [ 0 ] = new TestMessage_Sub ( ) ; <nl> + $ arr [ 0 ] = new Sub ( ) ; <nl> } <nl> <nl> / * * <nl> mmm a / php / tests / well_known_test . php <nl> ppp b / php / tests / well_known_test . php <nl> <nl> use Google \ Protobuf \ EnumValue ; <nl> use Google \ Protobuf \ Field ; <nl> use Google \ Protobuf \ FieldMask ; <nl> - use Google \ Protobuf \ Field_Cardinality ; <nl> - use Google \ Protobuf \ Field_Kind ; <nl> + use Google \ Protobuf \ Field \ Cardinality ; <nl> + use Google \ Protobuf \ Field \ Kind ; <nl> use Google \ Protobuf \ FloatValue ; <nl> use Google \ Protobuf \ GPBEmpty ; <nl> use Google \ Protobuf \ Int32Value ; <nl> public function testField ( ) <nl> { <nl> $ m = new Field ( ) ; <nl> <nl> - $ m - > setKind ( Field_Kind : : TYPE_DOUBLE ) ; <nl> - $ this - > assertSame ( Field_Kind : : TYPE_DOUBLE , $ m - > getKind ( ) ) ; <nl> + $ m - > setKind ( Kind : : TYPE_DOUBLE ) ; <nl> + $ this - > assertSame ( Kind : : TYPE_DOUBLE , $ m - > getKind ( ) ) ; <nl> <nl> - $ m - > setCardinality ( Field_Cardinality : : CARDINALITY_OPTIONAL ) ; <nl> - $ this - > assertSame ( Field_Cardinality : : CARDINALITY_OPTIONAL , $ m - > getCardinality ( ) ) ; <nl> + $ m - > setCardinality ( Cardinality : : CARDINALITY_OPTIONAL ) ; <nl> + $ this - > assertSame ( Cardinality : : CARDINALITY_OPTIONAL , $ m - > getCardinality ( ) ) ; <nl> <nl> $ m - > setNumber ( 1 ) ; <nl> $ this - > assertSame ( 1 , $ m - > getNumber ( ) ) ; <nl> mmm a / ruby / Rakefile <nl> ppp b / ruby / Rakefile <nl> end <nl> # Proto for tests . <nl> genproto_output < < " tests / generated_code . rb " <nl> genproto_output < < " tests / test_import . rb " <nl> + genproto_output < < " tests / test_ruby_package . rb " <nl> file " tests / generated_code . rb " = > " tests / generated_code . proto " do | file_task | <nl> sh " . . / src / protoc - - ruby_out = . tests / generated_code . proto " <nl> end <nl> file " tests / test_import . rb " = > " tests / test_import . proto " do | file_task | <nl> sh " . . / src / protoc - - ruby_out = . tests / test_import . proto " <nl> end <nl> <nl> + file " tests / test_ruby_package . rb " = > " tests / test_ruby_package . proto " do | file_task | <nl> + sh " . . / src / protoc - - ruby_out = . tests / test_ruby_package . proto " <nl> + end <nl> + <nl> task : genproto = > genproto_output <nl> <nl> task : clean do <nl> mmm a / ruby / lib / google / protobuf . rb <nl> ppp b / ruby / lib / google / protobuf . rb <nl> def self . encode ( msg ) <nl> msg . to_proto <nl> end <nl> <nl> - def self . encode_json ( msg ) <nl> - msg . to_json <nl> + def self . encode_json ( msg , options = { } ) <nl> + msg . to_json ( options ) <nl> end <nl> <nl> def self . decode ( klass , proto ) <nl> mmm a / ruby / lib / google / protobuf / message_exts . rb <nl> ppp b / ruby / lib / google / protobuf / message_exts . rb <nl> def self . included ( klass ) <nl> module ClassMethods <nl> end <nl> <nl> - def to_json <nl> - self . class . encode_json ( self ) <nl> + def to_json ( options = { } ) <nl> + self . class . encode_json ( self , options ) <nl> end <nl> <nl> def to_proto <nl> mmm a / ruby / tests / encode_decode_test . rb <nl> ppp b / ruby / tests / encode_decode_test . rb <nl> def test_discard_unknown <nl> to = A : : B : : C : : TestMessage . encode ( m . oneof_msg ) <nl> assert_equal ' ' , to <nl> end <nl> + <nl> + def test_encode_json <nl> + msg = A : : B : : C : : TestMessage . new ( { optional_int32 : 22 } ) <nl> + json = msg . to_json <nl> + <nl> + to = A : : B : : C : : TestMessage . decode_json ( json ) <nl> + assert_equal to . optional_int32 , 22 <nl> + <nl> + msg = A : : B : : C : : TestMessage . new ( { optional_int32 : 22 } ) <nl> + json = msg . to_json ( { preserve_proto_fieldnames : true } ) <nl> + <nl> + assert_match ' optional_int32 ' , json <nl> + <nl> + to = A : : B : : C : : TestMessage . decode_json ( json ) <nl> + assert_equal 22 , to . optional_int32 <nl> + <nl> + msg = A : : B : : C : : TestMessage . new ( { optional_int32 : 22 } ) <nl> + json = A : : B : : C : : TestMessage . encode_json ( <nl> + msg , <nl> + { preserve_proto_fieldnames : true , emit_defaults : true } <nl> + ) <nl> + <nl> + assert_match ' optional_int32 ' , json <nl> + end <nl> end <nl> mmm a / ruby / tests / generated_code_test . rb <nl> ppp b / ruby / tests / generated_code_test . rb <nl> <nl> <nl> require ' generated_code_pb ' <nl> require ' test_import_pb ' <nl> + require ' test_ruby_package_pb ' <nl> require ' test / unit ' <nl> <nl> class GeneratedCodeTest < Test : : Unit : : TestCase <nl> def test_generated_msg <nl> # aspect of the extension ( basic . rb is for that ) . <nl> m = A : : B : : C : : TestMessage . new ( ) <nl> m2 = FooBar : : TestImportedMessage . new ( ) <nl> + m3 = A : : B : : TestRubyPackageMessage . new ( ) <nl> end <nl> end <nl> new file mode 100644 <nl> index 0000000000 . . b872562028 <nl> mmm / dev / null <nl> ppp b / ruby / tests / test_ruby_package . proto <nl> <nl> + syntax = " proto3 " ; <nl> + <nl> + package foo_bar ; <nl> + <nl> + option ruby_package = " A . B " ; <nl> + <nl> + message TestRubyPackageMessage { } <nl> mmm a / src / google / protobuf / compiler / php / php_generator . cc <nl> ppp b / src / google / protobuf / compiler / php / php_generator . cc <nl> std : : string PhpName ( const std : : string & full_name , bool is_descriptor ) ; <nl> std : : string DefaultForField ( FieldDescriptor * field ) ; <nl> std : : string IntToString ( int32 value ) ; <nl> std : : string FilenameToClassname ( const string & filename ) ; <nl> - std : : string GeneratedMetadataFileName ( const std : : string & proto_file , <nl> + std : : string GeneratedMetadataFileName ( const FileDescriptor * file , <nl> bool is_descriptor ) ; <nl> std : : string LabelForField ( FieldDescriptor * field ) ; <nl> std : : string TypeName ( FieldDescriptor * field ) ; <nl> void Indent ( io : : Printer * printer ) ; <nl> void Outdent ( io : : Printer * printer ) ; <nl> void GenerateMessageDocComment ( io : : Printer * printer , const Descriptor * message , <nl> int is_descriptor ) ; <nl> + void GenerateMessageConstructorDocComment ( io : : Printer * printer , <nl> + const Descriptor * message , <nl> + int is_descriptor ) ; <nl> void GenerateFieldDocComment ( io : : Printer * printer , const FieldDescriptor * field , <nl> int is_descriptor , int function_type ) ; <nl> void GenerateEnumDocComment ( io : : Printer * printer , const EnumDescriptor * enum_ , <nl> void GenerateServiceDocComment ( io : : Printer * printer , <nl> void GenerateServiceMethodDocComment ( io : : Printer * printer , <nl> const MethodDescriptor * method ) ; <nl> <nl> - std : : string RenameEmpty ( const std : : string & name ) { <nl> - if ( name = = " Empty " ) { <nl> - return " GPBEmpty " ; <nl> - } else { <nl> - return name ; <nl> + <nl> + std : : string ReservedNamePrefix ( const string & classname , <nl> + const FileDescriptor * file ) { <nl> + bool is_reserved = false ; <nl> + <nl> + string lower = classname ; <nl> + transform ( lower . begin ( ) , lower . end ( ) , lower . begin ( ) , : : tolower ) ; <nl> + <nl> + for ( int i = 0 ; i < kReservedNamesSize ; i + + ) { <nl> + if ( lower = = kReservedNames [ i ] ) { <nl> + is_reserved = true ; <nl> + break ; <nl> + } <nl> } <nl> - } <nl> <nl> - std : : string MessageFullName ( const Descriptor * message , bool is_descriptor ) { <nl> - if ( is_descriptor ) { <nl> - return StringReplace ( message - > full_name ( ) , <nl> - " google . protobuf " , <nl> - " google . protobuf . internal " , false ) ; <nl> - } else { <nl> - return message - > full_name ( ) ; <nl> + if ( is_reserved ) { <nl> + if ( file - > package ( ) = = " google . protobuf " ) { <nl> + return " GPB " ; <nl> + } else { <nl> + return " PB " ; <nl> + } <nl> } <nl> + <nl> + return " " ; <nl> } <nl> <nl> - std : : string EnumFullName ( const EnumDescriptor * envm , bool is_descriptor ) { <nl> + template < typename DescriptorType > <nl> + std : : string DescriptorFullName ( const DescriptorType * desc , bool is_descriptor ) { <nl> if ( is_descriptor ) { <nl> - return StringReplace ( envm - > full_name ( ) , <nl> + return StringReplace ( desc - > full_name ( ) , <nl> " google . protobuf " , <nl> " google . protobuf . internal " , false ) ; <nl> } else { <nl> - return envm - > full_name ( ) ; <nl> + return desc - > full_name ( ) ; <nl> } <nl> } <nl> <nl> std : : string ClassNamePrefix ( const string & classname , <nl> return prefix ; <nl> } <nl> <nl> - bool is_reserved = false ; <nl> + return ReservedNamePrefix ( classname , desc - > file ( ) ) ; <nl> + } <nl> + <nl> + template < typename DescriptorType > <nl> + std : : string GeneratedClassName ( const DescriptorType * desc ) { <nl> + std : : string classname = ClassNamePrefix ( desc - > name ( ) , desc ) + desc - > name ( ) ; <nl> + const Descriptor * containing = desc - > containing_type ( ) ; <nl> + while ( containing ! = NULL ) { <nl> + classname = ClassNamePrefix ( containing - > name ( ) , desc ) + containing - > name ( ) <nl> + + ' \ \ ' + classname ; <nl> + containing = containing - > containing_type ( ) ; <nl> + } <nl> + return classname ; <nl> + } <nl> <nl> + std : : string GeneratedClassName ( const ServiceDescriptor * desc ) { <nl> + std : : string classname = desc - > name ( ) ; <nl> + return ClassNamePrefix ( classname , desc ) + classname ; <nl> + } <nl> + <nl> + template < typename DescriptorType > <nl> + std : : string LegacyGeneratedClassName ( const DescriptorType * desc ) { <nl> + std : : string classname = desc - > name ( ) ; <nl> + const Descriptor * containing = desc - > containing_type ( ) ; <nl> + while ( containing ! = NULL ) { <nl> + classname = containing - > name ( ) + ' _ ' + classname ; <nl> + containing = containing - > containing_type ( ) ; <nl> + } <nl> + return ClassNamePrefix ( classname , desc ) + classname ; <nl> + } <nl> + <nl> + std : : string ClassNamePrefix ( const string & classname ) { <nl> string lower = classname ; <nl> transform ( lower . begin ( ) , lower . end ( ) , lower . begin ( ) , : : tolower ) ; <nl> <nl> for ( int i = 0 ; i < kReservedNamesSize ; i + + ) { <nl> if ( lower = = kReservedNames [ i ] ) { <nl> - is_reserved = true ; <nl> - break ; <nl> - } <nl> - } <nl> - <nl> - if ( is_reserved ) { <nl> - if ( desc - > file ( ) - > package ( ) = = " google . protobuf " ) { <nl> - return " GPB " ; <nl> - } else { <nl> return " PB " ; <nl> } <nl> } <nl> std : : string ConstantNamePrefix ( const string & classname ) { <nl> } <nl> <nl> template < typename DescriptorType > <nl> - std : : string NamespacedName ( const string & classname , <nl> - const DescriptorType * desc , bool is_descriptor ) { <nl> + std : : string RootPhpNamespace ( const DescriptorType * desc , bool is_descriptor ) { <nl> if ( desc - > file ( ) - > options ( ) . has_php_namespace ( ) ) { <nl> const string & php_namespace = desc - > file ( ) - > options ( ) . php_namespace ( ) ; <nl> if ( php_namespace ! = " " ) { <nl> - return php_namespace + ' \ \ ' + classname ; <nl> - } else { <nl> - return classname ; <nl> + return php_namespace ; <nl> } <nl> + return " " ; <nl> } <nl> <nl> - if ( desc - > file ( ) - > package ( ) = = " " ) { <nl> - return classname ; <nl> - } else { <nl> - return PhpName ( desc - > file ( ) - > package ( ) , is_descriptor ) + ' \ \ ' + <nl> - classname ; <nl> + if ( desc - > file ( ) - > package ( ) ! = " " ) { <nl> + return PhpName ( desc - > file ( ) - > package ( ) , is_descriptor ) ; <nl> } <nl> + return " " ; <nl> } <nl> <nl> template < typename DescriptorType > <nl> std : : string FullClassName ( const DescriptorType * desc , bool is_descriptor ) { <nl> string classname = GeneratedClassName ( desc ) ; <nl> - return NamespacedName ( classname , desc , is_descriptor ) ; <nl> + string php_namespace = RootPhpNamespace ( desc , is_descriptor ) ; <nl> + if ( php_namespace ! = " " ) { <nl> + return php_namespace + " \ \ " + classname ; <nl> + } <nl> + return classname ; <nl> } <nl> <nl> - std : : string FullClassName ( const ServiceDescriptor * desc , bool is_descriptor ) { <nl> - string classname = GeneratedClassName ( desc ) ; <nl> - return NamespacedName ( classname , desc , is_descriptor ) ; <nl> + template < typename DescriptorType > <nl> + std : : string LegacyFullClassName ( const DescriptorType * desc , bool is_descriptor ) { <nl> + string classname = LegacyGeneratedClassName ( desc ) ; <nl> + string php_namespace = RootPhpNamespace ( desc , is_descriptor ) ; <nl> + if ( php_namespace ! = " " ) { <nl> + return php_namespace + " \ \ " + classname ; <nl> + } <nl> + return classname ; <nl> } <nl> <nl> std : : string PhpName ( const std : : string & full_name , bool is_descriptor ) { <nl> std : : string PhpName ( const std : : string & full_name , bool is_descriptor ) { <nl> return kDescriptorPackageName ; <nl> } <nl> <nl> + std : : string segment ; <nl> std : : string result ; <nl> bool cap_next_letter = true ; <nl> for ( int i = 0 ; i < full_name . size ( ) ; i + + ) { <nl> if ( ' a ' < = full_name [ i ] & & full_name [ i ] < = ' z ' & & cap_next_letter ) { <nl> - result + = full_name [ i ] + ( ' A ' - ' a ' ) ; <nl> + segment + = full_name [ i ] + ( ' A ' - ' a ' ) ; <nl> cap_next_letter = false ; <nl> } else if ( full_name [ i ] = = ' . ' ) { <nl> - result + = ' \ \ ' ; <nl> + result + = ClassNamePrefix ( segment ) + segment + ' \ \ ' ; <nl> + segment = " " ; <nl> cap_next_letter = true ; <nl> } else { <nl> - result + = full_name [ i ] ; <nl> + segment + = full_name [ i ] ; <nl> cap_next_letter = false ; <nl> } <nl> } <nl> + result + = ClassNamePrefix ( segment ) + segment ; <nl> return result ; <nl> } <nl> <nl> std : : string DefaultForField ( const FieldDescriptor * field ) { <nl> } <nl> } <nl> <nl> - std : : string GeneratedMetadataFileName ( const std : : string & proto_file , <nl> + std : : string GeneratedMetadataFileName ( const FileDescriptor * file , <nl> bool is_descriptor ) { <nl> + const string & proto_file = file - > name ( ) ; <nl> int start_index = 0 ; <nl> int first_index = proto_file . find_first_of ( " / " , start_index ) ; <nl> - std : : string result = " GPBMetadata / " ; <nl> + std : : string result = " " ; <nl> + std : : string segment = " " ; <nl> <nl> if ( proto_file = = kEmptyFile ) { <nl> return kEmptyMetadataFile ; <nl> std : : string GeneratedMetadataFileName ( const std : : string & proto_file , <nl> file_no_suffix = proto_file . substr ( 0 , lastindex ) ; <nl> } <nl> <nl> - while ( first_index ! = string : : npos ) { <nl> - result + = UnderscoresToCamelCase ( <nl> - file_no_suffix . substr ( start_index , first_index - start_index ) , true ) ; <nl> - result + = " / " ; <nl> - start_index = first_index + 1 ; <nl> - first_index = file_no_suffix . find_first_of ( " / " , start_index ) ; <nl> + if ( file - > options ( ) . has_php_metadata_namespace ( ) ) { <nl> + const string & php_metadata_namespace = <nl> + file - > options ( ) . php_metadata_namespace ( ) ; <nl> + if ( php_metadata_namespace ! = " " & & php_metadata_namespace ! = " \ \ " ) { <nl> + result + = php_metadata_namespace ; <nl> + std : : replace ( result . begin ( ) , result . end ( ) , ' \ \ ' , ' / ' ) ; <nl> + if ( result . at ( result . size ( ) - 1 ) ! = ' / ' ) { <nl> + result + = " / " ; <nl> + } <nl> + } <nl> + } else { <nl> + result + = " GPBMetadata / " ; <nl> + while ( first_index ! = string : : npos ) { <nl> + segment = UnderscoresToCamelCase ( <nl> + file_no_suffix . substr ( start_index , first_index - start_index ) , true ) ; <nl> + result + = ReservedNamePrefix ( segment , file ) + segment + " / " ; <nl> + start_index = first_index + 1 ; <nl> + first_index = file_no_suffix . find_first_of ( " / " , start_index ) ; <nl> + } <nl> } <nl> <nl> / / Append file name . <nl> - result + = RenameEmpty ( UnderscoresToCamelCase ( <nl> - file_no_suffix . substr ( start_index , first_index - start_index ) , true ) ) ; <nl> + int file_name_start = file_no_suffix . find_last_of ( " / " ) ; <nl> + if ( file_name_start = = string : : npos ) { <nl> + file_name_start = 0 ; <nl> + } else { <nl> + file_name_start + = 1 ; <nl> + } <nl> + segment = UnderscoresToCamelCase ( <nl> + file_no_suffix . substr ( file_name_start , first_index - file_name_start ) , true ) ; <nl> <nl> - return result + = " . php " ; <nl> + return result + ReservedNamePrefix ( segment , file ) + segment + " . php " ; <nl> } <nl> <nl> - std : : string GeneratedMessageFileName ( const Descriptor * message , <nl> + template < typename DescriptorType > <nl> + std : : string GeneratedClassFileName ( const DescriptorType * desc , <nl> bool is_descriptor ) { <nl> - std : : string result = FullClassName ( message , is_descriptor ) ; <nl> + std : : string result = FullClassName ( desc , is_descriptor ) ; <nl> for ( int i = 0 ; i < result . size ( ) ; i + + ) { <nl> if ( result [ i ] = = ' \ \ ' ) { <nl> result [ i ] = ' / ' ; <nl> std : : string GeneratedMessageFileName ( const Descriptor * message , <nl> return result + " . php " ; <nl> } <nl> <nl> - std : : string GeneratedEnumFileName ( const EnumDescriptor * en , <nl> - bool is_descriptor ) { <nl> - std : : string result = FullClassName ( en , is_descriptor ) ; <nl> + template < typename DescriptorType > <nl> + std : : string LegacyGeneratedClassFileName ( const DescriptorType * desc , <nl> + bool is_descriptor ) { <nl> + std : : string result = LegacyFullClassName ( desc , is_descriptor ) ; <nl> + <nl> for ( int i = 0 ; i < result . size ( ) ; i + + ) { <nl> if ( result [ i ] = = ' \ \ ' ) { <nl> result [ i ] = ' / ' ; <nl> std : : string PhpGetterTypeName ( const FieldDescriptor * field , bool is_descriptor ) <nl> std : : string EnumOrMessageSuffix ( <nl> const FieldDescriptor * field , bool is_descriptor ) { <nl> if ( field - > cpp_type ( ) = = FieldDescriptor : : CPPTYPE_MESSAGE ) { <nl> - return " , ' " + MessageFullName ( field - > message_type ( ) , is_descriptor ) + " ' " ; <nl> + return " , ' " + DescriptorFullName ( field - > message_type ( ) , is_descriptor ) + " ' " ; <nl> } <nl> if ( field - > cpp_type ( ) = = FieldDescriptor : : CPPTYPE_ENUM ) { <nl> - return " , ' " + EnumFullName ( field - > enum_type ( ) , is_descriptor ) + " ' " ; <nl> + return " , ' " + DescriptorFullName ( field - > enum_type ( ) , is_descriptor ) + " ' " ; <nl> } <nl> return " " ; <nl> } <nl> void GenerateFieldAccessor ( const FieldDescriptor * field , bool is_descriptor , <nl> } else if ( field - > cpp_type ( ) = = FieldDescriptor : : CPPTYPE_MESSAGE ) { <nl> printer - > Print ( <nl> " GPBUtil : : checkMessage ( $ var , \ \ ^ class_name ^ : : class ) ; \ n " , <nl> - " class_name " , FullClassName ( field - > message_type ( ) , is_descriptor ) ) ; <nl> + " class_name " , LegacyFullClassName ( field - > message_type ( ) , is_descriptor ) ) ; <nl> } else if ( field - > cpp_type ( ) = = FieldDescriptor : : CPPTYPE_ENUM ) { <nl> printer - > Print ( <nl> " GPBUtil : : checkEnum ( $ var , \ \ ^ class_name ^ : : class ) ; \ n " , <nl> - " class_name " , FullClassName ( field - > enum_type ( ) , is_descriptor ) ) ; <nl> + " class_name " , LegacyFullClassName ( field - > enum_type ( ) , is_descriptor ) ) ; <nl> } else if ( field - > cpp_type ( ) = = FieldDescriptor : : CPPTYPE_STRING ) { <nl> printer - > Print ( <nl> " GPBUtil : : checkString ( $ var , ^ utf8 ^ ) ; \ n " , <nl> void GenerateEnumToPool ( const EnumDescriptor * en , io : : Printer * printer ) { <nl> printer - > Print ( <nl> " $ pool - > addEnum ( ' ^ name ^ ' , " <nl> " \ \ Google \ \ Protobuf \ \ Internal \ \ ^ class_name ^ : : class ) \ n " , <nl> - " name " , EnumFullName ( en , true ) , <nl> + " name " , DescriptorFullName ( en , true ) , <nl> " class_name " , en - > name ( ) ) ; <nl> Indent ( printer ) ; <nl> <nl> void GenerateMessageToPool ( const string & name_prefix , const Descriptor * message , <nl> if ( message - > options ( ) . map_entry ( ) ) { <nl> return ; <nl> } <nl> - string class_name = name_prefix . empty ( ) ? <nl> - message - > name ( ) : name_prefix + " _ " + message - > name ( ) ; <nl> + string class_name = ( name_prefix . empty ( ) ? " " : name_prefix + " \ \ " ) + <nl> + ReservedNamePrefix ( message - > name ( ) , message - > file ( ) ) + message - > name ( ) ; <nl> <nl> printer - > Print ( <nl> " $ pool - > addMessage ( ' ^ message ^ ' , " <nl> " \ \ Google \ \ Protobuf \ \ Internal \ \ ^ class_name ^ : : class ) \ n " , <nl> - " message " , MessageFullName ( message , true ) , <nl> + " message " , DescriptorFullName ( message , true ) , <nl> " class_name " , class_name ) ; <nl> <nl> Indent ( printer ) ; <nl> void GenerateAddFileToPool ( const FileDescriptor * file , bool is_descriptor , <nl> continue ; <nl> } <nl> std : : string dependency_filename = <nl> - GeneratedMetadataFileName ( name , is_descriptor ) ; <nl> + GeneratedMetadataFileName ( file - > dependency ( i ) , is_descriptor ) ; <nl> printer - > Print ( <nl> " \ \ ^ name ^ : : initOnce ( ) ; \ n " , <nl> " name " , FilenameToClassname ( dependency_filename ) ) ; <nl> std : : string FilenameToClassname ( const string & filename ) { <nl> void GenerateMetadataFile ( const FileDescriptor * file , <nl> bool is_descriptor , <nl> GeneratorContext * generator_context ) { <nl> - std : : string filename = GeneratedMetadataFileName ( file - > name ( ) , is_descriptor ) ; <nl> + std : : string filename = GeneratedMetadataFileName ( file , is_descriptor ) ; <nl> std : : unique_ptr < io : : ZeroCopyOutputStream > output ( <nl> generator_context - > Open ( filename ) ) ; <nl> io : : Printer printer ( output . get ( ) , ' ^ ' ) ; <nl> void GenerateMetadataFile ( const FileDescriptor * file , <nl> std : : string fullname = FilenameToClassname ( filename ) ; <nl> int lastindex = fullname . find_last_of ( " \ \ " ) ; <nl> <nl> - printer . Print ( <nl> - " namespace ^ name ^ ; \ n \ n " , <nl> - " name " , fullname . substr ( 0 , lastindex ) ) ; <nl> - <nl> if ( lastindex ! = string : : npos ) { <nl> + printer . Print ( <nl> + " namespace ^ name ^ ; \ n \ n " , <nl> + " name " , fullname . substr ( 0 , lastindex ) ) ; <nl> + <nl> printer . Print ( <nl> " class ^ name ^ \ n " <nl> " { \ n " , <nl> void GenerateMetadataFile ( const FileDescriptor * file , <nl> printer . Print ( " } \ n \ n " ) ; <nl> } <nl> <nl> + template < typename DescriptorType > <nl> + void LegacyGenerateClassFile ( const FileDescriptor * file , const DescriptorType * desc , <nl> + bool is_descriptor , <nl> + GeneratorContext * generator_context ) { <nl> + <nl> + std : : string filename = LegacyGeneratedClassFileName ( desc , is_descriptor ) ; <nl> + std : : unique_ptr < io : : ZeroCopyOutputStream > output ( <nl> + generator_context - > Open ( filename ) ) ; <nl> + io : : Printer printer ( output . get ( ) , ' ^ ' ) ; <nl> + <nl> + GenerateHead ( file , & printer ) ; <nl> + <nl> + std : : string php_namespace = RootPhpNamespace ( desc , is_descriptor ) ; <nl> + if ( php_namespace ! = " " ) { <nl> + printer . Print ( <nl> + " namespace ^ name ^ ; \ n \ n " , <nl> + " name " , php_namespace ) ; <nl> + } <nl> + std : : string newname = FullClassName ( desc , is_descriptor ) ; <nl> + printer . Print ( " if ( false ) { \ n " ) ; <nl> + Indent ( & printer ) ; <nl> + printer . Print ( " / * * \ n " ) ; <nl> + printer . Print ( " * This class is deprecated . Use ^ new ^ instead . \ n " , <nl> + " new " , newname ) ; <nl> + printer . Print ( " * @ deprecated \ n " ) ; <nl> + printer . Print ( " * / \ n " ) ; <nl> + printer . Print ( " class ^ old ^ { } \ n " , <nl> + " old " , LegacyGeneratedClassName ( desc ) ) ; <nl> + Outdent ( & printer ) ; <nl> + printer . Print ( " } \ n " ) ; <nl> + printer . Print ( " class_exists ( ^ new ^ : : class ) ; \ n " , <nl> + " new " , GeneratedClassName ( desc ) ) ; <nl> + printer . Print ( " @ trigger_error ( ' ^ old ^ is deprecated and will be removed in " <nl> + " the next major release . Use ^ fullname ^ instead ' , E_USER_DEPRECATED ) ; \ n \ n " , <nl> + " old " , LegacyFullClassName ( desc , is_descriptor ) , <nl> + " fullname " , newname ) ; <nl> + } <nl> + <nl> void GenerateEnumFile ( const FileDescriptor * file , const EnumDescriptor * en , <nl> bool is_descriptor , GeneratorContext * generator_context ) { <nl> - std : : string filename = GeneratedEnumFileName ( en , is_descriptor ) ; <nl> + std : : string filename = GeneratedClassFileName ( en , is_descriptor ) ; <nl> std : : unique_ptr < io : : ZeroCopyOutputStream > output ( <nl> generator_context - > Open ( filename ) ) ; <nl> io : : Printer printer ( output . get ( ) , ' ^ ' ) ; <nl> void GenerateEnumFile ( const FileDescriptor * file , const EnumDescriptor * en , <nl> std : : string fullname = FilenameToClassname ( filename ) ; <nl> int lastindex = fullname . find_last_of ( " \ \ " ) ; <nl> <nl> - if ( file - > options ( ) . has_php_namespace ( ) ) { <nl> - const string & php_namespace = file - > options ( ) . php_namespace ( ) ; <nl> - if ( ! php_namespace . empty ( ) ) { <nl> - printer . Print ( <nl> - " namespace ^ name ^ ; \ n \ n " , <nl> - " name " , php_namespace ) ; <nl> - } <nl> - } else if ( ! file - > package ( ) . empty ( ) ) { <nl> + if ( lastindex ! = string : : npos ) { <nl> printer . Print ( <nl> " namespace ^ name ^ ; \ n \ n " , <nl> " name " , fullname . substr ( 0 , lastindex ) ) ; <nl> } <nl> <nl> - GenerateEnumDocComment ( & printer , en , is_descriptor ) ; <nl> - <nl> if ( lastindex ! = string : : npos ) { <nl> - printer . Print ( <nl> - " class ^ name ^ \ n " <nl> - " { \ n " , <nl> - " name " , fullname . substr ( lastindex + 1 ) ) ; <nl> - } else { <nl> - printer . Print ( <nl> - " class ^ name ^ \ n " <nl> - " { \ n " , <nl> - " name " , fullname ) ; <nl> + fullname = fullname . substr ( lastindex + 1 ) ; <nl> } <nl> + <nl> + GenerateEnumDocComment ( & printer , en , is_descriptor ) ; <nl> + <nl> + printer . Print ( <nl> + " class ^ name ^ \ n " <nl> + " { \ n " , <nl> + " name " , fullname ) ; <nl> Indent ( & printer ) ; <nl> <nl> for ( int i = 0 ; i < en - > value_count ( ) ; i + + ) { <nl> void GenerateEnumFile ( const FileDescriptor * file , const EnumDescriptor * en , <nl> <nl> Outdent ( & printer ) ; <nl> printer . Print ( " } \ n \ n " ) ; <nl> + <nl> + / / write legacy file for backwards compatiblity with nested messages and enums <nl> + if ( en - > containing_type ( ) ! = NULL ) { <nl> + printer . Print ( <nl> + " / / Adding a class alias for backwards compatibility with the previous class name . \ n " ) ; <nl> + printer . Print ( <nl> + " class_alias ( ^ new ^ : : class , \ \ ^ old ^ : : class ) ; \ n \ n " , <nl> + " new " , fullname , <nl> + " old " , LegacyFullClassName ( en , is_descriptor ) ) ; <nl> + LegacyGenerateClassFile ( file , en , is_descriptor , generator_context ) ; <nl> + } <nl> } <nl> <nl> void GenerateMessageFile ( const FileDescriptor * file , const Descriptor * message , <nl> void GenerateMessageFile ( const FileDescriptor * file , const Descriptor * message , <nl> return ; <nl> } <nl> <nl> - std : : string filename = GeneratedMessageFileName ( message , is_descriptor ) ; <nl> + std : : string filename = GeneratedClassFileName ( message , is_descriptor ) ; <nl> std : : unique_ptr < io : : ZeroCopyOutputStream > output ( <nl> generator_context - > Open ( filename ) ) ; <nl> io : : Printer printer ( output . get ( ) , ' ^ ' ) ; <nl> void GenerateMessageFile ( const FileDescriptor * file , const Descriptor * message , <nl> std : : string fullname = FilenameToClassname ( filename ) ; <nl> int lastindex = fullname . find_last_of ( " \ \ " ) ; <nl> <nl> - if ( file - > options ( ) . has_php_namespace ( ) ) { <nl> - const string & php_namespace = file - > options ( ) . php_namespace ( ) ; <nl> - if ( ! php_namespace . empty ( ) ) { <nl> - printer . Print ( <nl> - " namespace ^ name ^ ; \ n \ n " , <nl> - " name " , php_namespace ) ; <nl> - } <nl> - } else if ( ! file - > package ( ) . empty ( ) ) { <nl> + if ( lastindex ! = string : : npos ) { <nl> printer . Print ( <nl> " namespace ^ name ^ ; \ n \ n " , <nl> " name " , fullname . substr ( 0 , lastindex ) ) ; <nl> void GenerateMessageFile ( const FileDescriptor * file , const Descriptor * message , <nl> <nl> GenerateMessageDocComment ( & printer , message , is_descriptor ) ; <nl> if ( lastindex ! = string : : npos ) { <nl> - printer . Print ( <nl> - " class ^ name ^ extends \ \ Google \ \ Protobuf \ \ Internal \ \ Message \ n " <nl> - " { \ n " , <nl> - " name " , fullname . substr ( lastindex + 1 ) ) ; <nl> - } else { <nl> - printer . Print ( <nl> - " class ^ name ^ extends \ \ Google \ \ Protobuf \ \ Internal \ \ Message \ n " <nl> - " { \ n " , <nl> - " name " , fullname ) ; <nl> + fullname = fullname . substr ( lastindex + 1 ) ; <nl> } <nl> + <nl> + printer . Print ( <nl> + " class ^ name ^ extends \ \ Google \ \ Protobuf \ \ Internal \ \ Message \ n " <nl> + " { \ n " , <nl> + " name " , fullname ) ; <nl> Indent ( & printer ) ; <nl> <nl> / / Field and oneof definitions . <nl> void GenerateMessageFile ( const FileDescriptor * file , const Descriptor * message , <nl> } <nl> printer . Print ( " \ n " ) ; <nl> <nl> + GenerateMessageConstructorDocComment ( & printer , message , is_descriptor ) ; <nl> printer . Print ( <nl> - " public function __construct ( ) { \ n " ) ; <nl> + " public function __construct ( $ data = NULL ) { \ n " ) ; <nl> Indent ( & printer ) ; <nl> <nl> std : : string metadata_filename = <nl> - GeneratedMetadataFileName ( file - > name ( ) , is_descriptor ) ; <nl> + GeneratedMetadataFileName ( file , is_descriptor ) ; <nl> std : : string metadata_fullname = FilenameToClassname ( metadata_filename ) ; <nl> printer . Print ( <nl> " \ \ ^ fullname ^ : : initOnce ( ) ; \ n " <nl> - " parent : : __construct ( ) ; \ n " , <nl> + " parent : : __construct ( $ data ) ; \ n " , <nl> " fullname " , metadata_fullname ) ; <nl> <nl> Outdent ( & printer ) ; <nl> void GenerateMessageFile ( const FileDescriptor * file , const Descriptor * message , <nl> Outdent ( & printer ) ; <nl> printer . Print ( " } \ n \ n " ) ; <nl> <nl> + / / write legacy file for backwards compatiblity with nested messages and enums <nl> + if ( message - > containing_type ( ) ! = NULL ) { <nl> + printer . Print ( <nl> + " / / Adding a class alias for backwards compatibility with the previous class name . \ n " ) ; <nl> + printer . Print ( <nl> + " class_alias ( ^ new ^ : : class , \ \ ^ old ^ : : class ) ; \ n \ n " , <nl> + " new " , fullname , <nl> + " old " , LegacyFullClassName ( message , is_descriptor ) ) ; <nl> + LegacyGenerateClassFile ( file , message , is_descriptor , generator_context ) ; <nl> + } <nl> + <nl> / / Nested messages and enums . <nl> for ( int i = 0 ; i < message - > nested_type_count ( ) ; i + + ) { <nl> GenerateMessageFile ( file , message - > nested_type ( i ) , is_descriptor , <nl> void GenerateServiceFile ( const FileDescriptor * file , <nl> std : : string fullname = FilenameToClassname ( filename ) ; <nl> int lastindex = fullname . find_last_of ( " \ \ " ) ; <nl> <nl> - if ( file - > options ( ) . has_php_namespace ( ) ) { <nl> - const string & php_namespace = file - > options ( ) . php_namespace ( ) ; <nl> - if ( ! php_namespace . empty ( ) ) { <nl> - printer . Print ( <nl> - " namespace ^ name ^ ; \ n \ n " , <nl> - " name " , php_namespace ) ; <nl> - } <nl> - } else if ( ! file - > package ( ) . empty ( ) ) { <nl> + if ( ! file - > options ( ) . php_namespace ( ) . empty ( ) | | <nl> + ( ! file - > options ( ) . has_php_namespace ( ) & & ! file - > package ( ) . empty ( ) ) | | <nl> + lastindex ! = string : : npos ) { <nl> printer . Print ( <nl> " namespace ^ name ^ ; \ n \ n " , <nl> " name " , fullname . substr ( 0 , lastindex ) ) ; <nl> static string EscapePhpdoc ( const string & input ) { <nl> } <nl> <nl> static void GenerateDocCommentBodyForLocation ( <nl> - io : : Printer * printer , const SourceLocation & location ) { <nl> + io : : Printer * printer , const SourceLocation & location , bool trailingNewline , <nl> + int indentCount ) { <nl> string comments = location . leading_comments . empty ( ) ? <nl> location . trailing_comments : location . leading_comments ; <nl> if ( ! comments . empty ( ) ) { <nl> static void GenerateDocCommentBodyForLocation ( <nl> / / Most lines should start with a space . Watch out for lines that start <nl> / / with a / , since putting that right after the leading asterisk will <nl> / / close the comment . <nl> - if ( ! lines [ i ] . empty ( ) & & lines [ i ] [ 0 ] = = ' / ' ) { <nl> + if ( indentCount = = 0 & & ! lines [ i ] . empty ( ) & & lines [ i ] [ 0 ] = = ' / ' ) { <nl> printer - > Print ( " * ^ line ^ \ n " , " line " , lines [ i ] ) ; <nl> } else { <nl> - printer - > Print ( " * ^ line ^ \ n " , " line " , lines [ i ] ) ; <nl> + std : : string indent = std : : string ( indentCount , ' ' ) ; <nl> + printer - > Print ( " * ^ ind ^ ^ line ^ \ n " , " ind " , indent , " line " , lines [ i ] ) ; <nl> } <nl> } <nl> - printer - > Print ( <nl> - " * \ n " ) ; <nl> + if ( trailingNewline ) { <nl> + printer - > Print ( " * \ n " ) ; <nl> + } <nl> } <nl> } <nl> <nl> static void GenerateDocCommentBody ( <nl> io : : Printer * printer , const DescriptorType * descriptor ) { <nl> SourceLocation location ; <nl> if ( descriptor - > GetSourceLocation ( & location ) ) { <nl> - GenerateDocCommentBodyForLocation ( printer , location ) ; <nl> + GenerateDocCommentBodyForLocation ( printer , location , true , 0 ) ; <nl> } <nl> } <nl> <nl> void GenerateMessageDocComment ( io : : Printer * printer , <nl> printer - > Print ( <nl> " * Generated from protobuf message < code > ^ messagename ^ < / code > \ n " <nl> " * / \ n " , <nl> - " fullname " , EscapePhpdoc ( PhpName ( message - > full_name ( ) , is_descriptor ) ) , <nl> + " fullname " , EscapePhpdoc ( FullClassName ( message , is_descriptor ) ) , <nl> " messagename " , EscapePhpdoc ( message - > full_name ( ) ) ) ; <nl> } <nl> <nl> + void GenerateMessageConstructorDocComment ( io : : Printer * printer , <nl> + const Descriptor * message , <nl> + int is_descriptor ) { <nl> + / / In theory we should have slightly different comments for setters , getters , <nl> + / / etc . , but in practice everyone already knows the difference between these <nl> + / / so it ' s redundant information . <nl> + <nl> + / / We start the comment with the main body based on the comments from the <nl> + / / . proto file ( if present ) . We then end with the field declaration , e . g . : <nl> + / / optional string foo = 5 ; <nl> + / / If the field is a group , the debug string might end with { . <nl> + printer - > Print ( " / * * \ n " ) ; <nl> + printer - > Print ( " * Constructor . \ n " ) ; <nl> + printer - > Print ( " * \ n " ) ; <nl> + printer - > Print ( " * @ param array $ data { \ n " ) ; <nl> + printer - > Print ( " * Optional . Data for populating the Message object . \ n " ) ; <nl> + printer - > Print ( " * \ n " ) ; <nl> + for ( int i = 0 ; i < message - > field_count ( ) ; i + + ) { <nl> + const FieldDescriptor * field = message - > field ( i ) ; <nl> + printer - > Print ( " * @ type ^ php_type ^ $ ^ var ^ \ n " , <nl> + " php_type " , PhpSetterTypeName ( field , is_descriptor ) , <nl> + " var " , field - > name ( ) ) ; <nl> + SourceLocation location ; <nl> + if ( field - > GetSourceLocation ( & location ) ) { <nl> + GenerateDocCommentBodyForLocation ( printer , location , false , 10 ) ; <nl> + } <nl> + } <nl> + printer - > Print ( " * } \ n " ) ; <nl> + printer - > Print ( " * / \ n " ) ; <nl> + } <nl> + <nl> void GenerateServiceDocComment ( io : : Printer * printer , <nl> const ServiceDescriptor * service ) { <nl> printer - > Print ( " / * * \ n " ) ; <nl> void GenerateEnumDocComment ( io : : Printer * printer , const EnumDescriptor * enum_ , <nl> printer - > Print ( " / * * \ n " ) ; <nl> GenerateDocCommentBody ( printer , enum_ ) ; <nl> printer - > Print ( <nl> - " * Protobuf enum < code > ^ fullname ^ < / code > \ n " <nl> + " * Protobuf type < code > ^ fullname ^ < / code > \ n " <nl> " * / \ n " , <nl> - " fullname " , EscapePhpdoc ( PhpName ( enum_ - > full_name ( ) , is_descriptor ) ) ) ; <nl> + " fullname " , EscapePhpdoc ( enum_ - > full_name ( ) ) ) ; <nl> } <nl> <nl> void GenerateEnumValueDocComment ( io : : Printer * printer , <nl> bool Generator : : Generate ( const FileDescriptor * file , const string & parameter , <nl> return true ; <nl> } <nl> <nl> - std : : string GeneratedClassName ( const Descriptor * desc ) { <nl> - std : : string classname = desc - > name ( ) ; <nl> - const Descriptor * containing = desc - > containing_type ( ) ; <nl> - while ( containing ! = NULL ) { <nl> - classname = containing - > name ( ) + ' _ ' + classname ; <nl> - containing = containing - > containing_type ( ) ; <nl> - } <nl> - return ClassNamePrefix ( classname , desc ) + classname ; <nl> - } <nl> - <nl> - std : : string GeneratedClassName ( const EnumDescriptor * desc ) { <nl> - std : : string classname = desc - > name ( ) ; <nl> - const Descriptor * containing = desc - > containing_type ( ) ; <nl> - while ( containing ! = NULL ) { <nl> - classname = containing - > name ( ) + ' _ ' + classname ; <nl> - containing = containing - > containing_type ( ) ; <nl> - } <nl> - return ClassNamePrefix ( classname , desc ) + classname ; <nl> - } <nl> - <nl> - std : : string GeneratedClassName ( const ServiceDescriptor * desc ) { <nl> - std : : string classname = desc - > name ( ) ; <nl> - return ClassNamePrefix ( classname , desc ) + classname ; <nl> - } <nl> - <nl> } / / namespace php <nl> } / / namespace compiler <nl> } / / namespace protobuf <nl> mmm a / src / google / protobuf / compiler / php / php_generator . h <nl> ppp b / src / google / protobuf / compiler / php / php_generator . h <nl> class LIBPROTOC_EXPORT Generator <nl> <nl> } ; <nl> <nl> - / / To skip reserved keywords in php , some generated classname are prefixed . <nl> - / / Other code generators may need following API to figure out the actual <nl> - / / classname . <nl> - LIBPROTOC_EXPORT std : : string GeneratedClassName ( <nl> - const google : : protobuf : : Descriptor * desc ) ; <nl> - LIBPROTOC_EXPORT std : : string GeneratedClassName ( <nl> - const google : : protobuf : : EnumDescriptor * desc ) ; <nl> - LIBPROTOC_EXPORT std : : string GeneratedClassName ( <nl> - const google : : protobuf : : ServiceDescriptor * desc ) ; <nl> - <nl> } / / namespace php <nl> } / / namespace compiler <nl> } / / namespace protobuf <nl> mmm a / src / google / protobuf / compiler / ruby / ruby_generator . cc <nl> ppp b / src / google / protobuf / compiler / ruby / ruby_generator . cc <nl> void GenerateEnumAssignment ( <nl> } <nl> <nl> int GeneratePackageModules ( <nl> - std : : string package_name , <nl> + const FileDescriptor * file , <nl> google : : protobuf : : io : : Printer * printer ) { <nl> int levels = 0 ; <nl> + bool need_change_to_module ; <nl> + std : : string package_name ; <nl> + <nl> + if ( file - > options ( ) . has_ruby_package ( ) ) { <nl> + package_name = file - > options ( ) . ruby_package ( ) ; <nl> + need_change_to_module = false ; <nl> + } else { <nl> + package_name = file - > package ( ) ; <nl> + need_change_to_module = true ; <nl> + } <nl> + <nl> while ( ! package_name . empty ( ) ) { <nl> size_t dot_index = package_name . find ( " . " ) ; <nl> string component ; <nl> int GeneratePackageModules ( <nl> component = package_name . substr ( 0 , dot_index ) ; <nl> package_name = package_name . substr ( dot_index + 1 ) ; <nl> } <nl> - component = PackageToModule ( component ) ; <nl> + if ( need_change_to_module ) { <nl> + component = PackageToModule ( component ) ; <nl> + } <nl> printer - > Print ( <nl> " module $ name $ \ n " , <nl> " name " , component ) ; <nl> bool GenerateFile ( const FileDescriptor * file , io : : Printer * printer , <nl> printer - > Print ( <nl> " end \ n \ n " ) ; <nl> <nl> - int levels = GeneratePackageModules ( file - > package ( ) , printer ) ; <nl> + int levels = GeneratePackageModules ( file , printer ) ; <nl> for ( int i = 0 ; i < file - > message_type_count ( ) ; i + + ) { <nl> GenerateMessageAssignment ( " " , file - > message_type ( i ) , printer ) ; <nl> } <nl> mmm a / tests . sh <nl> ppp b / tests . sh <nl> build_csharp ( ) { <nl> # Check that the protos haven ' t broken C # codegen . <nl> # TODO ( jonskeet ) : Fail if regenerating creates any changes . <nl> csharp / generate_protos . sh <nl> - <nl> + <nl> csharp / buildall . sh <nl> cd conformance & & make test_csharp & & cd . . <nl> <nl> generate_php_test_proto ( ) { <nl> rm - rf generated <nl> mkdir generated <nl> . . / . . / src / protoc - - php_out = generated \ <nl> + proto / empty / echo . proto \ <nl> proto / test . proto \ <nl> proto / test_include . proto \ <nl> proto / test_no_namespace . proto \ <nl>
|
Merge pull request from TeBoring / 3 . 6 . x
|
protocolbuffers/protobuf
|
4885b8058a93c1a16efe41fd1830d321e9bb2ce6
|
2018-05-25T20:43:22Z
|
mmm a / samples / cpp / chamfer . cpp <nl> ppp b / samples / cpp / chamfer . cpp <nl> using namespace std ; <nl> void help ( ) <nl> { <nl> cout < < <nl> - " \ nThis program demonstrates chamfer matching - - computing a distance between an \ n " <nl> + " \ nThis program demonstrates Chamfer matching - - computing a distance between an \ n " <nl> " edge template and a query edge image . \ n " <nl> " Call : \ n " <nl> " . / chamfer [ < image edge map > < template edge map > ] \ n " <nl>
|
revamped
|
opencv/opencv
|
3f8173af2f0962be6930332c3a7812b23075fde0
|
2010-12-04T08:29:00Z
|
new file mode 100644 <nl> index 00000000000 . . 978ea96aad4 <nl> mmm / dev / null <nl> ppp b / tests / core / test_simd . in <nl> <nl> + <nl> + # include < stdio . h > <nl> + <nl> + # include < emscripten / vector . h > <nl> + <nl> + static inline float32x4 __attribute__ ( ( always_inline ) ) <nl> + _mm_set_ps ( const float __Z , const float __Y , const float __X , const float __W ) <nl> + { <nl> + return ( float32x4 ) { __W , __X , __Y , __Z } ; <nl> + } <nl> + <nl> + static __inline__ float32x4 __attribute__ ( ( __always_inline__ ) ) <nl> + _mm_setzero_ps ( void ) <nl> + { <nl> + return ( float32x4 ) { 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 } ; <nl> + } <nl> + <nl> + int main ( int argc , char * * argv ) { <nl> + float data [ 8 ] ; <nl> + for ( int i = 0 ; i < 32 ; i + + ) data [ i ] = ( 1 + i + argc ) * ( 2 + i + argc * argc ) ; / / confuse optimizer <nl> + { <nl> + float32x4 * a = ( float32x4 * ) & data [ 0 ] ; <nl> + float32x4 * b = ( float32x4 * ) & data [ 4 ] ; <nl> + float32x4 c , d ; <nl> + c = * a ; <nl> + d = * b ; <nl> + printf ( " 1floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> + c = c + d ; <nl> + printf ( " 2floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> + d = c * d ; <nl> + printf ( " 3floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> + c = _mm_setzero_ps ( ) ; <nl> + printf ( " zeros % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] ) ; <nl> + } <nl> + { <nl> + int32x4 * a = ( int32x4 * ) & data [ 0 ] ; <nl> + int32x4 * b = ( int32x4 * ) & data [ 4 ] ; <nl> + int32x4 c , d , e , f ; <nl> + c = * a ; <nl> + d = * b ; <nl> + printf ( " 4ints ! % d , % d , % d , % d % d , % d , % d , % d \ n " , c [ 0 ] , c [ 1 ] , c [ 2 ] , c [ 3 ] , d [ 0 ] , d [ 1 ] , d [ 2 ] , d [ 3 ] ) ; <nl> + e = c + d ; <nl> + f = c - d ; <nl> + printf ( " 5ints ! % d , % d , % d , % d % d , % d , % d , % d \ n " , e [ 0 ] , e [ 1 ] , e [ 2 ] , e [ 3 ] , f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ) ; <nl> + e = c & d ; <nl> + f = c | d ; <nl> + e = ~ c & d ; <nl> + f = c ^ d ; <nl> + printf ( " 5intops ! % d , % d , % d , % d % d , % d , % d , % d \ n " , e [ 0 ] , e [ 1 ] , e [ 2 ] , e [ 3 ] , f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ) ; <nl> + } <nl> + { <nl> + float32x4 c , d , e , f ; <nl> + c = _mm_set_ps ( 9 . 0 , 4 . 0 , 0 , - 9 . 0 ) ; <nl> + d = _mm_set_ps ( 10 . 0 , 14 . 0 , - 12 , - 2 . 0 ) ; <nl> + printf ( " 6floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> + printf ( " 7calcs : % d \ n " , emscripten_float32x4_signmask ( c ) ) ; / / TODO : just not just compilation but output as well <nl> + } <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> \ No newline at end of file <nl> new file mode 100644 <nl> index 00000000000 . . 08ca373866d <nl> mmm / dev / null <nl> ppp b / tests / core / test_simd . out <nl> <nl> + 1floats ! 6 , 12 , 20 , 30 42 , 56 , 72 , 90 <nl> + 2floats ! 48 , 68 , 92 , 120 42 , 56 , 72 , 90 <nl> + 3floats ! 48 , 68 , 92 , 120 2016 , 3808 , 6624 , 10800 <nl> + zeros 0 , 0 , 0 , 0 <nl> + 4ints ! 1086324736 , 1094713344 , 1101004800 , 1106247680 1109917696 , 1113587712 , 1116733440 , 1119092736 <nl> + 5ints ! - 2098724864 , - 2086666240 , - 2077229056 , - 2069626880 - 23592960 , - 18874368 , - 15728640 , - 12845056 <nl> + 5intops ! 36175872 , 35651584 , 34603008 , 33816576 48758784 , 52428800 , 53477376 , 54788096 <nl> + 6floats ! - 9 , 0 , 4 , 9 - 2 , - 12 , 14 , 10 <nl> mmm a / tests / test_core . py <nl> ppp b / tests / test_core . py <nl> def test_cubescript ( self ) : <nl> def test_simd ( self ) : <nl> if Settings . USE_TYPED_ARRAYS ! = 2 : return self . skip ( ' needs ta2 ' ) <nl> if Settings . ASM_JS : Settings . ASM_JS = 2 # does not validate <nl> - src = r ' ' ' <nl> - # include < stdio . h > <nl> - <nl> - # include < emscripten / vector . h > <nl> <nl> - static inline float32x4 __attribute__ ( ( always_inline ) ) <nl> - _mm_set_ps ( const float __Z , const float __Y , const float __X , const float __W ) <nl> - { <nl> - return ( float32x4 ) { __W , __X , __Y , __Z } ; <nl> - } <nl> - <nl> - static __inline__ float32x4 __attribute__ ( ( __always_inline__ ) ) <nl> - _mm_setzero_ps ( void ) <nl> - { <nl> - return ( float32x4 ) { 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 } ; <nl> - } <nl> - <nl> - int main ( int argc , char * * argv ) { <nl> - float data [ 8 ] ; <nl> - for ( int i = 0 ; i < 32 ; i + + ) data [ i ] = ( 1 + i + argc ) * ( 2 + i + argc * argc ) ; / / confuse optimizer <nl> - { <nl> - float32x4 * a = ( float32x4 * ) & data [ 0 ] ; <nl> - float32x4 * b = ( float32x4 * ) & data [ 4 ] ; <nl> - float32x4 c , d ; <nl> - c = * a ; <nl> - d = * b ; <nl> - printf ( " 1floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> - c = c + d ; <nl> - printf ( " 2floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> - d = c * d ; <nl> - printf ( " 3floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> - c = _mm_setzero_ps ( ) ; <nl> - printf ( " zeros % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] ) ; <nl> - } <nl> - { <nl> - int32x4 * a = ( int32x4 * ) & data [ 0 ] ; <nl> - int32x4 * b = ( int32x4 * ) & data [ 4 ] ; <nl> - int32x4 c , d , e , f ; <nl> - c = * a ; <nl> - d = * b ; <nl> - printf ( " 4ints ! % d , % d , % d , % d % d , % d , % d , % d \ n " , c [ 0 ] , c [ 1 ] , c [ 2 ] , c [ 3 ] , d [ 0 ] , d [ 1 ] , d [ 2 ] , d [ 3 ] ) ; <nl> - e = c + d ; <nl> - f = c - d ; <nl> - printf ( " 5ints ! % d , % d , % d , % d % d , % d , % d , % d \ n " , e [ 0 ] , e [ 1 ] , e [ 2 ] , e [ 3 ] , f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ) ; <nl> - e = c & d ; <nl> - f = c | d ; <nl> - e = ~ c & d ; <nl> - f = c ^ d ; <nl> - printf ( " 5intops ! % d , % d , % d , % d % d , % d , % d , % d \ n " , e [ 0 ] , e [ 1 ] , e [ 2 ] , e [ 3 ] , f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ) ; <nl> - } <nl> - { <nl> - float32x4 c , d , e , f ; <nl> - c = _mm_set_ps ( 9 . 0 , 4 . 0 , 0 , - 9 . 0 ) ; <nl> - d = _mm_set_ps ( 10 . 0 , 14 . 0 , - 12 , - 2 . 0 ) ; <nl> - printf ( " 6floats ! % d , % d , % d , % d % d , % d , % d , % d \ n " , ( int ) c [ 0 ] , ( int ) c [ 1 ] , ( int ) c [ 2 ] , ( int ) c [ 3 ] , ( int ) d [ 0 ] , ( int ) d [ 1 ] , ( int ) d [ 2 ] , ( int ) d [ 3 ] ) ; <nl> - printf ( " 7calcs : % d \ n " , emscripten_float32x4_signmask ( c ) ) ; / / TODO : just not just compilation but output as well <nl> - } <nl> - <nl> - return 0 ; <nl> - } <nl> - ' ' ' <nl> + test_path = path_from_root ( ' tests ' , ' core ' , ' test_simd ' ) <nl> + src , output = ( test_path + s for s in ( ' . in ' , ' . out ' ) ) <nl> <nl> - self . do_run ( src , ' ' ' 1floats ! 6 , 12 , 20 , 30 42 , 56 , 72 , 90 <nl> - 2floats ! 48 , 68 , 92 , 120 42 , 56 , 72 , 90 <nl> - 3floats ! 48 , 68 , 92 , 120 2016 , 3808 , 6624 , 10800 <nl> - zeros 0 , 0 , 0 , 0 <nl> - 4ints ! 1086324736 , 1094713344 , 1101004800 , 1106247680 1109917696 , 1113587712 , 1116733440 , 1119092736 <nl> - 5ints ! - 2098724864 , - 2086666240 , - 2077229056 , - 2069626880 - 23592960 , - 18874368 , - 15728640 , - 12845056 <nl> - 5intops ! 36175872 , 35651584 , 34603008 , 33816576 48758784 , 52428800 , 53477376 , 54788096 <nl> - 6floats ! - 9 , 0 , 4 , 9 - 2 , - 12 , 14 , 10 <nl> - ' ' ' ) <nl> + self . do_run_from_file ( src , output ) <nl> <nl> def test_simd2 ( self ) : <nl> if Settings . ASM_JS : Settings . ASM_JS = 2 # does not validate <nl>
|
Use do_run_from_file ( ) for test_simd
|
emscripten-core/emscripten
|
37cfd33068ad6ae43fc644a6f620856d63ba68b7
|
2013-12-07T17:36:02Z
|
mmm a / Marlin / Conditionals_post . h <nl> ppp b / Marlin / Conditionals_post . h <nl> <nl> / / Stepper pulse duration , in cycles <nl> # define STEP_PULSE_CYCLES ( ( MINIMUM_STEPPER_PULSE ) * CYCLES_PER_MICROSECOND ) <nl> <nl> - # ifndef DELTA_ENDSTOP_ADJ_X <nl> - # define DELTA_ENDSTOP_ADJ_X 0 <nl> - # endif <nl> - # ifndef DELTA_ENDSTOP_ADJ_Y <nl> - # define DELTA_ENDSTOP_ADJ_Y 0 <nl> - # endif <nl> - # ifndef DELTA_ENDSTOP_ADJ_Z <nl> - # define DELTA_ENDSTOP_ADJ_Z 0 <nl> + # ifndef DELTA_ENDSTOP_ADJ <nl> + # define DELTA_ENDSTOP_ADJ { 0 } <nl> # endif <nl> <nl> # endif / / CONDITIONALS_POST_H <nl> mmm a / Marlin / configuration_store . cpp <nl> ppp b / Marlin / configuration_store . cpp <nl> void Config_ResetDefault ( ) { <nl> # endif <nl> <nl> # if ENABLED ( DELTA ) <nl> - endstop_adj [ X_AXIS ] = DELTA_ENDSTOP_ADJ_X ; <nl> - endstop_adj [ Y_AXIS ] = DELTA_ENDSTOP_ADJ_Y ; <nl> - endstop_adj [ Z_AXIS ] = DELTA_ENDSTOP_ADJ_Z ; <nl> + const float adj [ ABC ] = DELTA_ENDSTOP_ADJ ; <nl> + endstop_adj [ A_AXIS ] = adj [ A_AXIS ] ; <nl> + endstop_adj [ B_AXIS ] = adj [ B_AXIS ] ; <nl> + endstop_adj [ C_AXIS ] = adj [ C_AXIS ] ; <nl> delta_radius = DELTA_RADIUS ; <nl> delta_diagonal_rod = DELTA_DIAGONAL_ROD ; <nl> delta_segments_per_second = DELTA_SEGMENTS_PER_SECOND ; <nl> mmm a / Marlin / example_configurations / delta / biv2 . 5 / Configuration . h <nl> ppp b / Marlin / example_configurations / delta / biv2 . 5 / Configuration . h <nl> <nl> / / in ultralcd . cpp @ lcd_delta_calibrate_menu ( ) <nl> / / # define DELTA_CALIBRATION_MENU <nl> <nl> + / / # define DELTA_ENDSTOP_ADJ { 0 , 0 , 0 } <nl> + <nl> # endif <nl> <nl> / / Enable this option for Toshiba steppers <nl> mmm a / Marlin / example_configurations / delta / generic / Configuration . h <nl> ppp b / Marlin / example_configurations / delta / generic / Configuration . h <nl> <nl> / / in ultralcd . cpp @ lcd_delta_calibrate_menu ( ) <nl> / / # define DELTA_CALIBRATION_MENU <nl> <nl> + / / # define DELTA_ENDSTOP_ADJ { 0 , 0 , 0 } <nl> + <nl> # endif <nl> <nl> / / Enable this option for Toshiba steppers <nl> mmm a / Marlin / example_configurations / delta / kossel_mini / Configuration . h <nl> ppp b / Marlin / example_configurations / delta / kossel_mini / Configuration . h <nl> <nl> / / in ultralcd . cpp @ lcd_delta_calibrate_menu ( ) <nl> / / # define DELTA_CALIBRATION_MENU <nl> <nl> + / / # define DELTA_ENDSTOP_ADJ { 0 , 0 , 0 } <nl> + <nl> # endif <nl> <nl> / / Enable this option for Toshiba steppers <nl> mmm a / Marlin / example_configurations / delta / kossel_pro / Configuration . h <nl> ppp b / Marlin / example_configurations / delta / kossel_pro / Configuration . h <nl> <nl> / / in ultralcd . cpp @ lcd_delta_calibrate_menu ( ) <nl> / / # define DELTA_CALIBRATION_MENU <nl> <nl> + / / # define DELTA_ENDSTOP_ADJ { 0 , 0 , 0 } <nl> + <nl> # endif <nl> <nl> / / Enable this option for Toshiba steppers <nl> mmm a / Marlin / example_configurations / delta / kossel_xl / Configuration . h <nl> ppp b / Marlin / example_configurations / delta / kossel_xl / Configuration . h <nl> <nl> / / in ultralcd . cpp @ lcd_delta_calibrate_menu ( ) <nl> / / # define DELTA_CALIBRATION_MENU <nl> <nl> + / / # define DELTA_ENDSTOP_ADJ { 0 , 0 , 0 } <nl> + <nl> # endif <nl> <nl> / / Enable this option for Toshiba steppers <nl>
|
Patch delta endstop adjustment config
|
MarlinFirmware/Marlin
|
48761f2021db59e7b1b5c6db615b9f3c34551c64
|
2016-10-09T18:32:45Z
|
mmm a / stdlib / public / core / ArrayBuffer . swift <nl> ppp b / stdlib / public / core / ArrayBuffer . swift <nl> extension _ArrayBuffer { <nl> } <nl> <nl> / / / Copy the elements in ` bounds ` from this buffer into uninitialized <nl> - / / / memory starting at ` target ` . Return a pointer past - the - end of the <nl> + / / / memory starting at ` target ` . Return a pointer " past the end " of the <nl> / / / just - initialized memory . <nl> @ discardableResult <nl> public func _copyContents ( <nl> mmm a / stdlib / public / core / ArrayBufferProtocol . swift <nl> ppp b / stdlib / public / core / ArrayBufferProtocol . swift <nl> public protocol _ArrayBufferProtocol <nl> init ( _ buffer : _ContiguousArrayBuffer < Element > , shiftedToStartIndex : Int ) <nl> <nl> / / / Copy the elements in ` bounds ` from this buffer into uninitialized <nl> - / / / memory starting at ` target ` . Return a pointer past - the - end of the <nl> + / / / memory starting at ` target ` . Return a pointer " past the end " of the <nl> / / / just - initialized memory . <nl> @ discardableResult <nl> func _copyContents ( <nl> mmm a / stdlib / public / core / Arrays . swift . gyb <nl> ppp b / stdlib / public / core / Arrays . swift . gyb <nl> public struct $ { Self } < Element > <nl> % end <nl> } <nl> <nl> - / / / The array ' s " past - the - end " position , or one greater than the last valid <nl> + / / / The array ' s " past the end " position , or one greater than the last valid <nl> / / / subscript argument . <nl> / / / <nl> / / / When you need a range that includes the last element of an array , use the <nl> - / / / ` . . < ` operator with ` endIndex ` . The half - open range operator ( ` . . < ` ) <nl> + / / / half - open range operator ( ` . . < ` ) with ` endIndex ` . The ` . . < ` operator <nl> / / / creates a range that doesn ' t include the upper bound , so it ' s always <nl> / / / safe to use with ` endIndex ` . For example : <nl> / / / <nl> public struct $ { Self } < Element > <nl> i - = 1 <nl> } <nl> <nl> + / / / Returns an index that is the specified distance from the given index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from an <nl> + / / / array ' s starting index and then prints the element at that position . <nl> + / / / <nl> + / / / let numbers = [ 10 , 20 , 30 , 40 , 50 ] <nl> + / / / let i = numbers . index ( numbers . startIndex , offsetBy : 4 ) <nl> + / / / print ( numbers [ i ] ) <nl> + / / / / / Prints " 50 " <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the array . <nl> + / / / - n : The distance to offset ` i ` . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` . If ` n ` is positive , <nl> + / / / this is the same value as the result of ` n ` calls to ` index ( after : ) ` . <nl> + / / / If ` n ` is negative , this is the same value as the result of ` - n ` calls <nl> + / / / to ` index ( before : ) ` . <nl> + / / / <nl> + / / / - Precondition : <nl> + / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> + / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> + / / / - Complexity : O ( 1 ) <nl> @ warn_unused_result <nl> public func index ( _ i : Int , offsetBy n : Int ) - > Int { <nl> / / NOTE : this is a manual specialization of index movement for a Strideable <nl> public struct $ { Self } < Element > <nl> return i + n <nl> } <nl> <nl> + / / / Returns an index that is the specified distance from the given index , <nl> + / / / unless that distance is beyond a given limiting index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from an <nl> + / / / array ' s starting index and then prints the element at that position . The <nl> + / / / operation doesn ' t require going beyond the limiting ` numbers . endIndex ` <nl> + / / / value , so it succeeds . <nl> + / / / <nl> + / / / let numbers = [ 10 , 20 , 30 , 40 , 50 ] <nl> + / / / let i = numbers . index ( numbers . startIndex , <nl> + / / / offsetBy : 4 , <nl> + / / / limitedBy : numbers . endIndex ) <nl> + / / / print ( numbers [ i ] ) <nl> + / / / / / Prints " 50 " <nl> + / / / <nl> + / / / The next example attempts to retrieve an index ten positions from <nl> + / / / ` numbers . startIndex ` , but fails , because that distance is beyond the <nl> + / / / index passed as ` limit ` . <nl> + / / / <nl> + / / / let j = numbers . index ( numbers . startIndex , <nl> + / / / offsetBy : 10 , <nl> + / / / limitedBy : numbers . endIndex ) <nl> + / / / print ( j ) <nl> + / / / / / Prints " nil " <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the array . <nl> + / / / - n : The distance to offset ` i ` . <nl> + / / / - limit : A valid index of the collection to use as a limit . If ` n > 0 ` , <nl> + / / / ` limit ` has no effect if it is less than ` i ` . Likewise , if ` n < 0 ` , <nl> + / / / ` limit ` has no effect if it is greater than ` i ` . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` , unless that index <nl> + / / / would be beyond ` limit ` in the direction of movement . In that case , <nl> + / / / the method returns ` nil ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Complexity : O ( 1 ) <nl> @ warn_unused_result <nl> public func index ( <nl> _ i : Int , offsetBy n : Int , limitedBy limit : Int <nl> public struct $ { Self } < Element > <nl> return i + n <nl> } <nl> <nl> + / / / Returns the distance between two indices . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - start : A valid index of the collection . <nl> + / / / - end : Another valid index of the collection . If ` end ` is equal to <nl> + / / / ` start ` , the result is zero . <nl> + / / / - Returns : The distance between ` start ` and ` end ` . <nl> @ warn_unused_result <nl> public func distance ( from start : Int , to end : Int ) - > Int { <nl> / / NOTE : this is a manual specialization of index movement for a Strideable <nl> extension $ { Self } : RangeReplaceableCollection , _ArrayProtocol { <nl> / / / value . <nl> / / / <nl> / / / Here ' s an example of creating an array initialized with five strings <nl> - / / / containing the letter " Z " . <nl> + / / / containing the letter * Z * . <nl> / / / <nl> / / / let fiveZs = Array ( repeating : " Z " , count : 5 ) <nl> / / / print ( fiveZs ) <nl> extension $ { Self } : RangeReplaceableCollection , _ArrayProtocol { <nl> <nl> / / / Reserves enough space to store the specified number of elements . <nl> / / / <nl> - / / / Use this method to avoid multiple reallocations if you will be adding <nl> - / / / a known number of elements to an array . This method ensures that the <nl> - / / / array has unique , mutable , contiguous storage , with space allocated for <nl> - / / / at least the requested number of elements . <nl> + / / / If you are adding a known number of elements to an array , use this method <nl> + / / / to avoid multiple reallocations . This method ensures that the array has <nl> + / / / unique , mutable , contiguous storage , with space allocated for at least <nl> + / / / the requested number of elements . <nl> / / / <nl> - / / / For performance reasons , the newly allocated storage may be larger <nl> - / / / than the requested capacity . Use the array ' s ` capacity ` property to <nl> - / / / determine the size of the new storage . <nl> + / / / For performance reasons , the newly allocated storage may be larger than <nl> + / / / the requested capacity . Use the array ' s ` capacity ` property to determine <nl> + / / / the size of the new storage . <nl> / / / <nl> / / / - Parameter minimumCapacity : The requested number of elements to store . <nl> + / / / <nl> / / / - Complexity : O ( * n * ) , where * n * is the count of the array . <nl> @ _semantics ( " array . mutate_unknown " ) <nl> public mutating func reserveCapacity ( _ minimumCapacity : Int ) { <nl> extension $ { Self } { <nl> / / / removed . <nl> / / / <nl> / / / In this example , three elements in the middle of an array of integers are <nl> - / / / replaced by the five elements of a ` Repeat < Int > ` instance . <nl> + / / / replaced by the five elements of a ` Repeated < Int > ` instance . <nl> / / / <nl> / / / var nums = [ 10 , 20 , 30 , 40 , 50 ] <nl> - / / / nums . replaceSubrange ( 1 . . . 3 , with : Repeat ( count : 5 , repeatedValue : 1 ) ) ) <nl> + / / / nums . replaceSubrange ( 1 . . . 3 , with : repeatElement ( 1 , count : 5 ) ) <nl> / / / print ( nums ) <nl> / / / / / Prints " [ 10 , 1 , 1 , 1 , 1 , 1 , 50 ] " <nl> / / / <nl> mmm a / stdlib / public / core / BidirectionalCollection . swift <nl> ppp b / stdlib / public / core / BidirectionalCollection . swift <nl> <nl> / / <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> - / / / A type that provides subscript access to its elements , with <nl> - / / / bidirectional index traversal . <nl> + / / / A type that provides subscript access to its elements , with bidirectional <nl> + / / / index traversal . <nl> / / / <nl> - / / / - Important : In most cases , it ' s best to ignore this protocol and use <nl> - / / / ` BidirectionalCollection ` instead , as it has a more complete interface . <nl> + / / / In most cases , it ' s best to ignore this protocol and use the <nl> + / / / ` BidirectionalCollection ` protocol instead , because it has a more complete <nl> + / / / interface . <nl> public protocol BidirectionalIndexable : Indexable { <nl> / / FIXME ( ABI ) ( compiler limitation ) : there is no reason for this protocol <nl> / / to exist apart from missing compiler features that we emulate with it . <nl> public protocol BidirectionalIndexable : Indexable { <nl> / / This protocol is almost an implementation detail of the standard <nl> / / library . <nl> <nl> - / / / Returns the position immediately preceding ` i ` . <nl> + / / / Returns the position immediately before the given index . <nl> / / / <nl> - / / / - If ` i > = startIndex & & i < endIndex ` , <nl> - / / / ` index ( before : index ( after : i ) ) = = i ` . <nl> - / / / <nl> - / / / - If ` i > startIndex & & i < = endIndex ` <nl> - / / / ` index ( after : index ( before : i ) ) = = i ` . <nl> - / / / <nl> - / / / - Precondition : ` i > startIndex & & i < = endIndex ` <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be greater than <nl> + / / / ` startIndex ` . <nl> + / / / - Returns : The index value immediately before ` i ` . <nl> @ warn_unused_result <nl> func index ( before i : Index ) - > Index <nl> <nl> - / / / Replaces ` i ` with its predecessor . <nl> + / / / Replaces the given index with its predecessor . <nl> + / / / <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be greater than <nl> + / / / ` startIndex ` . <nl> func formIndex ( before i : inout Index ) <nl> } <nl> <nl> / / / A collection that supports backward as well as forward traversal . <nl> / / / <nl> - / / / For any index ` i ` into a bidirectional collection ` c ` : <nl> + / / / Bidirectional collections offer traversal backward from any valid index , <nl> + / / / not including a collection ' s ` startIndex ` . Bidirectional collections can <nl> + / / / therefore offer additional operations , such as a ` last ` property that <nl> + / / / provides efficient access to the last element and a ` reversed ( ) ` method <nl> + / / / that presents the elements in reverse order . In addition , bidirectional <nl> + / / / collections have more efficient implementations of some sequence and <nl> + / / / collection methods , such as ` suffix ( _ : ) ` . <nl> + / / / <nl> + / / / Conforming to the BidirectionalCollection Protocol <nl> + / / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + / / / <nl> + / / / To add ` BidirectionalProtocol ` conformance to your custom types , implement <nl> + / / / the ` index ( before : ) ` method in addition to the requirements of the <nl> + / / / ` Collection ` protocol . <nl> + / / / <nl> + / / / Indices that are moved forward and backward in a bidirectional collection <nl> + / / / move by the same amount in each direction . That is , for any index ` i ` into <nl> + / / / a bidirectional collection ` c ` : <nl> / / / <nl> / / / - If ` i > = c . startIndex & & i < c . endIndex ` , <nl> / / / ` c . index ( before : c . index ( after : i ) ) = = i ` . <nl> - / / / <nl> / / / - If ` i > c . startIndex & & i < = c . endIndex ` <nl> / / / ` c . index ( after : c . index ( before : i ) ) = = i ` . <nl> public protocol BidirectionalCollection <nl> : BidirectionalIndexable , Collection { <nl> <nl> / / TODO : swift - 3 - indexing - model - replaces functionality in BidirectionalIndex <nl> - / / / Returns the position immediately preceding ` i ` . <nl> + / / / Returns the position immediately before the given index . <nl> / / / <nl> - / / / - Precondition : ` i > startIndex & & i < = endIndex ` <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be greater than <nl> + / / / ` startIndex ` . <nl> + / / / - Returns : The index value immediately before ` i ` . <nl> @ warn_unused_result <nl> func index ( before i : Index ) - > Index <nl> <nl> - / / / Replaces ` i ` with its predecessor . <nl> + / / / Replaces the given index with its predecessor . <nl> / / / <nl> - / / / - Precondition : ` i > startIndex & & i < = endIndex ` <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be greater than <nl> + / / / ` startIndex ` . <nl> func formIndex ( before i : inout Index ) <nl> <nl> + / / / A sequence that can represent a contiguous subrange of the collection ' s <nl> + / / / elements . <nl> associatedtype SubSequence : BidirectionalIndexable , Collection <nl> = BidirectionalSlice < Self > <nl> / / FIXME ( compiler limitation ) : <nl> / / associatedtype SubSequence : BidirectionalCollection <nl> <nl> + / / / A type that can represent the indices that are valid for subscripting the <nl> + / / / collection , in ascending order . <nl> associatedtype Indices : BidirectionalIndexable , Collection <nl> = DefaultBidirectionalIndices < Self > <nl> / / FIXME ( compiler limitation ) : <nl> / / associatedtype Indices : BidirectionalCollection <nl> <nl> / / TODO : swift - 3 - indexing - model : tests . <nl> - / / / The last element of ` self ` , or ` nil ` if ` self ` is empty . <nl> + / / / The last element of the collection . <nl> + / / / <nl> + / / / If the collection is empty , the value of this property is ` nil ` . <nl> + / / / <nl> + / / / let numbers = [ 10 , 20 , 30 , 40 , 50 ] <nl> + / / / if let lastNumber = numbers . last { <nl> + / / / print ( lastNumber ) <nl> + / / / } <nl> + / / / / / Prints " 50 " <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) <nl> var last : Iterator . Element ? { get } <nl> } <nl> <nl> extension BidirectionalIndexable where SubSequence = = BidirectionalSlice < Self > { <nl> } <nl> <nl> extension BidirectionalCollection where SubSequence = = Self { <nl> - / / / If ` ! self . isEmpty ` , remove the last element and return it , otherwise <nl> - / / / return ` nil ` . <nl> + / / / Removes and returns the last element of the collection . <nl> / / / <nl> - / / / - Complexity : O ( 1 ) <nl> + / / / - Returns : The last element of the collection if the collection has one <nl> + / / / or more elements ; otherwise , ` nil ` . <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) . <nl> + / / / - SeeAlso : ` removeLast ( ) ` <nl> @ warn_unused_result <nl> public mutating func popLast ( ) - > Iterator . Element ? { <nl> guard ! isEmpty else { return nil } <nl> extension BidirectionalCollection where SubSequence = = Self { <nl> return element <nl> } <nl> <nl> - / / / Remove an element from the end . <nl> + / / / Removes and returns the last element of the collection . <nl> + / / / <nl> + / / / The collection must not be empty . <nl> + / / / <nl> + / / / - Returns : The last element of the collection . <nl> / / / <nl> / / / - Complexity : O ( 1 ) <nl> - / / / - Precondition : ` ! self . isEmpty ` <nl> + / / / - SeeAlso : ` popLast ( ) ` <nl> @ discardableResult <nl> public mutating func removeLast ( ) - > Iterator . Element { <nl> let element = last ! <nl> extension BidirectionalCollection where SubSequence = = Self { <nl> return element <nl> } <nl> <nl> - / / / Remove the last ` n ` elements . <nl> + / / / Removes the given number of elements from the end of the collection . <nl> / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` <nl> - / / / - O ( n ) otherwise <nl> - / / / - Precondition : ` n > = 0 & & self . count > = n ` . <nl> + / / / - Parameter n : The number of elements to remove . ` n ` must be greater <nl> + / / / than or equal to zero , and must be less than or equal to the number of <nl> + / / / elements in the collection . <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the length <nl> + / / / of the collection . <nl> public mutating func removeLast ( _ n : Int ) { <nl> if n = = 0 { return } <nl> _precondition ( n > = 0 , " number of elements to remove should be non - negative " ) <nl> extension BidirectionalCollection where SubSequence = = Self { <nl> } <nl> <nl> extension BidirectionalCollection { <nl> - / / / Returns a subsequence containing all but the last ` n ` elements . <nl> + / / / Returns a subsequence containing all but the specified number of final <nl> + / / / elements . <nl> + / / / <nl> + / / / If the number of elements to drop exceeds the number of elements in the <nl> + / / / collection , the result is an empty subsequence . <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` <nl> - / / / - Complexity : O ( ` n ` ) <nl> + / / / let numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> + / / / print ( numbers . dropLast ( 2 ) ) <nl> + / / / / / Prints " [ 1 , 2 , 3 ] " <nl> + / / / print ( numbers . dropLast ( 10 ) ) <nl> + / / / / / Prints " [ ] " <nl> + / / / <nl> + / / / - Parameter n : The number of elements to drop off the end of the <nl> + / / / collection . ` n ` must be greater than or equal to zero . <nl> + / / / - Returns : A subsequence that leaves off ` n ` elements from the end . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the number of elements to drop . <nl> @ warn_unused_result <nl> public func dropLast ( _ n : Int ) - > SubSequence { <nl> _precondition ( <nl> extension BidirectionalCollection { <nl> return self [ startIndex . . < end ] <nl> } <nl> <nl> - / / / Returns a slice , up to ` maxLength ` in length , containing the <nl> - / / / final elements of ` self ` . <nl> + / / / Returns a subsequence , up to the given maximum length , containing the <nl> + / / / final elements of the collection . <nl> + / / / <nl> + / / / If the maximum length exceeds the number of elements in the collection , <nl> + / / / the result contains the entire collection . <nl> + / / / <nl> + / / / let numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> + / / / print ( numbers . suffix ( 2 ) ) <nl> + / / / / / Prints " [ 4 , 5 ] " <nl> + / / / print ( numbers . suffix ( 10 ) ) <nl> + / / / / / Prints " [ 1 , 2 , 3 , 4 , 5 ] " <nl> / / / <nl> - / / / If ` maxLength ` exceeds ` s . count ` , the result contains all <nl> - / / / the elements of ` self ` . <nl> + / / / - Parameter maxLength : The maximum number of elements to return . <nl> + / / / ` maxLength ` must be greater than or equal to zero . <nl> + / / / - Returns : A subsequence terminating at the end of the collection with at <nl> + / / / most ` maxLength ` elements . <nl> / / / <nl> - / / / - Precondition : ` maxLength > = 0 ` <nl> - / / / - Complexity : O ( ` maxLength ` ) <nl> + / / / - Complexity : O ( * n * ) , where * n * is equal to ` maxLength ` . <nl> @ warn_unused_result <nl> public func suffix ( _ maxLength : Int ) - > SubSequence { <nl> _precondition ( <nl> mmm a / stdlib / public / core / Bool . swift <nl> ppp b / stdlib / public / core / Bool . swift <nl> extension Bool : Equatable , Hashable { <nl> <nl> / / / Performs a logical NOT operation on a Boolean value . <nl> / / / <nl> - / / / The ` ! ` ( logical NOT ) operator inverts a Boolean value . If the value is <nl> + / / / The logical NOT operator ( ` ! ` ) inverts a Boolean value . If the value is <nl> / / / ` true ` , the result of the operation is ` false ` ; if the value is ` false ` , <nl> / / / the result is ` true ` . <nl> / / / <nl> mmm a / stdlib / public / core / Boolean . swift <nl> ppp b / stdlib / public / core / Boolean . swift <nl> <nl> <nl> / / / Performs a logical NOT operation on a Boolean value . <nl> / / / <nl> - / / / The ` ! ` ( logical NOT ) operator inverts a Boolean value . If the value is <nl> + / / / The logical NOT operator ( ` ! ` ) inverts a Boolean value . If the value is <nl> / / / ` true ` , the result of the operation is ` false ` ; if the value is ` false ` , <nl> / / / the result is ` true ` . For example : <nl> / / / <nl> public prefix func ! < T : Boolean > ( a : T ) - > Bool { <nl> <nl> / / / Performs a logical AND operation on two Boolean values . <nl> / / / <nl> - / / / The ` & & ` ( logical AND ) operator combines two Boolean values and returns <nl> + / / / The logical AND operator ( ` & & ` ) combines two Boolean values and returns <nl> / / / ` true ` if both of the values are ` true ` . If either of the values is <nl> / / / ` false ` , the operator returns ` false ` . <nl> / / / <nl> public func & & < T : Boolean , U : Boolean > ( <nl> <nl> / / / Performs a logical OR operation on two Boolean values . <nl> / / / <nl> - / / / The ` | | ` ( logical OR ) operator combines two Boolean values and returns <nl> + / / / The logical OR operator ( ` | | ` ) combines two Boolean values and returns <nl> / / / ` true ` if at least one of the values is ` true ` . If both values are <nl> / / / ` false ` , the operator returns ` false ` . <nl> / / / <nl> public func | | < T : Boolean , U : Boolean > ( <nl> <nl> / / / Performs a logical AND operation on two Boolean values . <nl> / / / <nl> - / / / The ` & & ` ( logical AND ) operator combines two Boolean values and returns <nl> + / / / The logical AND operator ( ` & & ` ) combines two Boolean values and returns <nl> / / / ` true ` if both of the values are ` true ` . If either of the values is <nl> / / / ` false ` , the operator returns ` false ` . <nl> / / / <nl> public func & & < T : Boolean > ( <nl> <nl> / / / Performs a logical OR operation on two Boolean values . <nl> / / / <nl> - / / / The ` | | ` ( logical OR ) operator combines two Boolean values and returns <nl> + / / / The logical OR operator ( ` | | ` ) combines two Boolean values and returns <nl> / / / ` true ` if at least one of the values is ` true ` . If both values are <nl> / / / ` false ` , the operator returns ` false ` . <nl> / / / <nl> mmm a / stdlib / public / core / ClosedRange . swift <nl> ppp b / stdlib / public / core / ClosedRange . swift <nl> public struct ClosedRangeIndex < <nl> / / CountableClosedRange is not interchangeable with CountableRange in all <nl> / / contexts . <nl> > : Comparable { <nl> - / / / Creates the past - the - end position . <nl> + / / / Creates the " past the end " position . <nl> internal init ( ) { _value = . pastEnd } <nl> <nl> / / / Creates a position ` p ` for which ` r [ p ] = = x ` . <nl> public struct ClosedRangeIterator < <nl> internal let _upperBound : Bound <nl> } <nl> <nl> - / / / A closed range that forms a collection of consecutive ` Strideable ` values . <nl> + / / / A closed range that forms a collection of consecutive values . <nl> / / / <nl> - / / / A ` CountableClosedRange ` contains both its ` lowerBound ` and its <nl> - / / / ` upperBound ` . A ` CountableClosedRange ` with one element has <nl> - / / / ` lowerBound = = upperBound ` . ` CountableClosedRange ` instances are never <nl> - / / / empty . <nl> + / / / You create a ` CountableClosedRange ` instance by using the closed range <nl> + / / / operator ( ` . . . ` ) . <nl> + / / / <nl> + / / / let throughFive = 0 . . . 5 <nl> + / / / <nl> + / / / A ` CountableClosedRange ` instance contains both its lower bound and its <nl> + / / / upper bound . <nl> + / / / <nl> + / / / print ( throughFive . contains ( 3 ) ) / / Prints " true " <nl> + / / / print ( throughFive . contains ( 10 ) ) / / Prints " false " <nl> + / / / print ( throughFive . contains ( 5 ) ) / / Prints " true " <nl> + / / / <nl> + / / / Because a closed range includes its upper bound , a closed range whose lower <nl> + / / / bound is equal to the upper bound contains one element . Therefore , a <nl> + / / / ` CountableClosedRange ` instance cannot represent an empty range . <nl> + / / / <nl> + / / / let zeroInclusive = 0 . . . 0 <nl> + / / / print ( zeroInclusive . isEmpty ) <nl> + / / / / / Prints " false " <nl> + / / / print ( zeroInclusive . count ) <nl> + / / / / / Prints " 1 " <nl> + / / / <nl> + / / / You can use a ` for ` - ` in ` loop or any sequence or collection method with a <nl> + / / / countable range . The elements of the range are the consecutive values from <nl> + / / / its lower bound up to , and including , its upper bound . <nl> + / / / <nl> + / / / for n in throughFive . suffix ( 3 ) { <nl> + / / / print ( n ) <nl> + / / / } <nl> + / / / / / Prints " 3 " <nl> + / / / / / Prints " 4 " <nl> + / / / / / Prints " 5 " <nl> + / / / <nl> + / / / You can create a countable range over any type that conforms to the <nl> + / / / ` Strideable ` protocol and uses an integer as its associated ` Stride ` type . <nl> + / / / By default , Swift ' s integer and pointer types are usable as the bounds of <nl> + / / / a countable range . <nl> + / / / <nl> + / / / Because floating - point types such as ` Float ` and ` Double ` are their own <nl> + / / / ` Stride ` types , they cannot be used as the bounds of a countable range . If <nl> + / / / you need to test whether values are contained within a closed interval <nl> + / / / bound by floating - point values , see the ` ClosedRange ` type . If you need to <nl> + / / / iterate over consecutive floating - point values , see the <nl> + / / / ` stride ( from : through : by : ) ` function . <nl> / / / <nl> / / / - SeeAlso : ` CountableRange ` , ` ClosedRange ` , ` Range ` <nl> public struct CountableClosedRange < <nl> public struct CountableClosedRange < <nl> > : RandomAccessCollection { <nl> <nl> / / / The range ' s lower bound . <nl> - / / / <nl> - / / / Identical to ` upperBound ` in an empty range . <nl> public let lowerBound : Bound <nl> <nl> / / / The range ' s upper bound . <nl> public struct CountableClosedRange < <nl> / / / more applications of ` index ( after : ) ` . <nl> public let upperBound : Bound <nl> <nl> + / / / The element type of the range ; the same type as the range ' s bounds . <nl> public typealias Element = Bound <nl> <nl> / / / A type that represents a position in the range . <nl> public struct CountableClosedRange < <nl> return ClosedRangeIterator ( _range : self ) <nl> } <nl> <nl> + / / / The position of the first element in the range . <nl> public var startIndex : ClosedRangeIndex < Bound > { <nl> return ClosedRangeIndex ( lowerBound ) <nl> } <nl> <nl> + / / / The range ' s " past the end " position , or one greater than the last valid <nl> + / / / subscript argument . <nl> public var endIndex : ClosedRangeIndex < Bound > { <nl> return ClosedRangeIndex ( ) <nl> } <nl> <nl> - / / / Returns the position immediately after ` i ` . <nl> @ warn_unused_result <nl> public func index ( after i : Index ) - > Index { <nl> / / FIXME : swift - 3 - indexing - model : range checks and tests . <nl> return i . _successor ( upperBound : upperBound ) <nl> } <nl> <nl> - / / / Returns the position immediately preceding ` i ` . <nl> @ warn_unused_result <nl> public func index ( before i : Index ) - > Index { <nl> / / FIXME : swift - 3 - indexing - model : range checks and tests . <nl> public struct CountableClosedRange < <nl> / / FIXME : swift - 3 - indexing - model : implement O ( 1 ) ` index ( _ : offsetBy : ) ` <nl> / / and ` distance ( from : to : ) ` , and write tests for them . <nl> <nl> - / / / Access the element at ` position ` . <nl> + / / / Accesses the element at specified position . <nl> / / / <nl> - / / / - Precondition : ` position ` is a valid position in ` self ` and <nl> - / / / ` position ! = upperBound ` . <nl> + / / / You can subscript a collection with any valid index other than the <nl> + / / / collection ' s end index . The end index refers to the position one past <nl> + / / / the last element of a collection , so it doesn ' t correspond with an <nl> + / / / element . <nl> + / / / <nl> + / / / - Parameter position : The position of the element to access . ` position ` <nl> + / / / must be a valid index of the range , and must not equal the range ' s end <nl> + / / / index . <nl> public subscript ( position : ClosedRangeIndex < Bound > ) - > Bound { <nl> / / FIXME : swift - 3 - indexing - model : range checks and tests . <nl> return position . _dereferenced <nl> public struct CountableClosedRange < <nl> <nl> / / / Creates an instance with the given bounds . <nl> / / / <nl> - / / / - Note : as this initializer does not check its precondition , it <nl> - / / / should be used as an optimization only , when one is absolutely <nl> - / / / certain that ` lower < = upper ` . In general , the ` . . . ` <nl> - / / / operator is to be preferred for forming closed ranges . <nl> - / / / - Precondition : ` lower < = upper ` <nl> + / / / Because this initializer does not perform any checks , it should be used <nl> + / / / as an optimization only when you are absolutely certain that ` lower ` is <nl> + / / / less than or equal to ` upper ` . Using the closed range operator ( ` . . . ` ) <nl> + / / / to form ` CountableClosedRange ` instances is preferred . <nl> + / / / <nl> + / / / - Parameter bounds : A tuple of the lower and upper bounds of the range . <nl> public init ( uncheckedBounds bounds : ( lower : Bound , upper : Bound ) ) { <nl> self . lowerBound = bounds . lower <nl> self . upperBound = bounds . upper <nl> public struct CountableClosedRange < <nl> return element > = self . lowerBound & & element < = self . upperBound <nl> } <nl> <nl> - / / / Returns ` true ` iff ` self . contains ( x ) ` is ` false ` for all values of ` x ` . <nl> + / / / A Boolean value indicating whether the range contains no elements . <nl> + / / / <nl> + / / / Because a closed range cannot represent an empty range , this property is <nl> + / / / always ` false ` . <nl> public var isEmpty : Bool { <nl> return false <nl> } <nl> } <nl> <nl> - / / / An interval over a ` Comparable ` type , from a lower bound up to and <nl> - / / / including an upper bound . Cannot represent an empty interval . <nl> + / / / An interval over a comparable type , from a lower bound up to , and <nl> + / / / including , an upper bound . <nl> / / / <nl> - / / / Use a ` ClosedRange ` to quickly check if a ` Comparable ` value is contained <nl> - / / / in a particular range of values . For example : <nl> + / / / You create instances of ` ClosedRange ` by using the closed range operator <nl> + / / / ( ` . . . ` ) . <nl> / / / <nl> - / / / let lowercase : ClosedRange = " a " . . . " z " <nl> - / / / lowercase . contains ( " c " ) / / true <nl> - / / / lowercase . contains ( " 5 " ) / / false <nl> - / / / lowercase . contains ( " z " ) / / true <nl> + / / / let lowercase = " a " . . . " z " <nl> + / / / <nl> + / / / You can use a ` ClosedRange ` instance to quickly check if a value is <nl> + / / / contained in a particular range of values . For example : <nl> + / / / <nl> + / / / print ( lowercase . contains ( " c " ) ) / / Prints " true " <nl> + / / / print ( lowercase . contains ( " 5 " ) ) / / Prints " false " <nl> + / / / print ( lowercase . contains ( " z " ) ) / / Prints " true " <nl> + / / / <nl> + / / / Unlike ` Range ` , instances of ` ClosedRange ` cannot represent an empty <nl> + / / / interval . <nl> + / / / <nl> + / / / let lowercaseA = " a " . . . " a " <nl> + / / / print ( lowercaseA . isEmpty ) <nl> + / / / / / Prints " false " <nl> + / / / <nl> + / / / - SeeAlso : ` CountableRange ` , ` Range ` , ` CountableClosedRange ` <nl> @ _fixed_layout <nl> public struct ClosedRange < <nl> Bound : Comparable <nl> > { <nl> <nl> - / / / Creates a range with ` lowerBound = = lower ` and ` upperBound = = <nl> - / / / upper ` . <nl> + / / / Creates an instance with the given bounds . <nl> + / / / <nl> + / / / Because this initializer does not perform any checks , it should be used <nl> + / / / as an optimization only when you are absolutely certain that ` lower ` is <nl> + / / / less than or equal to ` upper ` . Using the closed range operator ( ` . . . ` ) <nl> + / / / to form ` ClosedRange ` instances is preferred . <nl> / / / <nl> - / / / - Note : as this initializer does not check its precondition , it <nl> - / / / should be used as an optimization only , when one is absolutely <nl> - / / / certain that ` lower < = upper ` . In general , the ` . . . ` <nl> - / / / operator is to be preferred for forming closed ranges . <nl> - / / / - Precondition : ` lower < = upper ` <nl> + / / / - Parameter bounds : A tuple of the lower and upper bounds of the range . <nl> @ inline ( __always ) <nl> public init ( uncheckedBounds bounds : ( lower : Bound , upper : Bound ) ) { <nl> self . lowerBound = bounds . lower <nl> public struct ClosedRange < <nl> / / / The range ' s upper bound . <nl> public let upperBound : Bound <nl> <nl> - / / / Returns ` true ` iff ` element ` is between ` lowerBound ` and ` upperBound ` or <nl> + / / / Returns a Boolean value indicating whether the given element is contained <nl> + / / / within the range . <nl> + / / / <nl> + / / / A ` ClosedRange ` instance contains both its lower and upper bound . <nl> + / / / ` element ` is contained in the range if it is between the two bounds or <nl> / / / equal to either bound . <nl> + / / / <nl> + / / / - Parameter element : The element to check for containment . <nl> + / / / - Returns : ` true ` if ` element ` is contained in the range ; otherwise , <nl> + / / / ` false ` . <nl> @ warn_unused_result <nl> public func contains ( _ element : Bound ) - > Bool { <nl> return element > = self . lowerBound & & element < = self . upperBound <nl> } <nl> <nl> - / / / Returns ` true ` iff ` self . contains ( x ) ` is ` false ` for all values of ` x ` . <nl> + / / / A Boolean value indicating whether the range contains no elements . <nl> + / / / <nl> + / / / Because a closed range cannot represent an empty range , this property is <nl> + / / / always ` false ` . <nl> public var isEmpty : Bool { <nl> return false <nl> } <nl> } <nl> <nl> - / / / Returns a closed range that contains ` minimum ` and ` maximum ` . <nl> + / / / Returns a closed range that contains both of its bounds . <nl> / / / <nl> - / / / - Precondition : ` minimum < = maximum ` . <nl> + / / / For example : <nl> + / / / <nl> + / / / let lowercase = " a " . . . " z " <nl> + / / / print ( lowercase . contains ( " z " ) ) <nl> + / / / / / Prints " true " <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - minimum : The lower bound for the range . <nl> + / / / - maximum : The upper bound for the range . <nl> @ _transparent <nl> @ warn_unused_result <nl> public func . . . < Bound : Comparable > ( minimum : Bound , maximum : Bound ) <nl> public func . . . < Bound : Comparable > ( minimum : Bound , maximum : Bound ) <nl> return ClosedRange ( uncheckedBounds : ( lower : minimum , upper : maximum ) ) <nl> } <nl> <nl> - / / / Returns a closed range that contains ` minimum ` and ` maximum ` . <nl> + / / / Returns a countable closed range that contains both of its bounds . <nl> + / / / <nl> + / / / For example : <nl> + / / / <nl> + / / / let singleDigits = 0 . . . 9 <nl> + / / / print ( singleDigits . contains ( 9 ) ) <nl> + / / / / / Prints " true " <nl> / / / <nl> - / / / - Precondition : ` minimum < = maximum ` . <nl> + / / / - Parameters : <nl> + / / / - minimum : The lower bound for the range . <nl> + / / / - maximum : The upper bound for the range . <nl> @ _transparent <nl> @ warn_unused_result <nl> public func . . . < <nl> mmm a / stdlib / public / core / Collection . swift <nl> ppp b / stdlib / public / core / Collection . swift <nl> public protocol IndexableBase { <nl> <nl> / / / Accesses the element at the specified position . <nl> / / / <nl> - / / / For example , access an element of an array through its subscript to <nl> - / / / print its value : <nl> + / / / The following example accesses an element of an array through its <nl> + / / / subscript to print its value : <nl> / / / <nl> / / / var streets = [ " Adams " , " Bryant " , " Channing " , " Douglas " , " Evarts " ] <nl> / / / print ( streets [ 1 ] ) <nl> / / / / / Prints " Bryant " <nl> / / / <nl> / / / You can subscript a collection with any valid index other than the <nl> - / / / collection ' s end index . The end index refers to the position one <nl> - / / / past the last element of a collection , so it doesn ' t correspond with an <nl> + / / / collection ' s end index . The end index refers to the position one past <nl> + / / / the last element of a collection , so it doesn ' t correspond with an <nl> / / / element . <nl> / / / <nl> / / / - Parameter position : The position of the element to access . ` position ` <nl> public protocol IndexableBase { <nl> subscript ( position : Index ) - > _Element { get } <nl> <nl> / / WORKAROUND : rdar : / / 25214066 <nl> - / / / A ` Sequence ` that can represent a contiguous subrange of ` self ` ' s <nl> + / / / A sequence that can represent a contiguous subrange of the collection ' s <nl> / / / elements . <nl> associatedtype SubSequence <nl> <nl> - / / / Accesses the subsequence bounded by ` bounds ` . <nl> + / / / Accesses the subsequence bounded by the given range . <nl> / / / <nl> - / / / - Complexity : O ( 1 ) <nl> - / / / <nl> - / / / - Precondition : ` ( startIndex . . . endIndex ) . contains ( bounds . lowerBound ) ` <nl> - / / / and ` ( startIndex . . . endIndex ) . contains ( bounds . upperBound ) ` <nl> + / / / - Parameter bounds : A range of the collection ' s indices . The upper and <nl> + / / / lower bounds of the ` bounds ` range must be valid indices of the <nl> + / / / collection . <nl> subscript ( bounds : Range < Index > ) - > SubSequence { get } <nl> <nl> / / / Performs a range check in O ( 1 ) , or a no - op when a range check is not <nl> public protocol IndexableBase { <nl> / / / - Complexity : O ( 1 ) . <nl> func _failEarlyRangeCheck ( _ range : Range < Index > , bounds : Range < Index > ) <nl> <nl> - / / / Returns the position immediately after ` i ` . <nl> + / / / Returns the position immediately after the given index . <nl> / / / <nl> - / / / - Precondition : ` ( startIndex . . < endIndex ) . contains ( i ) ` <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be less than <nl> + / / / ` endIndex ` . <nl> + / / / - Returns : The index value immediately after ` i ` . <nl> @ warn_unused_result <nl> func index ( after i : Index ) - > Index <nl> <nl> - / / / Replaces ` i ` with its successor . <nl> + / / / Replaces the given index with its successor . <nl> + / / / <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be less than <nl> + / / / ` endIndex ` . <nl> func formIndex ( after i : inout Index ) <nl> } <nl> <nl> public protocol Indexable : IndexableBase { <nl> - / / / A type that can represent the number of steps between pairs of <nl> - / / / ` Index ` values where one value is reachable from the other . <nl> - / / / <nl> - / / / Reachability is defined by the ability to produce one value from <nl> - / / / the other via zero or more applications of ` index ( after : i ) ` . <nl> + / / / A type that can represent the number of steps between a pair of <nl> + / / / indices . <nl> associatedtype IndexDistance : SignedInteger = Int <nl> <nl> - / / / Returns the result of advancing ` i ` by ` n ` positions . <nl> + / / / Returns an index that is the specified distance from the given index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from a <nl> + / / / string ' s starting index and then prints the character at that position . <nl> + / / / <nl> + / / / let s = " Swift " <nl> + / / / let i = s . index ( s . startIndex , offsetBy : 4 ) <nl> + / / / print ( s [ i ] ) <nl> + / / / / / Prints " t " <nl> / / / <nl> - / / / - Returns : <nl> - / / / - If ` n > 0 ` , the ` n ` th successor of ` i ` . <nl> - / / / - If ` n < 0 ` , the ` n ` th predecessor of ` i ` . <nl> - / / / - Otherwise , ` i ` unmodified . <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` . If ` n ` is positive , <nl> + / / / this is the same value as the result of ` n ` calls to ` index ( after : ) ` . <nl> + / / / If ` n ` is negative , this is the same value as the result of ` - n ` calls <nl> + / / / to ` index ( before : ) ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : limitedBy : ) ` , ` formIndex ( _ : offsetBy : ) ` <nl> / / / - Precondition : <nl> / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> - / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` abs ( n ) ` ) otherwise . <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> @ warn_unused_result <nl> func index ( _ i : Index , offsetBy n : IndexDistance ) - > Index <nl> <nl> - / / / Returns the result of advancing ` i ` by ` n ` positions , or ` nil ` <nl> - / / / if doing so would pass ` limit ` . <nl> + / / / Returns an index that is the specified distance from the given index , <nl> + / / / unless that distance is beyond a given limiting index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from a <nl> + / / / string ' s starting index and then prints the character at that position . The <nl> + / / / operation doesn ' t require going beyond the limiting ` s . endIndex ` value , <nl> + / / / so it succeeds . <nl> + / / / <nl> + / / / let s = " Swift " <nl> + / / / if let i = s . index ( s . startIndex , offsetBy : 4 , limitedBy : s . endIndex ) { <nl> + / / / print ( s [ i ] ) <nl> + / / / } <nl> + / / / / / Prints " t " <nl> + / / / <nl> + / / / The next example attempts to retrieve an index six positions from <nl> + / / / ` s . startIndex ` but fails , because that distance is beyond the index <nl> + / / / passed as ` limit ` . <nl> / / / <nl> - / / / - Returns : <nl> - / / / - ` nil ` if ` ( limit > i ) = = ( n > 0 ) & & abs ( distance ( i , limit ) ) < abs ( n ) ` <nl> - / / / - Otherwise , ` index ( i , offsetBy : n ) ` <nl> + / / / let j = s . index ( s . startIndex , offsetBy : 6 , limitedBy : s . endIndex ) <nl> + / / / print ( j ) <nl> + / / / / / Prints " nil " <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` abs ( n ) ` ) otherwise . <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - limit : A valid index of the collection to use as a limit . If ` n > 0 ` , <nl> + / / / ` limit ` has no effect if it is less than ` i ` . Likewise , if ` n < 0 ` , <nl> + / / / ` limit ` has no effect if it is greater than ` i ` . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` , unless that index <nl> + / / / would be beyond ` limit ` in the direction of movement . In that case , <nl> + / / / the method returns ` nil ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Precondition : <nl> + / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> + / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> @ warn_unused_result <nl> func index ( <nl> _ i : Index , offsetBy n : IndexDistance , limitedBy limit : Index <nl> ) - > Index ? <nl> <nl> - / / / Advances ` i ` by ` n ` positions . <nl> + / / / Offsets the given index by the specified distance . <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> / / / - Precondition : <nl> / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> - / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` abs ( n ) ` ) otherwise . <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> func formIndex ( _ i : inout Index , offsetBy n : IndexDistance ) <nl> <nl> - / / / Advances ` i ` by ` n ` positions , or until it equals ` limit ` . <nl> + / / / Offsets the given index by the specified distance , or so that it equals <nl> + / / / the given limiting index . <nl> / / / <nl> - / / / - Returns ` true ` if index has been advanced by exactly ` n ` steps without <nl> - / / / passing the ` limit ` , and ` false ` otherwise . <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . Make <nl> + / / / sure the value passed as ` n ` does not result in such an operation . <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> - / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` abs ( n ) ` ) otherwise . <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - Returns : ` true ` if ` i ` has been offset by exactly ` n ` steps without <nl> + / / / going beyond ` limit ` ; otherwise , ` false ` . When the return value is <nl> + / / / ` false ` , the value of ` i ` is equal to ` limit ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> func formIndex ( <nl> _ i : inout Index , offsetBy n : IndexDistance , limitedBy limit : Index <nl> ) - > Bool <nl> <nl> - / / / Returns the distance between ` start ` and ` end ` . <nl> + / / / Returns the distance between two indices . <nl> + / / / <nl> + / / / Unless the collection conforms to the ` BidirectionalCollection ` protocol , <nl> + / / / ` start ` must be less than or equal to ` end ` . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - start : A valid index of the collection . <nl> + / / / - end : Another valid index of the collection . If ` end ` is equal to <nl> + / / / ` start ` , the result is zero . <nl> + / / / - Returns : The distance between ` start ` and ` end ` . The result can be <nl> + / / / negative only if the collection conforms to the <nl> + / / / ` BidirectionalCollection ` protocol . <nl> / / / <nl> - / / / - Precondition : ` start < = end ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` n ` ) otherwise , where ` n ` is the method ' s result . <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the <nl> + / / / resulting distance . <nl> @ warn_unused_result <nl> func distance ( from start : Index , to end : Index ) - > IndexDistance <nl> } <nl> public protocol Indexable : IndexableBase { <nl> / / / default : fatalError ( " Index out of bounds . " ) <nl> / / / } <nl> / / / } <nl> + / / / <nl> + / / / func index ( after i : Int ) - > Int { <nl> + / / / precondition ( i < endIndex , " Can ' t advance beyond endIndex " ) <nl> + / / / return i + 1 <nl> + / / / } <nl> / / / } <nl> / / / <nl> / / / The ` CollectionOfTwo ` type uses the default iterator type , <nl> public struct IndexingIterator < <nl> / / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / / <nl> / / / You can access an element of a collection through its subscript with any <nl> - / / / valid index except the collection ' s ` endIndex ` property , a " past - the - end " <nl> + / / / valid index except the collection ' s ` endIndex ` property , a " past the end " <nl> / / / index that does not correspond with any element of the collection . <nl> / / / <nl> / / / Here ' s an example of accessing the first character in a string through its <nl> public struct IndexingIterator < <nl> / / / Conforming to the Collection Protocol <nl> / / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> / / / <nl> - / / / If you create a custom type that can provide repeated access to its <nl> - / / / elements , conformance to the ` Collection ` protocol gives your <nl> - / / / custom type a more useful and more efficient interface for sequence and <nl> - / / / collection operations . To add conformance to your type , declare <nl> - / / / ` startIndex ` and ` endIndex ` properties and a subscript that provides at <nl> - / / / least read - only access to your type ' s elements . <nl> + / / / If you create a custom sequence that can provide repeated access to its <nl> + / / / elements , conformance to the ` Collection ` protocol gives your custom type <nl> + / / / a more useful and more efficient interface for sequence and collection <nl> + / / / operations . To add ` Collection ` conformance to your type , declare <nl> + / / / ` startIndex ` and ` endIndex ` properties , a subscript that provides at least <nl> + / / / read - only access to your type ' s elements , and the ` index ( after : ) ` method <nl> + / / / for advancing your collection ' s indices . <nl> / / / <nl> / / / Expected Performance <nl> / / / = = = = = = = = = = = = = = = = = = = = <nl> public struct IndexingIterator < <nl> / / / count the number of contained elements , accessing its ` count ` property is <nl> / / / an O ( N ) operation . <nl> public protocol Collection : Indexable , Sequence { <nl> - / / / A type that can represent the number of steps between pairs of <nl> - / / / ` Index ` values where one value is reachable from the other . <nl> - / / / <nl> - / / / Reachability is defined by the ability to produce one value from <nl> - / / / the other via zero or more applications of ` index ( after : ) ` . <nl> + / / / A type that can represent the number of steps between a pair of <nl> + / / / indices . <nl> associatedtype IndexDistance : SignedInteger = Int <nl> <nl> - / / / A type that provides the sequence ' s iteration interface and <nl> + / / / A type that provides the collection ' s iteration interface and <nl> / / / encapsulates its iteration state . <nl> / / / <nl> - / / / By default , a ` Collection ` satisfies ` Sequence ` by <nl> + / / / By default , a collection conforms to the ` Sequence ` protocol by <nl> / / / supplying a ` IndexingIterator ` as its associated ` Iterator ` <nl> / / / type . <nl> associatedtype Iterator : IteratorProtocol = IndexingIterator < Self > <nl> public protocol Collection : Indexable , Sequence { <nl> <nl> / / / Accesses the element at the specified position . <nl> / / / <nl> - / / / For example , access an element of an array through its subscript to <nl> - / / / print its value : <nl> + / / / The following example accesses an element of an array through its <nl> + / / / subscript to print its value : <nl> / / / <nl> / / / var streets = [ " Adams " , " Bryant " , " Channing " , " Douglas " , " Evarts " ] <nl> / / / print ( streets [ 1 ] ) <nl> / / / / / Prints " Bryant " <nl> / / / <nl> / / / You can subscript a collection with any valid index other than the <nl> - / / / collection ' s end index . The end index refers to the position one <nl> - / / / past the last element of a collection , so it doesn ' t correspond with an <nl> + / / / collection ' s end index . The end index refers to the position one past <nl> + / / / the last element of a collection , so it doesn ' t correspond with an <nl> / / / element . <nl> / / / <nl> / / / - Parameter position : The position of the element to access . ` position ` <nl> public protocol Collection : Indexable , Sequence { <nl> / / / Accesses a contiguous subrange of the collection ' s elements . <nl> / / / <nl> / / / The accessed slice uses the same indices for the same elements as the <nl> - / / / original collection . Always use the slice ' s ` startIndex ` property <nl> + / / / original collection uses . Always use the slice ' s ` startIndex ` property <nl> / / / instead of assuming that its indices start at a particular value . <nl> / / / <nl> / / / This example demonstrates getting a slice of an array of strings , finding <nl> public protocol Collection : Indexable , Sequence { <nl> / / / the range must be valid indices of the collection . <nl> subscript ( bounds : Range < Index > ) - > SubSequence { get } <nl> <nl> - / / / A collection type whose elements are the indices of ` self ` that <nl> - / / / are valid for subscripting , in ascending order . <nl> + / / / A type that can represent the indices that are valid for subscripting the <nl> + / / / collection , in ascending order . <nl> associatedtype Indices : IndexableBase , Sequence = DefaultIndices < Self > <nl> <nl> / / FIXME ( compiler limitation ) : <nl> public protocol Collection : Indexable , Sequence { <nl> / / Indices . SubSequence = = Indices <nl> / / = DefaultIndices < Self > <nl> <nl> - / / / The indices that are valid for subscripting ` self ` , in ascending order . <nl> - / / / <nl> - / / / - Note : ` indices ` can hold a strong reference to the collection itself , <nl> - / / / causing the collection to be non - uniquely referenced . If you need to <nl> - / / / mutate the collection while iterating over its indices , use the <nl> - / / / ` index ( after : ) ` method starting with ` startIndex ` to produce indices <nl> - / / / instead . <nl> - / / / <nl> - / / / ` ` ` <nl> - / / / var c = [ 10 , 20 , 30 , 40 , 50 ] <nl> - / / / var i = c . startIndex <nl> - / / / while i ! = c . endIndex { <nl> - / / / c [ i ] / = 5 <nl> - / / / i = c . index ( after : i ) <nl> - / / / } <nl> - / / / / / c = = [ 2 , 4 , 6 , 8 , 10 ] <nl> - / / / ` ` ` <nl> + / / / The indices that are valid for subscripting the collection , in ascending <nl> + / / / order . <nl> + / / / <nl> + / / / A collections ' s ` indices ` property can hold a strong reference to the <nl> + / / / collection itself , causing the collection to be non - uniquely referenced . <nl> + / / / If you mutate the collection while iterating over its indices , a strong <nl> + / / / reference can cause an unexpected copy of the collection . To avoid the <nl> + / / / unexpected copy , use the ` index ( after : ) ` method starting with <nl> + / / / ` startIndex ` to produce indices instead . <nl> + / / / <nl> + / / / var c = MyFancyCollection ( [ 10 , 20 , 30 , 40 , 50 ] ) <nl> + / / / var i = c . startIndex <nl> + / / / while i ! = c . endIndex { <nl> + / / / c [ i ] / = 5 <nl> + / / / i = c . index ( after : i ) <nl> + / / / } <nl> + / / / / / c = = MyFancyCollection ( [ 2 , 4 , 6 , 8 , 10 ] ) <nl> var indices : Indices { get } <nl> <nl> / / / Returns a subsequence from the start of the collection up to , but not <nl> public protocol Collection : Indexable , Sequence { <nl> / / / print ( numbers . prefix ( upTo : numbers . startIndex ) ) <nl> / / / / / Prints " [ ] " <nl> / / / <nl> - / / / - Parameter end : The " past - the - end " index of the resulting subsequence . <nl> + / / / - Parameter end : The " past the end " index of the resulting subsequence . <nl> / / / ` end ` must be a valid index of the collection . <nl> / / / - Returns : A subsequence up to , but not including , the ` end ` position . <nl> / / / <nl> public protocol Collection : Indexable , Sequence { <nl> / / / / / Prints " 10 " <nl> var first : Iterator . Element ? { get } <nl> <nl> - / / / Returns the result of advancing ` i ` by ` n ` positions . <nl> + / / / Returns an index that is the specified distance from the given index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from a <nl> + / / / string ' s starting index and then prints the character at that position . <nl> / / / <nl> - / / / - Returns : <nl> - / / / - If ` n > 0 ` , the ` n ` th successor of ` i ` . <nl> - / / / - If ` n < 0 ` , the ` n ` th predecessor of ` i ` . <nl> - / / / - Otherwise , ` i ` unmodified . <nl> + / / / let s = " Swift " <nl> + / / / let i = s . index ( s . startIndex , offsetBy : 4 ) <nl> + / / / print ( s [ i ] ) <nl> + / / / / / Prints " t " <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . Make <nl> + / / / sure the value passed as ` n ` does not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` . If ` n ` is positive , <nl> + / / / this is the same value as the result of ` n ` calls to ` index ( after : ) ` . <nl> + / / / If ` n ` is negative , this is the same value as the result of ` - n ` calls <nl> + / / / to ` index ( before : ) ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : limitedBy : ) ` , ` formIndex ( _ : offsetBy : ) ` <nl> / / / - Precondition : <nl> / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> - / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` abs ( n ) ` ) otherwise . <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> @ warn_unused_result <nl> func index ( _ i : Index , offsetBy n : IndexDistance ) - > Index <nl> <nl> - / / FIXME : swift - 3 - indexing - model : Should this mention preconditions on ` n ` ? <nl> - / / / Returns the result of advancing ` i ` by ` n ` positions , or ` nil ` <nl> - / / / if doing so would pass ` limit ` . <nl> + / / / Returns an index that is the specified distance from the given index , <nl> + / / / unless that distance is beyond a given limiting index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from a <nl> + / / / string ' s starting index and then prints the character at that position . <nl> + / / / The operation doesn ' t require going beyond the limiting ` s . endIndex ` <nl> + / / / value , so it succeeds . <nl> / / / <nl> - / / / - Returns : <nl> - / / / - ` nil ` if ` ( limit > i ) = = ( n > 0 ) & & abs ( distance ( i , limit ) ) < abs ( n ) ` <nl> - / / / - Otherwise , ` index ( i , offsetBy : n ) ` <nl> + / / / let s = " Swift " <nl> + / / / if let i = s . index ( s . startIndex , offsetBy : 4 , limitedBy : s . endIndex ) { <nl> + / / / print ( s [ i ] ) <nl> + / / / } <nl> + / / / / / Prints " t " <nl> / / / <nl> - / / / - Precondition : ` n > = 0 ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> + / / / The next example attempts to retrieve an index six positions from <nl> + / / / ` s . startIndex ` but fails , because that distance is beyond the index <nl> + / / / passed as ` limit ` . <nl> / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` abs ( n ) ` ) otherwise . <nl> + / / / let j = s . index ( s . startIndex , offsetBy : 6 , limitedBy : s . endIndex ) <nl> + / / / print ( j ) <nl> + / / / / / Prints " nil " <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - limit : A valid index of the collection to use as a limit . If ` n > 0 ` , <nl> + / / / ` limit ` has no effect if it is less than ` i ` . Likewise , if ` n < 0 ` , <nl> + / / / ` limit ` has no effect if it is greater than ` i ` . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` , unless that index <nl> + / / / would be beyond ` limit ` in the direction of movement . In that case , <nl> + / / / the method returns ` nil ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Precondition : <nl> + / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> + / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> @ warn_unused_result <nl> func index ( <nl> _ i : Index , offsetBy n : IndexDistance , limitedBy limit : Index <nl> ) - > Index ? <nl> <nl> - / / / Returns the distance between ` start ` and ` end ` . <nl> + / / / Returns the distance between two indices . <nl> + / / / <nl> + / / / Unless the collection conforms to the ` BidirectionalCollection ` protocol , <nl> + / / / ` start ` must be less than or equal to ` end ` . <nl> / / / <nl> - / / / - Precondition : ` start < = end ` unless ` Self ` conforms to <nl> - / / / ` BidirectionalCollection ` . <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) if ` Self ` conforms to ` RandomAccessCollection ` . <nl> - / / / - O ( ` n ` ) otherwise , where ` n ` is the method ' s result . <nl> + / / / - Parameters : <nl> + / / / - start : A valid index of the collection . <nl> + / / / - end : Another valid index of the collection . If ` end ` is equal to <nl> + / / / ` start ` , the result is zero . <nl> + / / / - Returns : The distance between ` start ` and ` end ` . The result can be <nl> + / / / negative only if the collection conforms to the ` BidirectionalCollection ` <nl> + / / / protocol . <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the <nl> + / / / resulting distance . <nl> @ warn_unused_result <nl> func distance ( from start : Index , to end : Index ) - > IndexDistance <nl> } <nl> <nl> / / / Default implementation for forward collections . <nl> extension Indexable { <nl> + / / / Replaces the given index with its successor . <nl> + / / / <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be less than <nl> + / / / ` endIndex ` . <nl> @ inline ( __always ) <nl> public func formIndex ( after i : inout Index ) { <nl> / / FIXME : swift - 3 - indexing - model : tests . <nl> extension Indexable { <nl> " out of bounds : range begins after bounds . upperBound " ) <nl> } <nl> <nl> + / / / Returns an index that is the specified distance from the given index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from a <nl> + / / / string ' s starting index and then prints the character at that position . <nl> + / / / <nl> + / / / let s = " Swift " <nl> + / / / let i = s . index ( s . startIndex , offsetBy : 4 ) <nl> + / / / print ( s [ i ] ) <nl> + / / / / / Prints " t " <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` . If ` n ` is positive , <nl> + / / / this is the same value as the result of ` n ` calls to ` index ( after : ) ` . <nl> + / / / If ` n ` is negative , this is the same value as the result of ` - n ` calls <nl> + / / / to ` index ( before : ) ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : limitedBy : ) ` , ` formIndex ( _ : offsetBy : ) ` <nl> + / / / - Precondition : <nl> + / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> + / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> @ warn_unused_result <nl> public func index ( _ i : Index , offsetBy n : IndexDistance ) - > Index { <nl> / / FIXME : swift - 3 - indexing - model : tests . <nl> return self . _advanceForward ( i , by : n ) <nl> } <nl> <nl> + / / / Returns an index that is the specified distance from the given index , <nl> + / / / unless that distance is beyond a given limiting index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from a <nl> + / / / string ' s starting index and then prints the character at that position . <nl> + / / / The operation doesn ' t require going beyond the limiting ` s . endIndex ` <nl> + / / / value , so it succeeds . <nl> + / / / <nl> + / / / let s = " Swift " <nl> + / / / if let i = s . index ( s . startIndex , offsetBy : 4 , limitedBy : s . endIndex ) { <nl> + / / / print ( s [ i ] ) <nl> + / / / } <nl> + / / / / / Prints " t " <nl> + / / / <nl> + / / / The next example attempts to retrieve an index six positions from <nl> + / / / ` s . startIndex ` but fails , because that distance is beyond the index <nl> + / / / passed as ` limit ` . <nl> + / / / <nl> + / / / let j = s . index ( s . startIndex , offsetBy : 6 , limitedBy : s . endIndex ) <nl> + / / / print ( j ) <nl> + / / / / / Prints " nil " <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - limit : A valid index of the collection to use as a limit . If ` n > 0 ` , <nl> + / / / ` limit ` has no effect if it is less than ` i ` . Likewise , if ` n < 0 ` , <nl> + / / / ` limit ` has no effect if it is greater than ` i ` . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` , unless that index <nl> + / / / would be beyond ` limit ` in the direction of movement . In that case , <nl> + / / / the method returns ` nil ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Precondition : <nl> + / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> + / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> @ warn_unused_result <nl> public func index ( <nl> _ i : Index , offsetBy n : IndexDistance , limitedBy limit : Index <nl> extension Indexable { <nl> return self . _advanceForward ( i , by : n , limitedBy : limit ) <nl> } <nl> <nl> + / / / Offsets the given index by the specified distance . <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Precondition : <nl> + / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> + / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> public func formIndex ( _ i : inout Index , offsetBy n : IndexDistance ) { <nl> i = index ( i , offsetBy : n ) <nl> } <nl> <nl> + / / / Offsets the given index by the specified distance , or so that it equals <nl> + / / / the given limiting index . <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . Make <nl> + / / / sure the value passed as ` n ` does not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . ` n ` must not be negative unless the <nl> + / / / collection conforms to the ` BidirectionalCollection ` protocol . <nl> + / / / - Returns : ` true ` if ` i ` has been offset by exactly ` n ` steps without <nl> + / / / going beyond ` limit ` ; otherwise , ` false ` . When the return value is <nl> + / / / ` false ` , the value of ` i ` is equal to ` limit ` . <nl> + / / / <nl> + / / / - SeeAlso : ` index ( _ : offsetBy : ) ` , ` formIndex ( _ : offsetBy : limitedBy : ) ` <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the absolute <nl> + / / / value of ` n ` . <nl> public func formIndex ( <nl> _ i : inout Index , offsetBy n : IndexDistance , limitedBy limit : Index <nl> ) - > Bool { <nl> extension Indexable { <nl> return false <nl> } <nl> <nl> + / / / Returns the distance between two indices . <nl> + / / / <nl> + / / / Unless the collection conforms to the ` BidirectionalCollection ` protocol , <nl> + / / / ` start ` must be less than or equal to ` end ` . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - start : A valid index of the collection . <nl> + / / / - end : Another valid index of the collection . If ` end ` is equal to <nl> + / / / ` start ` , the result is zero . <nl> + / / / - Returns : The distance between ` start ` and ` end ` . The result can be <nl> + / / / negative only if the collection conforms to the <nl> + / / / ` BidirectionalCollection ` protocol . <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) if the collection conforms to <nl> + / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) , where * n * is the <nl> + / / / resulting distance . <nl> @ warn_unused_result <nl> public func distance ( from start : Index , to end : Index ) - > IndexDistance { <nl> / / FIXME : swift - 3 - indexing - model : tests . <nl> extension Collection where SubSequence = = Slice < Self > { <nl> / / / Accesses a contiguous subrange of the collection ' s elements . <nl> / / / <nl> / / / The accessed slice uses the same indices for the same elements as the <nl> - / / / original collection . Always use the slice ' s ` startIndex ` property <nl> + / / / original collection uses . Always use the slice ' s ` startIndex ` property <nl> / / / instead of assuming that its indices start at a particular value . <nl> / / / <nl> / / / This example demonstrates getting a slice of an array of strings , finding <nl> extension Collection { <nl> } <nl> <nl> / / TODO : swift - 3 - indexing - model - rename the following to _customIndexOfEquatable ( element ) ? <nl> - / / / Customization point for ` Sequence . index ( of : ) ` . <nl> + / / / Customization point for ` Collection . index ( of : ) ` . <nl> / / / <nl> / / / Define this method if the collection can find an element in less than <nl> / / / O ( N ) by exploiting collection - specific knowledge . <nl> extension Collection { <nl> / / / elements . <nl> / / / <nl> / / / If the number of elements to drop exceeds the number of elements in <nl> - / / / the sequence , the result is an empty subsequence . <nl> + / / / the collection , the result is an empty subsequence . <nl> / / / <nl> / / / let numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> / / / print ( numbers . dropFirst ( 2 ) ) <nl> extension Collection { <nl> / / / / / Prints " [ ] " <nl> / / / <nl> / / / - Parameter n : The number of elements to drop from the beginning of <nl> - / / / the sequence . ` n ` must be greater than or equal to zero . <nl> + / / / the collection . ` n ` must be greater than or equal to zero . <nl> / / / - Returns : A subsequence starting after the specified number of <nl> / / / elements . <nl> / / / <nl> / / / - Complexity : O ( * n * ) , where * n * is the number of elements to drop from <nl> - / / / the beginning of the sequence . <nl> + / / / the beginning of the collection . <nl> @ warn_unused_result <nl> public func dropFirst ( _ n : Int ) - > SubSequence { <nl> _precondition ( n > = 0 , " Can ' t drop a negative number of elements from a collection " ) <nl> extension Collection { <nl> / / / Returns a subsequence containing all but the specified number of final <nl> / / / elements . <nl> / / / <nl> - / / / The sequence must be finite . If the number of elements to drop exceeds <nl> - / / / the number of elements in the sequence , the result is an empty <nl> - / / / subsequence . <nl> + / / / If the number of elements to drop exceeds the number of elements in the <nl> + / / / collection , the result is an empty subsequence . <nl> / / / <nl> / / / let numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> / / / print ( numbers . dropLast ( 2 ) ) <nl> extension Collection { <nl> / / / / / Prints " [ ] " <nl> / / / <nl> / / / - Parameter n : The number of elements to drop off the end of the <nl> - / / / sequence . ` n ` must be greater than or equal to zero . <nl> + / / / collection . ` n ` must be greater than or equal to zero . <nl> + / / / - Returns : A subsequence that leaves off the specified number of elements <nl> + / / / at the end . <nl> / / / <nl> - / / / - Complexity : O ( * n * ) , where * n * is the length of the sequence . <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> @ warn_unused_result <nl> public func dropLast ( _ n : Int ) - > SubSequence { <nl> _precondition ( <nl> extension Collection { <nl> } <nl> <nl> / / / Returns a subsequence , up to the specified maximum length , containing <nl> - / / / the initial elements of the sequence . <nl> + / / / the initial elements of the collection . <nl> / / / <nl> - / / / If the maximum length exceeds the number of elements in the sequence , <nl> - / / / the result contains all the elements in the sequence . <nl> + / / / If the maximum length exceeds the number of elements in the collection , <nl> + / / / the result contains all the elements in the collection . <nl> / / / <nl> / / / let numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> / / / print ( numbers . prefix ( 2 ) ) <nl> extension Collection { <nl> / / / <nl> / / / - Parameter maxLength : The maximum number of elements to return . <nl> / / / ` maxLength ` must be greater than or equal to zero . <nl> - / / / - Returns : A subsequence starting at the beginning of this sequence <nl> + / / / - Returns : A subsequence starting at the beginning of this collection <nl> / / / with at most ` maxLength ` elements . <nl> @ warn_unused_result <nl> public func prefix ( _ maxLength : Int ) - > SubSequence { <nl> extension Collection { <nl> } <nl> <nl> / / / Returns a subsequence , up to the given maximum length , containing the <nl> - / / / final elements of the sequence . <nl> + / / / final elements of the collection . <nl> / / / <nl> - / / / The sequence must be finite . If the maximum length exceeds the number <nl> - / / / of elements in the sequence , the result contains all the elements in <nl> - / / / the sequence . <nl> + / / / If the maximum length exceeds the number of elements in the collection , <nl> + / / / the result contains all the elements in the collection . <nl> / / / <nl> / / / let numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> / / / print ( numbers . suffix ( 2 ) ) <nl> extension Collection { <nl> / / / print ( numbers . suffix ( 10 ) ) <nl> / / / / / Prints " [ 1 , 2 , 3 , 4 , 5 ] " <nl> / / / <nl> - / / / - Parameter maxLength : The maximum number of elements to return . Must <nl> - / / / be greater than or equal to zero . <nl> - / / / - Returns : A subsequence terminating at the end of this sequence with <nl> - / / / at most ` maxLength ` elements . <nl> + / / / - Parameter maxLength : The maximum number of elements to return . The <nl> + / / / value of ` maxLength ` must be greater than or equal to zero . <nl> + / / / - Returns : A subsequence terminating at the end of the collection with at <nl> + / / / most ` maxLength ` elements . <nl> / / / <nl> - / / / - Complexity : O ( * n * ) , where * n * is the length of the sequence . <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> @ warn_unused_result <nl> public func suffix ( _ maxLength : Int ) - > SubSequence { <nl> _precondition ( <nl> extension Collection { <nl> / / / print ( numbers . prefix ( upTo : numbers . startIndex ) ) <nl> / / / / / Prints " [ ] " <nl> / / / <nl> - / / / - Parameter end : The " past - the - end " index of the resulting subsequence . <nl> + / / / - Parameter end : The " past the end " index of the resulting subsequence . <nl> / / / ` end ` must be a valid index of the collection . <nl> / / / - Returns : A subsequence up to , but not including , the ` end ` position . <nl> / / / <nl> extension Collection where SubSequence = = Self { <nl> / / / collection . <nl> / / / <nl> / / / - Parameter n : The number of elements to remove . ` n ` must be greater than <nl> - / / / or equal to zero and less than or equal to the number of elements in <nl> - / / / the collection . <nl> + / / / or equal to zero , and must be less than or equal to the number of <nl> + / / / elements in the collection . <nl> / / / <nl> / / / - Complexity : O ( 1 ) if the collection conforms to <nl> / / / ` RandomAccessCollection ` ; otherwise , O ( * n * ) . <nl> mmm a / stdlib / public / core / CompilerProtocols . swift <nl> ppp b / stdlib / public / core / CompilerProtocols . swift <nl> public protocol StringLiteralConvertible <nl> / / / } <nl> / / / } <nl> public protocol ArrayLiteralConvertible { <nl> + / / / The type of the elements of an array literal . <nl> associatedtype Element <nl> / / / Creates an instance initialized with the given elements . <nl> init ( arrayLiteral elements : Element . . . ) <nl> mmm a / stdlib / public / core / ContiguousArrayBuffer . swift <nl> ppp b / stdlib / public / core / ContiguousArrayBuffer . swift <nl> public struct _ContiguousArrayBuffer < Element > : _ArrayBufferProtocol { <nl> } <nl> <nl> / / / Copy the elements in ` bounds ` from this buffer into uninitialized <nl> - / / / memory starting at ` target ` . Return a pointer past - the - end of the <nl> + / / / memory starting at ` target ` . Return a pointer " past the end " of the <nl> / / / just - initialized memory . <nl> @ discardableResult <nl> public func _copyContents ( <nl> mmm a / stdlib / public / core / HashedCollections . swift . gyb <nl> ppp b / stdlib / public / core / HashedCollections . swift . gyb <nl> internal struct _UnmanagedAnyObjectArray { <nl> / / / <nl> / / / - Use the ` contains ( _ : ) ` method to test whether a set contains a specific <nl> / / / element . <nl> - / / / - Use the ` = = ` operator to test whether two sets contain the same elements . <nl> + / / / - Use the " equal to " operator ( ` = = ` ) to test whether two sets contain the <nl> + / / / same elements . <nl> / / / - Use the ` isSubset ( of : ) ` method to test whether a set contains all the <nl> / / / elements of another set or sequence . <nl> / / / - Use the ` isSuperset ( of : ) ` method to test whether all elements of a set <nl> / / / are contained in another set or sequence . <nl> - / / / - Use the ` isStrictSubset ( of : ) ` and ` isStrictSuperset ( of : ) ` methods to <nl> - / / / test whether a set is a subset or superset of , but not equal to , another <nl> - / / / set . <nl> - / / / - Use the ` isDisjoint ( with : ) ` method to test whether a set has any <nl> - / / / elements in common with another set . <nl> + / / / - Use the ` isStrictSubset ( of : ) ` and ` isStrictSuperset ( of : ) ` methods to test <nl> + / / / whether a set is a subset or superset of , but not equal to , another set . <nl> + / / / - Use the ` isDisjoint ( with : ) ` method to test whether a set has any elements <nl> + / / / in common with another set . <nl> / / / <nl> / / / You can also combine , exclude , or subtract the elements of two sets : <nl> / / / <nl> / / / - Use the ` union ( _ : ) ` method to create a new set with the elements of a set <nl> / / / and another set or sequence . <nl> - / / / - Use the ` intersection ( _ : ) ` method to create a new set with only the elements <nl> - / / / common to a set and another set or sequence . <nl> - / / / - Use the ` symmetricDifference ( _ : ) ` method to create a new set with the elements <nl> - / / / that are in either a set or another set or sequence , but not in both . <nl> - / / / - Use the ` subtracting ( _ : ) ` method to create a new set with the elements of a <nl> - / / / set that are not also in another set or sequence . <nl> + / / / - Use the ` intersection ( _ : ) ` method to create a new set with only the <nl> + / / / elements common to a set and another set or sequence . <nl> + / / / - Use the ` symmetricDifference ( _ : ) ` method to create a new set with the <nl> + / / / elements that are in either a set or another set or sequence , but not in <nl> + / / / both . <nl> + / / / - Use the ` subtracting ( _ : ) ` method to create a new set with the elements of <nl> + / / / a set that are not also in another set or sequence . <nl> / / / <nl> / / / You can modify a set in place by using these methods ' mutating <nl> / / / counterparts : ` formUnion ( _ : ) ` , ` formIntersection ( _ : ) ` , <nl> public struct Set < Element : Hashable > : <nl> return _variantStorage . startIndex <nl> } <nl> <nl> - / / / The " past - the - end " position for iterating members of the set . <nl> + / / / The " past the end " position for iterating members of the set . <nl> / / / <nl> / / / The ` endIndex ` property is never a valid subscript argument . If the set <nl> / / / is empty , ` endIndex ` is equal to ` startIndex ` . <nl> public struct Set < Element : Hashable > : <nl> return _variantStorage . index ( forKey : member ) <nl> } <nl> <nl> - / / / If ` newMember ` is not already contained in ` self ` , inserts it . <nl> + / / / Inserts the given element in the set if it is not already present . <nl> / / / <nl> - / / / If the element is already contained in the set , this method has no <nl> - / / / effect . In this example , a new element is inserted into ` classDays ` , a <nl> - / / / set of days of the week . When an existing element is inserted , the <nl> - / / / ` classDays ` set does not change . <nl> + / / / If an element equal to ` newMember ` is already contained in the set , this <nl> + / / / method has no effect . In the following example , a new element is <nl> + / / / inserted into ` classDays ` , a set of days of the week . When an existing <nl> + / / / element is inserted , the ` classDays ` set does not change . <nl> / / / <nl> / / / enum DayOfTheWeek : Int { <nl> / / / case sunday , monday , tuesday , wednesday , thursday , <nl> public struct Set < Element : Hashable > : <nl> / / / print ( classDays ) <nl> / / / / / Prints " [ . friday , . wednesday , . monday ] " <nl> / / / <nl> - / / / - Returns : ` ( true , newMember ) ` if ` newMember ` was not contained in <nl> - / / / ` self ` . Otherwise , returns ` ( false , oldMember ) ` , where ` oldMember ` is <nl> - / / / the member of ` self ` equal to ` newMember ` ( which may be <nl> - / / / distinguishable from ` newMember ` , e . g . via ` = = = ` ) . <nl> - / / / <nl> - / / / - Postcondition : ` self . contains ( newMember ) ` . <nl> + / / / - Parameter newMember : An element to insert into the set . <nl> + / / / - Returns : ` ( true , newMember ) ` if ` newMember ` was not contained in the <nl> + / / / set . If an element equal to ` newMember ` was already contained in the <nl> + / / / set , the method returns ` ( false , oldMember ) ` , where ` oldMember ` is the <nl> + / / / element that was equal to ` newMember ` . In some cases , ` oldMember ` may <nl> + / / / be distinguishable from ` newMember ` by identity comparison or some <nl> + / / / other means . <nl> @ discardableResult <nl> public mutating func insert ( <nl> _ newMember : Element <nl> public struct Set < Element : Hashable > : <nl> return _variantStorage . insert ( newMember , forKey : newMember ) <nl> } <nl> <nl> - / / / Inserts ` newMember ` unconditionally . <nl> + / / / Inserts the given element into the set unconditionally . <nl> / / / <nl> - / / / - Returns : the former member of ` self ` equal to ` newMember ` <nl> - / / / ( which may be distinguishable from ` newMember ` , e . g . via <nl> - / / / ` = = = ` ) , or ` nil ` if no such element existed . <nl> + / / / If an element equal to ` newMember ` is already contained in the set , <nl> + / / / ` newMember ` replaces the existing element . In this example , an existing <nl> + / / / element is inserted into ` classDays ` , a set of days of the week . <nl> / / / <nl> - / / / - Postcondition : ` self . contains ( newMember ) ` <nl> + / / / enum DayOfTheWeek : Int { <nl> + / / / case sunday , monday , tuesday , wednesday , thursday , <nl> + / / / friday , saturday <nl> + / / / } <nl> + / / / <nl> + / / / var classDays : Set < DayOfTheWeek > = [ . monday , . wednesday , . friday ] <nl> + / / / print ( classDays . update ( with : . monday ) ) <nl> + / / / / / Prints " Optional ( . monday ) " <nl> + / / / <nl> + / / / - Parameter newMember : An element to insert into the set . <nl> + / / / - Returns : An element equal to ` newMember ` if the set already contained <nl> + / / / such a member ; otherwise , ` nil ` . In some cases , the returned element <nl> + / / / may be distinguishable from ` newMember ` by identity comparison or some <nl> + / / / other means . <nl> @ discardableResult <nl> public mutating func update ( with newMember : Element ) - > Element ? { <nl> return _variantStorage . updateValue ( newMember , forKey : newMember ) <nl> public struct Set < Element : Hashable > : <nl> / / / strings . <nl> / / / <nl> / / / let ingredients : Set = [ " cocoa beans " , " sugar " , " cocoa butter " , " salt " ] <nl> - / / / if ingredients . isSupersetOf ( [ " sugar " , " salt " ] ) { <nl> + / / / if ingredients . isSuperset ( of : [ " sugar " , " salt " ] ) { <nl> / / / print ( " Whatever it is , it ' s bound to be delicious ! " ) <nl> / / / } <nl> / / / / / Prints " Whatever it is , it ' s bound to be delicious ! " <nl> public struct Set < Element : Hashable > : <nl> / / / / / Prints " true " <nl> / / / <nl> / / / / / A set is never a strict subset of itself : <nl> - / / / print ( attendees . isStrictSubsetOf ( attendees ) ) <nl> + / / / print ( attendees . isStrictSubset ( of : attendees ) ) <nl> / / / / / Prints " false " <nl> / / / <nl> / / / - Parameter possibleStrictSuperset : A sequence of elements . <nl> public struct Set < Element : Hashable > : <nl> return newSet <nl> } <nl> <nl> - / / / Inserts the elements of ` other ` into ` self ` . <nl> + / / / Inserts the elements of the given sequence into the set . <nl> + / / / <nl> + / / / If the set already contains one or more elements that are also in <nl> + / / / ` other ` , the existing members are kept . If ` other ` contains multiple <nl> + / / / instances of equivalent elements , only the first instance is kept . <nl> + / / / <nl> + / / / var attendees : Set = [ " Alicia " , " Bethany " , " Diana " ] <nl> + / / / let visitors = [ " Diana " , " " Marcia " , " Nathaniel " ] <nl> + / / / attendees . formUnion ( visitors ) <nl> + / / / print ( attendees ) <nl> + / / / / / Prints " [ " Diana " , " Nathaniel " , " Bethany " , " Alicia " , " Marcia " ] " <nl> + / / / <nl> + / / / - Parameter other : A sequence of elements . ` other ` must be finite . <nl> public mutating func formUnion < <nl> S : Sequence where S . Iterator . Element = = Element <nl> > ( _ other : S ) { <nl> public struct Set < Element : Hashable > : <nl> return newSet <nl> } <nl> <nl> - / / / Replace ` self ` with the elements contained in ` self ` or ` other ` , <nl> - / / / but not both . <nl> + / / / Replace this set with the elements contained in this set or the given <nl> + / / / set , but not both . <nl> / / / <nl> / / / For example : <nl> / / / <nl> extension Set { <nl> / / / <nl> / / / let employees = [ " Alicia " , " Bethany " , " Chris " , " Diana " , " Eric " ] <nl> / / / let attendees : Set = [ " Alicia " , " Bethany " , " Diana " ] <nl> - / / / print ( attendees . isSubsetOf ( employees ) ) <nl> + / / / print ( attendees . isSubset ( of : employees ) ) <nl> / / / / / Prints " true " <nl> / / / <nl> / / / - Parameter other : A sequence of elements . ` possibleSuperset ` <nl> extension Set { <nl> / / / <nl> / / / let employees : Set = [ " Alicia " , " Bethany " , " Chris " , " Diana " , " Eric " ] <nl> / / / let attendees : Set = [ " Alicia " , " Bethany " , " Diana " ] <nl> - / / / print ( employees . isSupersetOf ( attendees ) ) <nl> + / / / print ( employees . isSuperset ( of : attendees ) ) <nl> / / / / / Prints " true " <nl> / / / <nl> / / / - Parameter possibleSubset : Another set . <nl> mmm a / stdlib / public / core / Indices . swift . gyb <nl> ppp b / stdlib / public / core / Indices . swift . gyb <nl> public struct $ { Self } < <nl> } <nl> <nl> extension $ { collectionForTraversal ( Traversal ) } where Indices = = $ { Self } < Self > { <nl> + / / / The indices that are valid for subscripting the collection , in ascending <nl> + / / / order . <nl> + / / / <nl> + / / / A collections ' s ` indices ` property can hold a strong reference to the <nl> + / / / collection itself , causing the collection to be non - uniquely referenced . <nl> + / / / If you mutate the collection while iterating over its indices , a strong <nl> + / / / reference can cause an unexpected copy of the collection . To avoid the <nl> + / / / unexpected copy , use the ` index ( after : ) ` method starting with <nl> + / / / ` startIndex ` to produce indices instead . <nl> + / / / <nl> + / / / var c = MyFancyCollection ( [ 10 , 20 , 30 , 40 , 50 ] ) <nl> + / / / var i = c . startIndex <nl> + / / / while i ! = c . endIndex { <nl> + / / / c [ i ] / = 5 <nl> + / / / i = c . index ( after : i ) <nl> + / / / } <nl> + / / / / / c = = MyFancyCollection ( [ 2 , 4 , 6 , 8 , 10 ] ) <nl> public var indices : $ { Self } < Self > { <nl> return $ { Self } ( <nl> _elements : self , <nl> mmm a / stdlib / public / core / Mirror . swift <nl> ppp b / stdlib / public / core / Mirror . swift <nl> public struct Mirror { <nl> internal let _defaultDescendantRepresentation : _DefaultDescendantRepresentation <nl> } <nl> <nl> - / / / A type that explicitly supplies its own Mirror . <nl> + / / / A type that explicitly supplies its own mirror . <nl> / / / <nl> - / / / Instances of any type can be ` Mirror ( reflect : ) ` ' ed upon , but if you are <nl> - / / / not satisfied with the ` Mirror ` supplied for your type by default , <nl> - / / / you can make it conform to ` CustomReflectable ` and return a custom <nl> - / / / ` Mirror ` . <nl> + / / / You can create a mirror for any type using the ` Mirror ( reflect : ) ` <nl> + / / / initializer , but if you are not satisfied with the mirror supplied for <nl> + / / / your type by default , you can make it conform to ` CustomReflectable ` and <nl> + / / / return a custom ` Mirror ` instance . <nl> public protocol CustomReflectable { <nl> - / / / The ` Mirror ` for ` self ` . <nl> + / / / The custom mirror for this instance . <nl> / / / <nl> - / / / - Note : If ` Self ` has value semantics , the ` Mirror ` should be <nl> - / / / unaffected by subsequent mutations of ` self ` . <nl> + / / / If this type has value semantics , the mirror should be unaffected by <nl> + / / / subsequent mutations of the instance . <nl> var customMirror : Mirror { get } <nl> } <nl> <nl> - / / / A type that explicitly supplies its own Mirror but whose <nl> - / / / descendant classes are not represented in the Mirror unless they <nl> + / / / A type that explicitly supplies its own mirror , but whose <nl> + / / / descendant classes are not represented in the mirror unless they <nl> / / / also override ` customMirror ` . <nl> public protocol CustomLeafReflectable : CustomReflectable { } <nl> <nl> extension Mirror { <nl> / / / A ` String ` argument selects the first ` Child ` with a matching label . <nl> / / / An integer argument * n * select the * n * th ` Child ` . For example : <nl> / / / <nl> - / / / var d = Mirror ( reflecting : x ) . descendant ( 1 , " two " , 3 ) <nl> + / / / var d = Mirror ( reflecting : x ) . descendant ( 1 , " two " , 3 ) <nl> / / / <nl> / / / is equivalent to : <nl> / / / <nl> mmm a / stdlib / public / core / MutableCollection . swift <nl> ppp b / stdlib / public / core / MutableCollection . swift <nl> public protocol MutableIndexable : Indexable { <nl> / / / ` endIndex ` property . <nl> subscript ( position : Index ) - > _Element { get set } <nl> <nl> + / / / A collection that represents a contiguous subrange of the collection ' s <nl> + / / / elements . <nl> associatedtype SubSequence <nl> <nl> / / / Accesses a contiguous subrange of the collection ' s elements . <nl> public protocol MutableIndexable : Indexable { <nl> / / / - Complexity : O ( 1 ) . <nl> func _failEarlyRangeCheck ( _ range : Range < Index > , bounds : Range < Index > ) <nl> <nl> - / / / Returns the next consecutive ` Index ` in a discrete sequence of <nl> - / / / ` Index ` values . <nl> + / / / Returns the position immediately after the given index . <nl> / / / <nl> - / / / - Precondition : ` i ` has a well - defined successor . <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be less than <nl> + / / / ` endIndex ` . <nl> + / / / - Returns : The index value immediately after ` i ` . <nl> @ warn_unused_result <nl> func index ( after i : Index ) - > Index <nl> <nl> + / / / Replaces the given index with its successor . <nl> + / / / <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be less than <nl> + / / / ` endIndex ` . <nl> func formIndex ( after i : inout Index ) <nl> } <nl> <nl> mmm a / stdlib / public / core / OptionSet . swift <nl> ppp b / stdlib / public / core / OptionSet . swift <nl> extension OptionSet where Element = = Self { <nl> return self . isSuperset ( of : member ) <nl> } <nl> <nl> - / / / Inserts the given element into the option set if it is not already <nl> - / / / a member . <nl> - / / / <nl> + / / / Inserts the given element into the option set if it is not already a <nl> + / / / member . <nl> + / / / <nl> / / / For example : <nl> / / / <nl> / / / let purchasePrice = 87 . 55 <nl> / / / <nl> - / / / var freeOptions : ShippingOptions = [ . standard ] <nl> + / / / var freeOptions : ShippingOptions = [ . standard , . priority ] <nl> / / / if purchasePrice > 50 { <nl> - / / / freeOptions . insert ( . priority ) <nl> + / / / freeOptions . insert ( . secondDay ) <nl> / / / } <nl> - / / / print ( freeOptions . contains ( . priority ) ) <nl> + / / / print ( freeOptions . contains ( . secondDay ) ) <nl> / / / / / Prints " true " <nl> / / / <nl> / / / - Parameter newMember : The element to insert . <nl> - / / / - Returns : ` ( true , newMember ) ` if ` e ` was not contained in ` self ` . <nl> - / / / Otherwise , returns ` ( false , oldMember ) ` , where ` oldMember ` is the <nl> - / / / member of ` self ` equal to ` newMember ` . <nl> - / / / <nl> - / / / - Postcondition : ` self . contains ( newMember ) ` . <nl> + / / / - Returns : ` ( true , newMember ) ` if ` newMember ` was not contained in <nl> + / / / ` self ` . Otherwise , returns ` ( false , oldMember ) ` , where ` oldMember ` is <nl> + / / / the member of the set equal to ` newMember ` . <nl> public mutating func insert ( <nl> _ newMember : Element <nl> ) - > ( inserted : Bool , memberAfterInsert : Element ) { <nl> extension OptionSet where Element = = Self { <nl> return result <nl> } <nl> <nl> - / / / Removes a given element if it is contained in the option set ; otherwise , <nl> - / / / removes all elements subsumed by the given element . <nl> + / / / Removes the given element and all elements subsumed by the given element . <nl> / / / <nl> - / / / In the following example , removing ` . express ` empties the option set but <nl> - / / / returns ` nil ` because the option set doesn ' t contain all the elements of <nl> - / / / ` . express ` . <nl> + / / / For example : <nl> / / / <nl> / / / var options : ShippingOptions = [ . secondDay , . priority ] <nl> / / / let priorityOption = options . remove ( . priority ) <nl> / / / print ( priorityOption = = . priority ) <nl> / / / / / Prints " true " <nl> / / / <nl> + / / / print ( options . remove ( . priority ) ) <nl> + / / / / / Prints " nil " <nl> + / / / <nl> + / / / In the following example , the ` . express ` element is passed to <nl> + / / / ` remove ( _ : ) ` . Although ` . express ` is not a member of ` options ` , <nl> + / / / ` . express ` subsumes the remaining ` . secondDay ` element of the option <nl> + / / / set . Therefore , ` options ` is emptied and the intersection between <nl> + / / / ` . express ` and ` options ` is returned . <nl> + / / / <nl> / / / let expressOption = options . remove ( . express ) <nl> / / / print ( expressOption = = . express ) <nl> / / / / / Prints " false " <nl> - / / / print ( options . isEmpty ) <nl> + / / / print ( expressOption = = . secondDay ) <nl> / / / / / Prints " true " <nl> / / / <nl> / / / - Parameter member : The element of the set to remove . <nl> - / / / - Returns : ` member ` if it was contained in the set ; otherwise , ` nil ` . <nl> - / / / - Postcondition : ` self . intersection ( [ member ] ) . isEmpty ` <nl> + / / / - Returns : The intersection of ` [ member ] ` and the set if the intersection <nl> + / / / was nonempty ; otherwise , ` nil ` . <nl> @ discardableResult <nl> public mutating func remove ( _ member : Element ) - > Element ? { <nl> let r = isSuperset ( of : member ) ? Optional ( member ) : nil <nl> extension OptionSet where Element = = Self { <nl> return r <nl> } <nl> <nl> - / / / Inserts ` e ` unconditionally . <nl> + / / / Inserts the given element into the set . <nl> + / / / <nl> + / / / If ` newMember ` is not contained in the set but subsumes current members <nl> + / / / of the set , the subsumed members are returned . <nl> / / / <nl> - / / / - Returns : a former member ` r ` of ` self ` such that <nl> - / / / ` self . intersection ( [ e ] ) = = [ r ] ` if ` self . intersection ( [ e ] ) ` was <nl> - / / / non - empty . Returns ` nil ` otherwise . <nl> + / / / var options : ShippingOptions = [ . secondDay , . priority ] <nl> + / / / let replaced = options . update ( with : . express ) <nl> + / / / print ( replaced = = . secondDay ) <nl> + / / / / / Prints " true " <nl> / / / <nl> - / / / - Postcondition : ` self . contains ( e ) ` <nl> + / / / - Returns : The intersection of ` [ newMember ] ` and the set if the <nl> + / / / intersection was nonempty ; otherwise , ` nil ` . <nl> @ discardableResult <nl> - public mutating func update ( with e : Element ) - > Element ? { <nl> - let r = self . intersection ( e ) <nl> - self . formUnion ( e ) <nl> + public mutating func update ( with newMember : Element ) - > Element ? { <nl> + let r = self . intersection ( newMember ) <nl> + self . formUnion ( newMember ) <nl> return r . isEmpty ? nil : r <nl> } <nl> } <nl> extension OptionSet where RawValue : BitwiseOperations { <nl> / / / two sets ' raw values . <nl> / / / <nl> / / / - Parameter other : An option set . <nl> - / / / - Postcondition : ` self . isSuperset ( of : other ) ` <nl> public mutating func formUnion ( _ other : Self ) { <nl> self = Self ( rawValue : self . rawValue | other . rawValue ) <nl> } <nl> extension OptionSet where RawValue : BitwiseOperations { <nl> / / / two sets ' raw values . <nl> / / / <nl> / / / - Parameter other : An option set . <nl> - / / / - Postcondition : ` self . isSubset ( of : other ) ` <nl> public mutating func formIntersection ( _ other : Self ) { <nl> self = Self ( rawValue : self . rawValue & other . rawValue ) <nl> } <nl> mmm a / stdlib / public / core / Optional . swift <nl> ppp b / stdlib / public / core / Optional . swift <nl> <nl> / / / mmmmmmmmmmmmmmm - - <nl> / / / <nl> / / / To safely access the properties and methods of a wrapped instance , use the <nl> - / / / postfix ` ? ` ( optional chaining ) operator . The following example uses <nl> + / / / postfix optional chaining operator ( ` ? ` ) . The following example uses <nl> / / / optional chaining to access the ` hasSuffix ( _ : ) ` method on a ` String ? ` <nl> / / / instance . <nl> / / / <nl> <nl> / / / Using the Nil - Coalescing Operator <nl> / / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm <nl> / / / <nl> - / / / Use the ` ? ? ` ( nil - coalescing ) operator to supply a default value in case <nl> + / / / Use the nil - coalescing operator ( ` ? ? ` ) to supply a default value in case <nl> / / / the ` Optional ` instance is ` nil ` . Here a default path is supplied for an <nl> / / / image that is missing from ` imagePaths ` . <nl> / / / <nl> <nl> / / / mmmmmmmmmmmmmmmmmmmmmmmm <nl> / / / <nl> / / / When you ' re certain that an instance of ` Optional ` contains a value , you <nl> - / / / can unconditionally unwrap the value by using the postfix ` ! ` ( forced <nl> - / / / unwrap ) operator . For example , the result of the failable ` Int ` <nl> + / / / can unconditionally unwrap the value by using the forced <nl> + / / / unwrap operator ( postfix ` ! ` ) . For example , the result of the failable ` Int ` <nl> / / / initializer is unconditionally unwrapped in the example below . <nl> / / / <nl> / / / let number = Int ( " 42 " ) ! <nl> public enum Optional < Wrapped > : NilLiteralConvertible { <nl> / / / The wrapped value of this instance , unwrapped without checking whether <nl> / / / the instance is ` nil ` . <nl> / / / <nl> - / / / The ` unsafelyUnwrapped ` property provides the same value as the postfix <nl> - / / / ` ! ` ( forced unwrap ) operator . However , in optimized builds ( ` - O ` ) , no <nl> + / / / The ` unsafelyUnwrapped ` property provides the same value as the forced <nl> + / / / unwrap operator ( postfix ` ! ` ) . However , in optimized builds ( ` - O ` ) , no <nl> / / / check is performed to ensure that the current instance actually has a <nl> / / / value . Accessing this property in the case of a ` nil ` value is a serious <nl> / / / programming error and could lead to undefined behavior or a runtime <nl> mmm a / stdlib / public / core / Policy . swift <nl> ppp b / stdlib / public / core / Policy . swift <nl> public typealias Any = protocol < > <nl> / / / <nl> / / / In the code samples that follow , the elements of the ` NSArray ` instance <nl> / / / ` numberObjects ` have ` AnyObject ` as their type . The first example uses the <nl> - / / / ` as ? ` ( conditional downcast ) operator to conditionally cast the first <nl> + / / / conditional downcast operator ( ` as ? ` ) to conditionally cast the first <nl> / / / object in the ` numberObjects ` array to an instance of Swift ' s ` String ` <nl> / / / type . <nl> / / / <nl> public typealias Any = protocol < > <nl> / / / / / Prints ( " The first object , ' one ' , is a String " ) <nl> / / / <nl> / / / If you have prior knowledge that an ` AnyObject ` instance has a particular <nl> - / / / type , you can use the ` as ! ` ( unconditional downcast ) operator . Performing <nl> + / / / type , you can use the unconditional downcast operator ( ` as ! ` ) . Performing <nl> / / / an invalid cast triggers a runtime error . <nl> / / / <nl> / / / let second = numberObjects . object ( at : 1 ) as ! String <nl> mmm a / stdlib / public / core / RandomAccessCollection . swift <nl> ppp b / stdlib / public / core / RandomAccessCollection . swift <nl> <nl> / / <nl> / / = = = mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> - / / / A collection that supports efficient random access index traversal . <nl> + / / / A collection that supports efficient random - access index traversal . <nl> / / / <nl> - / / / - Important : In most cases , it ' s best to ignore this protocol and use <nl> - / / / ` RandomAccessCollection ` instead , as it has a more complete interface . <nl> + / / / In most cases , it ' s best to ignore this protocol and use the <nl> + / / / ` RandomAccessCollection ` protocol instead , because it has a more complete <nl> + / / / interface . <nl> public protocol RandomAccessIndexable : BidirectionalIndexable { <nl> / / FIXME ( ABI ) ( compiler limitation ) : there is no reason for this protocol <nl> / / to exist apart from missing compiler features that we emulate with it . <nl> public protocol RandomAccessIndexable : BidirectionalIndexable { <nl> / / library . <nl> } <nl> <nl> - / / / A collection that supports efficient random access index traversal . <nl> + / / / A collection that supports efficient random - access index traversal . <nl> / / / <nl> - / / / - Note : the fundamental difference between <nl> - / / / ` RandomAccessCollection ` and ` BidirectionalCollection ` is that <nl> - / / / the following are O ( N ) in ` BidirectionalCollection ` but O ( 1 ) in <nl> - / / / ` RandomAccessCollection ` : <nl> + / / / Random - access collections can measure move indices any distance and can <nl> + / / / measure the distance between indices in O ( 1 ) time . Therefore , the <nl> + / / / fundamental difference between random - access and bidirectional collections <nl> + / / / is that operations that depend on index movement or distance measurement <nl> + / / / offer significantly improved efficiency . For example , a random - access <nl> + / / / collection ' s ` count ` property is calculated in O ( 1 ) instead of requiring <nl> + / / / iteration of an entire collection . <nl> / / / <nl> - / / / - ` c . count ` <nl> - / / / - ` c . index ( i , offsetBy : n ) ` <nl> - / / / - ` c . index ( i , offsetBy : n , limitedBy : l ) ` <nl> - / / / - ` c . distance ( from : i , to : j ) ` <nl> + / / / Conforming to the RandomAccessCollection Protocol <nl> + / / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = <nl> + / / / <nl> + / / / The ` RandomAccessCollection ` protocol adds further constraints on the <nl> + / / / associated ` Indices ` and ` SubSequence ` types , but otherwise imposes no <nl> + / / / additional requirements over the ` BidirectionalCollection ` protocol . <nl> + / / / However , in order to meet the complexity guarantees of a random - access <nl> + / / / collection , either the index for your custom type must conform to the <nl> + / / / ` Strideable ` protocol or you must implement the ` index ( _ : offsetBy : ) ` and <nl> + / / / ` distance ( from : to : ) ` methods with O ( 1 ) efficiency . <nl> public protocol RandomAccessCollection : <nl> RandomAccessIndexable , BidirectionalCollection <nl> { <nl> - <nl> + / / / A collection that represents a contiguous subrange of the collection ' s <nl> + / / / elements . <nl> associatedtype SubSequence : RandomAccessIndexable , BidirectionalCollection <nl> = RandomAccessSlice < Self > <nl> / / FIXME ( compiler limitation ) : <nl> / / associatedtype SubSequence : RandomAccessCollection <nl> <nl> + / / / A type that can represent the indices that are valid for subscripting the <nl> + / / / collection , in ascending order . <nl> associatedtype Indices : RandomAccessIndexable , BidirectionalCollection <nl> = DefaultRandomAccessIndices < Self > <nl> / / FIXME ( compiler limitation ) : <nl> public protocol RandomAccessCollection : <nl> / / / models that accept the default associated ` SubSequence ` , <nl> / / / ` RandomAccessSlice < Self > ` . <nl> extension RandomAccessCollection where SubSequence = = RandomAccessSlice < Self > { <nl> + / / / Accesses a contiguous subrange of the collection ' s elements . <nl> + / / / <nl> + / / / The accessed slice uses the same indices for the same elements as the <nl> + / / / original collection uses . Always use the slice ' s ` startIndex ` property <nl> + / / / instead of assuming that its indices start at a particular value . <nl> + / / / <nl> + / / / This example demonstrates getting a slice of an array of strings , finding <nl> + / / / the index of one of the strings in the slice , and then using that index <nl> + / / / in the original array . <nl> + / / / <nl> + / / / let streets = [ " Adams " , " Bryant " , " Channing " , " Douglas " , " Evarts " ] <nl> + / / / let streetsSlice = streets [ 2 . . < streets . endIndex ] <nl> + / / / print ( streetsSlice ) <nl> + / / / / / Prints " [ " Channing " , " Douglas " , " Evarts " ] " <nl> + / / / <nl> + / / / let index = streetsSlice . index ( of : " Evarts " ) / / 4 <nl> + / / / print ( streets [ index ! ] ) <nl> + / / / / / Prints " Evarts " <nl> + / / / <nl> + / / / - Parameter bounds : A range of the collection ' s indices . The bounds of <nl> + / / / the range must be valid indices of the collection . <nl> public subscript ( bounds : Range < Index > ) - > RandomAccessSlice < Self > { <nl> _failEarlyRangeCheck ( bounds , bounds : startIndex . . < endIndex ) <nl> return RandomAccessSlice ( base : self , bounds : bounds ) <nl> extension RandomAccessCollection where SubSequence = = RandomAccessSlice < Self > { <nl> <nl> / / / Default implementation for random access collections . <nl> extension RandomAccessIndexable { <nl> - / / / Returns the result of advancing ` i ` by ` n ` positions , or ` nil ` <nl> - / / / if doing so would pass ` limit ` . <nl> + / / / Returns an index that is the specified distance from the given index , <nl> + / / / unless that distance is beyond a given limiting index . <nl> + / / / <nl> + / / / The following example obtains an index advanced four positions from an <nl> + / / / array ' s starting index and then prints the element at that position . The <nl> + / / / operation doesn ' t require going beyond the limiting ` numbers . endIndex ` <nl> + / / / value , so it succeeds . <nl> + / / / <nl> + / / / let numbers = [ 10 , 20 , 30 , 40 , 50 ] <nl> + / / / let i = numbers . index ( numbers . startIndex , offsetBy : 4 ) <nl> + / / / print ( numbers [ i ] ) <nl> + / / / / / Prints " 50 " <nl> + / / / <nl> + / / / The next example attempts to retrieve an index ten positions from <nl> + / / / ` numbers . startIndex ` , but fails , because that distance is beyond the index <nl> + / / / passed as ` limit ` . <nl> + / / / <nl> + / / / let j = numbers . index ( numbers . startIndex , <nl> + / / / offsetBy : 10 , <nl> + / / / limitedBy : numbers . endIndex ) <nl> + / / / print ( j ) <nl> + / / / / / Prints " nil " <nl> / / / <nl> - / / / - Returns : <nl> - / / / - ` nil ` if ` ( limit > i ) = = ( n > 0 ) & & abs ( distance ( i , limit ) ) < abs ( n ) ` <nl> - / / / - Otherwise , ` index ( i , offsetBy : n ) ` <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> / / / <nl> - / / / - Complexity : <nl> - / / / - O ( 1 ) <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the array . <nl> + / / / - n : The distance to offset ` i ` . <nl> + / / / - limit : A valid index of the collection to use as a limit . If ` n > 0 ` , <nl> + / / / ` limit ` should be greater than ` i ` to have any effect . Likewise , if <nl> + / / / ` n < 0 ` , ` limit ` should be less than ` i ` to have any effect . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` , unless that index <nl> + / / / would be beyond ` limit ` in the direction of movement . In that case , <nl> + / / / the method returns ` nil ` . <nl> + / / / <nl> + / / / - Complexity : O ( 1 ) <nl> @ warn_unused_result <nl> public func index ( <nl> _ i : Index , offsetBy n : IndexDistance , limitedBy limit : Index <nl> where Index : Strideable , <nl> Index . Stride = = IndexDistance , <nl> Indices = = CountableRange < Index > { <nl> <nl> + / / / The indices that are valid for subscripting the collection , in ascending <nl> + / / / order . <nl> + / / / <nl> + / / / A collections ' s ` indices ` property can hold a strong reference to the <nl> + / / / collection itself , causing the collection to be non - uniquely referenced . <nl> + / / / If you mutate the collection while iterating over its indices , a strong <nl> + / / / reference can cause an unexpected copy of the collection . To avoid the <nl> + / / / unexpected copy , use the ` index ( after : ) ` method starting with <nl> + / / / ` startIndex ` to produce indices instead . <nl> + / / / <nl> + / / / var c = MyFancyCollection ( [ 10 , 20 , 30 , 40 , 50 ] ) <nl> + / / / var i = c . startIndex <nl> + / / / while i ! = c . endIndex { <nl> + / / / c [ i ] / = 5 <nl> + / / / i = c . index ( after : i ) <nl> + / / / } <nl> + / / / / / c = = MyFancyCollection ( [ 2 , 4 , 6 , 8 , 10 ] ) <nl> public var indices : CountableRange < Index > { <nl> return startIndex . . < endIndex <nl> } <nl> where Index : Strideable , <nl> return i <nl> } <nl> <nl> - / / / Returns the position immediately after ` i ` . <nl> + / / / Returns the position immediately after the given index . <nl> / / / <nl> - / / / - Precondition : ` ( startIndex . . < endIndex ) . contains ( i ) ` <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be less than <nl> + / / / ` endIndex ` . <nl> + / / / - Returns : The index value immediately after ` i ` . <nl> @ warn_unused_result <nl> public func index ( after i : Index ) - > Index { <nl> return _validityChecked ( i . advanced ( by : 1 ) ) <nl> } <nl> <nl> - / / / Returns the position immediately preceding ` i ` . <nl> - / / / <nl> - / / / - If ` i > = startIndex & & i < endIndex ` , <nl> - / / / ` index ( before : index ( after : i ) ) = = i ` . <nl> - / / / <nl> - / / / - If ` i > startIndex & & i < = endIndex ` <nl> - / / / ` index ( after : index ( before : i ) ) = = i ` . <nl> + / / / Returns the position immediately after the given index . <nl> / / / <nl> - / / / - Precondition : ` i > startIndex & & i < = endIndex ` <nl> + / / / - Parameter i : A valid index of the collection . ` i ` must be greater than <nl> + / / / ` startIndex ` . <nl> + / / / - Returns : The index value immediately before ` i ` . <nl> @ warn_unused_result <nl> public func index ( before i : Index ) - > Index { <nl> return _validityChecked ( i . advanced ( by : - 1 ) ) <nl> } <nl> <nl> - / / / Returns the result of advancing ` i ` by ` n ` positions . <nl> + / / / Returns an index that is the specified distance from the given index . <nl> / / / <nl> - / / / - Returns : <nl> - / / / - If ` n > 0 ` , the ` n ` th successor of ` i ` . <nl> - / / / - If ` n < 0 ` , the ` n ` th predecessor of ` i ` . <nl> - / / / - Otherwise , ` i ` unmodified . <nl> + / / / The following example obtains an index advanced four positions from an <nl> + / / / array ' s starting index and then prints the element at that position . <nl> + / / / <nl> + / / / let numbers = [ 10 , 20 , 30 , 40 , 50 ] <nl> + / / / let i = numbers . index ( numbers . startIndex , offsetBy : 4 ) <nl> + / / / print ( numbers [ i ] ) <nl> + / / / / / Prints " 50 " <nl> + / / / <nl> + / / / Advancing an index beyond a collection ' s ending index or offsetting it <nl> + / / / before a collection ' s starting index may trigger a runtime error . The <nl> + / / / value passed as ` n ` must not result in such an operation . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - i : A valid index of the collection . <nl> + / / / - n : The distance to offset ` i ` . <nl> + / / / - Returns : An index offset by ` n ` from the index ` i ` . If ` n ` is positive , <nl> + / / / this is the same value as the result of ` n ` calls to ` index ( after : ) ` . <nl> + / / / If ` n ` is negative , this is the same value as the result of ` - n ` calls <nl> + / / / to ` index ( before : ) ` . <nl> / / / <nl> / / / - Precondition : <nl> / / / - If ` n > 0 ` , ` n < = self . distance ( from : i , to : self . endIndex ) ` <nl> / / / - If ` n < 0 ` , ` n > = self . distance ( from : i , to : self . startIndex ) ` <nl> - / / / <nl> / / / - Complexity : O ( 1 ) <nl> @ warn_unused_result <nl> public func index ( _ i : Index , offsetBy n : Index . Stride ) - > Index { <nl> return _validityChecked ( i . advanced ( by : n ) ) <nl> } <nl> <nl> - / / / Returns the distance from ` start ` to ` end ` . <nl> + / / / Returns the distance between two indices . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - start : A valid index of the collection . <nl> + / / / - end : Another valid index of the collection . If ` end ` is equal to <nl> + / / / ` start ` , the result is zero . <nl> + / / / - Returns : The distance between ` start ` and ` end ` . <nl> / / / <nl> / / / - Complexity : O ( 1 ) <nl> @ warn_unused_result <nl> mmm a / stdlib / public / core / Range . swift . gyb <nl> ppp b / stdlib / public / core / Range . swift . gyb <nl> <nl> / / ambiguity indexing CountableRange < T > outside a generic context . <nl> public enum _DisabledRangeIndex_ { } <nl> <nl> - / / / A half - open range that forms a collection of consecutive ` Strideable ` <nl> - / / / values . <nl> + / / / A half - open range that forms a collection of consecutive values . <nl> / / / <nl> - / / / A ` CountableRange ` instance contains its ` lowerBound ` but not its upper <nl> - / / / bound . Like other collections , a ` CountableRange ` containing one element <nl> - / / / has an ` upperBound ` that is the successor of its ` lowerBound ` and an empty <nl> - / / / ` CountableRange ` has ` lowerBound = = upperBound ` . <nl> + / / / You create a ` CountableRange ` instance by using the half - open range <nl> + / / / operator ( ` . . < ` ) . <nl> / / / <nl> - / / / The associated ` Bound ` type is both the element type and the index type of <nl> + / / / let upToFive = 0 . . < 5 <nl> + / / / <nl> + / / / The associated ` Bound ` type is both the element and index type of <nl> / / / ` CountableRange ` . Each element of the range is its own corresponding <nl> - / / / index , so for any countable range ` r ` , ` r [ i ] = = i ` . <nl> + / / / index . The lower bound of a ` CountableRange ` instance is its start index , <nl> + / / / and the upper bound is its end index . <nl> + / / / <nl> + / / / print ( upToFive . contains ( 3 ) ) / / Prints " true " <nl> + / / / print ( upToFive . contains ( 10 ) ) / / Prints " false " <nl> + / / / print ( upToFive . contains ( 5 ) ) / / Prints " false " <nl> / / / <nl> - / / / Therefore , if ` Bound ` has a maximal value , it can serve as an ` upperBound ` , <nl> - / / / but can never be contained in a ` CountableRange < Bound > ` . <nl> + / / / If the ` Bound ` type has a maximal value , it can serve as an upper bound but <nl> + / / / can never be contained in a ` CountableRange < Bound > ` instance . For example , <nl> + / / / a ` CountableRange < Int8 > ` instance can use ` Int8 . max ` as its upper bound , <nl> + / / / but it can ' t represent a range that includes ` Int8 . max ` . <nl> / / / <nl> / / / let maximumRange = Int8 . min . . < Int8 . max <nl> - / / / maximumRange . contains ( Int8 . max ) / / false <nl> + / / / print ( maximumRange . contains ( Int8 . max ) ) <nl> + / / / / / Prints " false " <nl> + / / / <nl> + / / / If you need to create a range that includes the maximal value of its <nl> + / / / ` Bound ` type , see the ` CountableClosedRange ` type . <nl> + / / / <nl> + / / / You can create a countable range over any type that conforms to the <nl> + / / / ` Strideable ` protocol and uses an integer as its associated ` Stride ` type . <nl> + / / / By default , Swift ' s integer and pointer types are usable as the bounds of <nl> + / / / a countable range . <nl> + / / / <nl> + / / / Because floating - point types such as ` Float ` and ` Double ` are their own <nl> + / / / ` Stride ` types , they cannot be used as the bounds of a countable range . If <nl> + / / / you need to test whether values are contained within an interval bound by <nl> + / / / floating - point values , see the ` Range ` type . If you need to iterate over <nl> + / / / consecutive floating - point values , see the ` stride ( from : to : by : ) ` function . <nl> / / / <nl> - / / / It also follows from the requirement above that ` ( - 99 . . < 100 ) [ 0 ] = = 0 ` . To <nl> - / / / prevent confusion ( because some might expect the result to be ` - 99 ` ) , in a <nl> - / / / context where ` Bound ` is known to be an integer type , subscripting with <nl> - / / / ` Bound ` is a compile - time error : <nl> + / / / Integer Index Ambiguity <nl> + / / / mmmmmmmmmmmmmmmmmmmmm - - <nl> + / / / <nl> + / / / Because each element of a ` CountableRange ` instance is its own index , for <nl> + / / / the range ` ( - 99 . . < 100 ) ` the element at index ` 0 ` is ` 0 ` . This is an <nl> + / / / unexpected result for those accustomed to zero - based collection indices , <nl> + / / / who might expect the result to be ` - 99 ` . To prevent this confusion , in a <nl> + / / / context where ` Bound ` is known to be an integer type , subscripting <nl> + / / / directly is a compile - time error : <nl> / / / <nl> / / / / / error : ambiguous use of ' subscript ' <nl> / / / print ( ( - 99 . . < 100 ) [ 0 ] ) <nl> public enum _DisabledRangeIndex_ { } <nl> / / / func brackets < T > ( _ x : CountableRange < T > , _ i : T ) - > T { <nl> / / / return x [ i ] / / Just forward to subscript <nl> / / / } <nl> - / / / print ( brackets ( ( - 99 . . < 100 ) , 0 ) ) <nl> + / / / print ( brackets ( - 99 . . < 100 , 0 ) ) <nl> / / / / / Prints " 0 " <nl> / / / <nl> / / / - SeeAlso : ` CountableClosedRange ` , ` Range ` , ` ClosedRange ` <nl> public struct CountableRange < <nl> <nl> / / / The range ' s lower bound . <nl> / / / <nl> - / / / Identical to ` upperBound ` in an empty range . <nl> + / / / In an empty range , ` lowerBound ` is equal to ` upperBound ` . <nl> public let lowerBound : Bound <nl> <nl> / / / The range ' s upper bound . <nl> / / / <nl> - / / / ` upperBound ` is not a valid argument to ` subscript ` , and is always <nl> + / / / ` upperBound ` is not a valid subscript argument and is always <nl> / / / reachable from ` lowerBound ` by zero or more applications of <nl> / / / ` index ( after : ) ` . <nl> / / / <nl> - / / / Identical to ` lowerBound ` in an empty range . <nl> + / / / In an empty range , ` upperBound ` is equal to ` lowerBound ` . <nl> public let upperBound : Bound <nl> <nl> + / / / The bound type of the range . <nl> public typealias Element = Bound <nl> <nl> / / / A type that represents a position in the range . <nl> public struct CountableRange < <nl> <nl> public typealias SubSequence = CountableRange < Bound > <nl> <nl> + / / / Accesses the subsequence bounded by the given range . <nl> + / / / <nl> + / / / - Parameter bounds : A range of the range ' s indices . The upper and lower <nl> + / / / bounds of the ` bounds ` range must be valid indices of the collection . <nl> public subscript ( bounds : Range < Index > ) - > CountableRange < Bound > { <nl> return CountableRange ( bounds ) <nl> } <nl> <nl> + / / / Accesses the subsequence bounded by the given range . <nl> + / / / <nl> + / / / - Parameter bounds : A range of the range ' s indices . The upper and lower <nl> + / / / bounds of the ` bounds ` range must be valid indices of the collection . <nl> public subscript ( bounds : CountableRange < Bound > ) - > CountableRange < Bound > { <nl> return self [ Range ( bounds ) ] <nl> } <nl> <nl> public typealias Indices = CountableRange < Bound > <nl> <nl> + / / / The indices that are valid for subscripting the range , in ascending <nl> + / / / order . <nl> public var indices : Indices { <nl> return self <nl> } <nl> <nl> / / / Creates an instance with the given bounds . <nl> / / / <nl> - / / / - Note : As this initializer does not check its precondition , it should be <nl> - / / / used as an optimization only , when one is absolutely certain that <nl> - / / / ` lower < = upper ` . Using the ` . . < ` operator to form ` CountableRange ` <nl> - / / / instances is preferred . <nl> - / / / - Precondition : ` lower < = upper ` <nl> + / / / Because this initializer does not perform any checks , it should be used <nl> + / / / as an optimization only when you are absolutely certain that ` lower ` is <nl> + / / / less than or equal to ` upper ` . Using the half - open range operator <nl> + / / / ( ` . . < ` ) to form ` CountableRange ` instances is preferred . <nl> + / / / <nl> + / / / - Parameter bounds : A tuple of the lower and upper bounds of the range . <nl> public init ( uncheckedBounds bounds : ( lower : Bound , upper : Bound ) ) { <nl> self . lowerBound = bounds . lower <nl> self . upperBound = bounds . upper <nl> public struct CountableRange < <nl> return lowerBound < = element & & element < upperBound <nl> } <nl> <nl> - / / / Returns ` true ` iff ` self . contains ( x ) ` is ` false ` for all values of ` x ` . <nl> + / / / A Boolean value indicating whether the range contains no elements . <nl> + / / / <nl> + / / / An empty range has equal lower and upper bounds . <nl> + / / / <nl> + / / / let empty = 10 . . < 10 <nl> + / / / print ( empty . isEmpty ) <nl> + / / / / / Prints " true " <nl> public var isEmpty : Bool { <nl> return lowerBound = = upperBound <nl> } <nl> public struct CountableRange < <nl> / / FIXME ( ABI ) ( compiler limitation ) : remove this code , it creates an ABI burden <nl> / / on the library . <nl> extension CountableRange { <nl> - / / / Accesses the element at ` position ` . <nl> + / / / Accesses the element at specified position . <nl> + / / / <nl> + / / / You can subscript a collection with any valid index other than the <nl> + / / / collection ' s end index . The end index refers to the position one past <nl> + / / / the last element of a collection , so it doesn ' t correspond with an <nl> + / / / element . <nl> / / / <nl> - / / / - Precondition : ` position ` is a valid position in ` self ` and <nl> - / / / ` position ! = upperBound ` . <nl> + / / / - Parameter position : The position of the element to access . ` position ` <nl> + / / / must be a valid index of the range , and must not equal the range ' s end <nl> + / / / index . <nl> public subscript ( position : Index ) - > Element { <nl> / / FIXME : swift - 3 - indexing - model : tests for the range check . <nl> _debugPrecondition ( self . contains ( position ) , " Index out of range " ) <nl> extension CountableRange <nl> fatalError ( " uncallable " ) <nl> } <nl> <nl> - / / / Accesses the subsequence bounded by ` bounds ` . <nl> + / / / Accesses the subsequence bounded by the given range . <nl> / / / <nl> - / / / - Complexity : O ( 1 ) <nl> - / / / - Precondition : ` ( startIndex . . . endIndex ) . contains ( bounds . lowerBound ) ` <nl> - / / / and ` ( startIndex . . . endIndex ) . contains ( bounds . upperBound ) ` <nl> + / / / - Parameter bounds : A range of the collection ' s indices . The upper and <nl> + / / / lower bounds of the ` bounds ` range must be valid indices of the <nl> + / / / collection and ` bounds . upperBound ` must be less than the collection ' s <nl> + / / / end index . <nl> public subscript ( bounds : ClosedRange < Bound > ) - > CountableRange < Bound > { <nl> return self [ bounds . lowerBound . . < ( bounds . upperBound . advanced ( by : 1 ) ) ] <nl> } <nl> <nl> - / / / Accesses the subsequence bounded by ` bounds ` . <nl> + / / / Accesses the subsequence bounded by the given range . <nl> / / / <nl> - / / / - Complexity : O ( 1 ) <nl> - / / / - Precondition : ` ( startIndex . . . endIndex ) . contains ( bounds . lowerBound ) ` <nl> - / / / and ` ( startIndex . . . endIndex ) . contains ( bounds . upperBound ) ` <nl> + / / / - Parameter bounds : A range of the collection ' s indices . The upper and <nl> + / / / lower bounds of the ` bounds ` range must be valid indices of the <nl> + / / / collection and ` bounds . upperBound ` must be less than the collection ' s <nl> + / / / end index . <nl> public subscript ( <nl> bounds : CountableClosedRange < Bound > <nl> ) - > CountableRange < Bound > { <nl> extension CountableRange <nl> <nl> / / = = = mmm End 0 - based indexing protection mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - = = = / / <nl> <nl> - / / / An interval over a ` Comparable ` type , from a lower bound up to , but not <nl> - / / / including , an upper bound . Can represent an empty interval . <nl> + / / / A half - open interval over a comparable type , from a lower bound up to , but <nl> + / / / not including , an upper bound . <nl> + / / / <nl> + / / / You create ` Range ` instances by using the half - open range operator ( ` . . < ` ) . <nl> + / / / <nl> + / / / let underFive = 0 . 0 . . < 5 . 0 <nl> + / / / <nl> + / / / You can use a ` Range ` instance to quickly check if a value is contained in <nl> + / / / a particular range of values . For example : <nl> / / / <nl> - / / / Use a ` Range ` to quickly check if a ` Comparable ` value is contained in a <nl> - / / / particular range of values . For example : <nl> + / / / print ( underFive . contains ( 3 . 14 ) ) / / Prints " true " <nl> + / / / print ( underFive . contains ( 6 . 28 ) ) / / Prints " false " <nl> + / / / print ( underFive . contains ( 5 . 0 ) ) / / Prints " false " <nl> / / / <nl> - / / / let underFive : Range = 0 . 0 . . < 5 . 0 <nl> - / / / underFive . contains ( 3 . 14 ) / / true <nl> - / / / underFive . contains ( 6 . 28 ) / / false <nl> - / / / underFive . contains ( 5 . 0 ) / / false <nl> + / / / ` Range ` instances can represent an empty interval , unlike ` ClosedRange ` . <nl> + / / / <nl> + / / / let empty = 0 . 0 . . < 0 . 0 <nl> + / / / print ( empty . contains ( 0 . 0 ) ) / / Prints " false " <nl> + / / / print ( empty . isEmpty ) / / Prints " true " <nl> + / / / <nl> + / / / - SeeAlso : ` CountableRange ` , ` ClosedRange ` , ` CountableClosedRange ` <nl> @ _fixed_layout <nl> public struct Range < <nl> Bound : Comparable <nl> > { <nl> - / / / Creates a range with ` lowerBound = = lower ` and ` upperBound = = upper ` . <nl> + / / / Creates an instance with the given bounds . <nl> / / / <nl> - / / / - Note : As this initializer does not check its precondition , it should be <nl> - / / / used as an optimization only , when one is absolutely certain that <nl> - / / / ` lower < = upper ` . Using the ` . . < ` operator to form ` Range ` instances <nl> - / / / is preferred . <nl> - / / / - Precondition : ` lower < = upper ` <nl> + / / / Because this initializer does not perform any checks , it should be used <nl> + / / / as an optimization only when you are absolutely certain that ` lower ` is <nl> + / / / less than or equal to ` upper ` . Using the half - open range operator <nl> + / / / ( ` . . < ` ) to form ` Range ` instances is preferred . <nl> + / / / <nl> + / / / - Parameter bounds : A tuple of the lower and upper bounds of the range . <nl> @ inline ( __always ) <nl> public init ( uncheckedBounds bounds : ( lower : Bound , upper : Bound ) ) { <nl> self . lowerBound = bounds . lower <nl> public struct Range < <nl> <nl> / / / The range ' s lower bound . <nl> / / / <nl> - / / / Identical to ` upperBound ` in an empty range . <nl> + / / / In an empty range , ` lowerBound ` is equal to ` upperBound ` . <nl> public let lowerBound : Bound <nl> <nl> / / / The range ' s upper bound . <nl> / / / <nl> - / / / Identical to ` lowerBound ` in an empty range . A ` Range ` instance <nl> - / / / does not contain its ` upperBound ` . <nl> + / / / In an empty range , ` upperBound ` is equal to ` lowerBound ` . A ` Range ` <nl> + / / / instance does not contain its upper bound . <nl> public let upperBound : Bound <nl> <nl> - / / / Returns ` true ` iff ` element ` is between ` lowerBound ` and ` upperBound ` or <nl> - / / / equal to ` lowerBound ` . A ` Range ` instance does not contain its <nl> - / / / ` upperBound ` . <nl> + / / / Returns a Boolean value indicating whether the given element is contained <nl> + / / / within the range . <nl> + / / / <nl> + / / / Because ` Range ` represents a half - open range , a ` Range ` instance does not <nl> + / / / contain its upper bound . ` element ` is contained in the range if it is <nl> + / / / greater than or equal to the lower bound and less than the upper bound . <nl> + / / / <nl> + / / / - Parameter element : The element to check for containment . <nl> + / / / - Returns : ` true ` if ` element ` is contained in the range ; otherwise , <nl> + / / / ` false ` . <nl> @ warn_unused_result <nl> public func contains ( _ element : Bound ) - > Bool { <nl> return lowerBound < = element & & element < upperBound <nl> } <nl> <nl> - / / / Returns ` true ` iff ` self . contains ( x ) ` is ` false ` for all values of ` x ` . <nl> + / / / A Boolean value indicating whether the range contains no elements . <nl> + / / / <nl> + / / / An empty ` Range ` instance has equal lower and upper bounds . <nl> + / / / <nl> + / / / let empty : Range = 10 . . < 10 <nl> + / / / print ( empty . isEmpty ) <nl> + / / / / / Prints " true " <nl> public var isEmpty : Bool { <nl> return lowerBound = = upperBound <nl> } <nl> all_range_types = [ <nl> ( ' ClosedRange ' , ' . . . ' ) , <nl> ( ' CountableClosedRange ' , ' . . . ' ) <nl> ] <nl> + <nl> + def get_init_warning ( Self , OtherSelf ) : <nl> + if ' Closed ' in Self and ' Closed ' not in OtherSelf : <nl> + return " " " \ <nl> + / / / <nl> + / / / An equivalent range must be representable as an instance of ` % s ` . <nl> + / / / For example , passing an empty range as ` other ` triggers a runtime error , <nl> + / / / because an empty range cannot be represented by a ` % s ` instance . \ <nl> + " " " % ( Self , Self ) <nl> + elif ' Closed ' not in Self and ' Closed ' in OtherSelf : <nl> + return " " " \ <nl> + / / / <nl> + / / / An equivalent range must be representable as an instance of ` % s ` . <nl> + / / / For example , passing a closed range with an upper bound of ` Int . max ` <nl> + / / / triggers a runtime error , because the resulting half - open range would <nl> + / / / require an upper bound of ` Int . max + 1 ` , which is not representable as <nl> + / / / an ` Int ` . \ <nl> + " " " % Self <nl> + else : <nl> + return " " <nl> } % <nl> <nl> % for ( Self , op ) in all_range_types : <nl> extension $ { Self } <nl> Bound : _Strideable , Bound . Stride : SignedInteger <nl> % end <nl> { <nl> - / / / Creates an instance equivalent to ` other ` . <nl> + / / / Creates an instance equivalent to the given range . <nl> + $ { get_init_warning ( Self , OtherSelf ) } <nl> / / / <nl> - / / / - Precondition : an equivalent range is representable as an <nl> - / / / instance of ` Self ` . For example , ` Range ( 0 . . . Int . max ) ` <nl> - / / / violates this precondition because an equivalent ` Range < Int > ` <nl> - / / / would need an ` upperBound ` equal to ` Int . max + 1 ` , which <nl> - / / / is unrepresentable as an ` Int ` . <nl> + / / / - Parameter other : A range to convert to a ` $ { Self } ` instance . <nl> @ inline ( __always ) <nl> public init ( _ other : $ { OtherSelf } < Bound > ) { <nl> % if ' Closed ' not in Self and ' Closed ' in OtherSelf : <nl> extension $ { Self } <nl> Bound : _Strideable , Bound . Stride : SignedInteger <nl> % end <nl> { <nl> - / / / Returns ` true ` iff ` self ` and ` other ` contain a value in common . <nl> + / / / Returns a Boolean value indicating whether this range and the given range <nl> + / / / contain an element in common . <nl> + / / / <nl> + / / / For example : <nl> + / / / <nl> + / / / let x : $ { Self } = 0 $ { op } 20 <nl> + / / / print ( x . overlaps ( 10 $ { other_op } 1000 as $ { OtherSelf } ) ) <nl> + / / / / / Prints " true " <nl> + / / / <nl> + / / / - Parameter other : A range to check for elements in common . <nl> + / / / - Returns : ` true ` if this range and ` other ` have at least one element in <nl> + / / / common ; otherwise , ` false ` . <nl> @ warn_unused_result <nl> @ inline ( __always ) <nl> public func overlaps ( _ other : $ { OtherSelf } < Bound > ) - > Bool { <nl> extension $ { Self } <nl> % end <nl> <nl> extension $ { Self } { <nl> - / / / Returns ` self ` clamped to ` limits ` . <nl> + / / / Returns a copy of this range clamped to the given limiting range . <nl> + / / / <nl> + / / / The bounds of the result are always limited to the bounds of ` limits ` . <nl> + / / / For example : <nl> / / / <nl> - / / / The bounds of the result , even if it is empty , are always <nl> - / / / limited to the bounds of ` limits ` . <nl> + / / / let x : $ { Self } = 0 $ { op } 20 <nl> + / / / print ( x . clamped ( to : 10 $ { op } 1000 ) ) <nl> + / / / / / Prints " 10 $ { op } 20 " <nl> + / / / <nl> + % if ' Closed ' in Self : <nl> + / / / If the two ranges do not overlap , the result is a single - element range at <nl> + / / / the upper or lower bound of ` limits ` . <nl> + % else : <nl> + / / / If the two ranges do not overlap , the result is an empty range within the <nl> + / / / bounds of ` limits ` . <nl> + % end <nl> + / / / <nl> + / / / let y : $ { Self } = 0 $ { op } 5 <nl> + / / / print ( y . clamped ( to : 10 $ { op } 1000 ) ) <nl> + / / / / / Prints " 10 $ { op } 10 " <nl> + / / / <nl> + / / / - Parameter limits : The range to clamp the bounds of this range . <nl> + / / / - Returns : A new range clamped to the bounds of ` limits ` . <nl> @ warn_unused_result <nl> @ inline ( __always ) <nl> public func clamped ( to limits : $ { Self } ) - > $ { Self } { <nl> extension $ { Self } { <nl> } <nl> <nl> extension $ { Self } : CustomStringConvertible { <nl> - / / / A textual representation of ` self ` . <nl> + / / / A textual representation of the range . <nl> public var description : String { <nl> return " \ ( lowerBound ) $ { op } \ ( upperBound ) " <nl> } <nl> } <nl> <nl> extension $ { Self } : CustomDebugStringConvertible { <nl> - / / / A textual representation of ` self ` , suitable for debugging . <nl> + / / / A textual representation of the range , suitable for debugging . <nl> public var debugDescription : String { <nl> return " $ { Self } ( \ ( String ( reflecting : lowerBound ) ) " <nl> + " $ { op } \ ( String ( reflecting : upperBound ) ) ) " <nl> extension $ { Self } where Bound : _Strideable , Bound . Stride : SignedInteger { <nl> } <nl> % end <nl> <nl> - / / / Returns a half - open range that contains ` minimum ` , but not <nl> - / / / ` maximum ` . <nl> + / / / Returns a half - open range that contains its lower bound but not its upper <nl> + / / / bound . <nl> + / / / <nl> + / / / For example : <nl> + / / / <nl> + / / / let lessThanFive = 0 . 0 . . < 5 . 0 <nl> + / / / print ( lessThanFive . contains ( 3 . 14 ) ) / / Prints " true " <nl> + / / / print ( lessThanFive . contains ( 5 . 0 ) ) / / Prints " false " <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - minimum : The lower bound for the range . <nl> + / / / - maximum : The upper bound for the range . <nl> @ _transparent <nl> @ warn_unused_result <nl> public func . . < < Bound : Comparable > ( minimum : Bound , maximum : Bound ) <nl> public func . . < < Bound : Comparable > ( minimum : Bound , maximum : Bound ) <nl> return Range ( uncheckedBounds : ( lower : minimum , upper : maximum ) ) <nl> } <nl> <nl> - / / / Returns a half - open range that contains ` minimum ` , but not ` maximum ` . <nl> + / / / Returns a countable half - open range that contains its lower bound but not <nl> + / / / its upper bound . <nl> + / / / <nl> + / / / For example : <nl> + / / / <nl> + / / / let upToFive = 0 . . < 5 <nl> + / / / print ( upToFive . contains ( 3 ) ) / / Prints " true " <nl> + / / / print ( upToFive . contains ( 5 ) ) / / Prints " false " <nl> / / / <nl> - / / / - Precondition : ` minimum < = maximum ` . <nl> + / / / - Parameters : <nl> + / / / - minimum : The lower bound for the range . <nl> + / / / - maximum : The upper bound for the range . <nl> @ _transparent <nl> @ warn_unused_result <nl> / / WORKAROUND rdar : / / 25214598 - should be just Bound : Strideable <nl> mmm a / stdlib / public / core / RangeReplaceableCollection . swift . gyb <nl> ppp b / stdlib / public / core / RangeReplaceableCollection . swift . gyb <nl> <nl> <nl> / / FIXME : swift - 3 - indexing - model : synchronize Indexable with the actual <nl> / / protocol . <nl> + / / / A type that supports replacement of an arbitrary subrange of elements with <nl> + / / / the elements of another collection . <nl> + / / / <nl> + / / / In most cases , it ' s best to ignore this protocol and use the <nl> + / / / ` RangeRepleaceableCollection ` protocol instead , because it has a more <nl> + / / / complete interface . <nl> public protocol RangeReplaceableIndexable : Indexable { <nl> / / FIXME ( ABI ) ( compiler limitation ) : there is no reason for this protocol <nl> / / to exist apart from missing compiler features that we emulate with it . <nl> public protocol RangeReplaceableIndexable : Indexable { <nl> / / / Creates an empty instance . <nl> init ( ) <nl> <nl> - / / / Creates an instance of ` count ` elements , each initialized to <nl> - / / / ` repeatedValue ` . <nl> + / / / Creates a new collection containing the specified number of a single , <nl> + / / / repeated value . <nl> + / / / <nl> + / / / Here ' s an example of creating an array initialized with five strings <nl> + / / / containing the letter * Z * . <nl> + / / / <nl> + / / / let fiveZs = Array ( repeating : " Z " , count : 5 ) <nl> + / / / print ( fiveZs ) <nl> + / / / / / Prints " [ " Z " , " Z " , " Z " , " Z " , " Z " ] " <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - repeatedValue : The element to repeat . <nl> + / / / - count : The number of times to repeat the value passed in the <nl> + / / / ` repeating ` parameter . ` count ` must be zero or greater . <nl> init ( repeating repeatedValue : _Element , count : Int ) <nl> <nl> - / / / Creates an instance containing ` elements ` . <nl> + / / / Creates a new instance of a collection containing the elements of a <nl> + / / / sequence . <nl> + / / / <nl> + / / / - Parameter elements : The sequence of elements for the new collection . <nl> + / / / ` elements ` must be finite . <nl> init < <nl> S : Sequence where S . Iterator . Element = = _Element <nl> > ( _ elements : S ) <nl> <nl> - / / / Replaces the given ` subrange ` of elements with ` newElements ` . <nl> + / / / Replaces the specified subrange of elements with the given collection . <nl> / / / <nl> - / / / Invalidates all indices with respect to ` self ` . <nl> + / / / This method has the effect of removing the specified range of elements <nl> + / / / from the collection and inserting the new elements at the same location . <nl> + / / / The number of new elements need not match the number of elements being <nl> + / / / removed . <nl> / / / <nl> - / / / - Complexity : O ( ` subRange . count ` ) if <nl> - / / / ` subRange . upperBound = = self . endIndex ` and ` newElements . isEmpty ` , <nl> - / / / O ( ` self . count ` + ` newElements . count ` ) otherwise . <nl> + / / / In this example , three elements in the middle of an array of integers are <nl> + / / / replaced by the five elements of a ` Repeated < Int > ` instance . <nl> + / / / <nl> + / / / var nums = [ 10 , 20 , 30 , 40 , 50 ] <nl> + / / / nums . replaceSubrange ( 1 . . . 3 , with : repeatElement ( 1 , count : 5 ) ) <nl> + / / / print ( nums ) <nl> + / / / / / Prints " [ 10 , 1 , 1 , 1 , 1 , 1 , 50 ] " <nl> + / / / <nl> + / / / If you pass a zero - length range as the ` subrange ` parameter , this method <nl> + / / / inserts the elements of ` newElements ` at ` subrange . startIndex ` . Calling <nl> + / / / the ` insert ( contentsOf : at : ) ` method instead is preferred . <nl> + / / / <nl> + / / / Likewise , if you pass a zero - length collection as the ` newElements ` <nl> + / / / parameter , this method removes the elements in the given subrange <nl> + / / / without replacement . Calling the ` removeSubrange ( _ : ) ` method instead is <nl> + / / / preferred . <nl> + / / / <nl> + / / / Calling this method may invalidate any existing indices for use with this <nl> + / / / collection . <nl> + / / / <nl> + / / / - Parameters : <nl> + / / / - subrange : The subrange of the collection to replace . The bounds of <nl> + / / / the range must be valid indices of the collection . <nl> + / / / - newElements : The new elements to add to the collection . <nl> + / / / <nl> + / / / - Complexity : O ( * m * ) , where * m * is the combined length of the collection <nl> + / / / and ` newElements ` . If the call to ` replaceSubrange ` simply appends the <nl> + / / / contents of ` newElements ` to the collection , the complexity is O ( * n * ) , <nl> + / / / where * n * is the length of ` newElements ` . <nl> mutating func replaceSubrange < <nl> C : Collection where C . Iterator . Element = = _Element <nl> > ( <nl> _ subrange : Range < Index > , with newElements : C <nl> ) <nl> <nl> - / / / Inserts ` newElement ` at index ` i ` . <nl> + / / / Inserts a new element into the collection at the specified position . <nl> + / / / <nl> + / / / The new element is inserted before the element currently at the <nl> + / / / specified index . If you pass the collection ' s ` endIndex ` property as <nl> + / / / the ` index ` parameter , the new element is appended to the <nl> + / / / collection . <nl> + / / / <nl> + / / / var numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> + / / / numbers . insert ( 100 , at : 3 ) <nl> + / / / numbers . insert ( 200 , at : numbers . endIndex ) <nl> + / / / <nl> + / / / print ( numbers ) <nl> + / / / / / Prints " [ 1 , 2 , 3 , 100 , 4 , 5 , 200 ] " <nl> + / / / <nl> + / / / Calling this method may invalidate any existing indices for use with this <nl> + / / / collection . <nl> / / / <nl> - / / / Invalidates all indices with respect to ` self ` . <nl> + / / / - Parameter newElement : The new element to insert into the collection . <nl> + / / / - Parameter i : The position at which to insert the new element . <nl> + / / / ` index ` must be a valid index into the collection . <nl> / / / <nl> - / / / - Complexity : O ( ` self . count ` ) . <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> mutating func insert ( _ newElement : _Element , at i : Index ) <nl> <nl> - / / / Inserts ` newElements ` at index ` i ` . <nl> + / / / Inserts the elements of a sequence into the collection at the specified <nl> + / / / position . <nl> / / / <nl> - / / / Invalidates all indices with respect to ` self ` . <nl> + / / / The new elements are inserted before the element currently at the <nl> + / / / specified index . If you pass the collection ' s ` endIndex ` property as the <nl> + / / / ` index ` parameter , the new elements are appended to the collection . <nl> / / / <nl> - / / / - Complexity : O ( ` self . count + newElements . count ` ) . <nl> + / / / Here ' s an example of inserting a range of integers into an array of the <nl> + / / / same type : <nl> + / / / <nl> + / / / var numbers = [ 1 , 2 , 3 , 4 , 5 ] <nl> + / / / numbers . insert ( contentsOf : 100 . . . 103 , at : 3 ) <nl> + / / / print ( numbers ) <nl> + / / / / / Prints " [ 1 , 2 , 3 , 100 , 101 , 102 , 103 , 4 , 5 ] " <nl> + / / / <nl> + / / / Calling this method may invalidate any existing indices for use with this <nl> + / / / collection . <nl> + / / / <nl> + / / / - Parameter newElements : The new elements to insert into the collection . <nl> + / / / - Parameter i : The position at which to insert the new elements . ` index ` <nl> + / / / must be a valid index of the collection . <nl> + / / / <nl> + / / / - Complexity : O ( * m * ) , where * m * is the combined length of the collection <nl> + / / / and ` newElements ` . If ` i ` is equal to the collection ' s ` endIndex ` <nl> + / / / property , the complexity is O ( * n * ) , where * n * is the length of <nl> + / / / ` newElements ` . <nl> mutating func insert < <nl> S : Collection where S . Iterator . Element = = _Element <nl> > ( contentsOf newElements : S , at i : Index ) <nl> <nl> - / / / Removes the element at index ` i ` . <nl> + / / / Removes and returns the element at the specified position . <nl> + / / / <nl> + / / / All the elements following the specified position are moved to close the <nl> + / / / gap . This example removes the middle element from an array of <nl> + / / / measurements . <nl> + / / / <nl> + / / / var measurements = [ 1 . 2 , 1 . 5 , 2 . 9 , 1 . 2 , 1 . 6 ] <nl> + / / / let removed = measurements . remove ( at : 2 ) <nl> + / / / print ( measurements ) <nl> + / / / / / Prints " [ 1 . 2 , 1 . 5 , 1 . 2 , 1 . 6 ] " <nl> + / / / <nl> + / / / Calling this method may invalidate any existing indices for use with this <nl> + / / / collection . <nl> / / / <nl> - / / / Invalidates all indices with respect to ` self ` . <nl> + / / / - Parameter i : The position of the element to remove . ` index ` must be <nl> + / / / a valid index of the collection that is not equal to the collection ' s <nl> + / / / end index . <nl> + / / / - Returns : The removed element . <nl> / / / <nl> - / / / - Complexity : O ( ` self . count ` ) . <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> @ discardableResult <nl> mutating func remove ( at i : Index ) - > _Element <nl> <nl> - / / / Removes all elements within ` bounds ` . <nl> + / / / Removes the specified subrange of elements from the collection . <nl> / / / <nl> - / / / Invalidates all indices with respect to ` self ` . <nl> + / / / var bugs = [ " Aphid " , " Bumblebee " , " Cicada " , " Damselfly " , " Earwig " ] <nl> + / / / bugs . removeSubrange ( 1 . . . 3 ) <nl> + / / / print ( bugs ) <nl> + / / / / / Prints " [ " Aphid " , " Earwig " ] " <nl> / / / <nl> - / / / - Complexity : O ( ` self . count ` ) . <nl> + / / / Calling this method may invalidate any existing indices for use with this <nl> + / / / collection . <nl> + / / / <nl> + / / / - Parameter bounds : The subrange of the collection to remove . The bounds <nl> + / / / of the range must be valid indices of the collection . <nl> + / / / <nl> + / / / - Complexity : O ( * n * ) , where * n * is the length of the collection . <nl> mutating func removeSubrange ( _ bounds : Range < Index > ) <nl> } <nl> <nl> public protocol RangeReplaceableIndexable : Indexable { <nl> / / / Lastly , use the eponymous ` replaceSubrange ( _ : with : ) ` method to replace <nl> / / / a subrange of elements with the contents of another collection . Here , <nl> / / / three elements in the middle of an array of integers are replaced by the <nl> - / / / five elements of a ` Repeat < Int > ` instance . <nl> + / / / five elements of a ` Repeated < Int > ` instance . <nl> / / / <nl> / / / var nums = [ 10 , 20 , 30 , 40 , 50 ] <nl> - / / / nums . replaceSubrange ( 1 . . . 3 , with : Repeat ( count : 5 , repeatedValue : 1 ) ) ) <nl> + / / / nums . replaceSubrange ( 1 . . . 3 , with : repeatElement ( 1 , count : 5 ) ) <nl> / / / print ( nums ) <nl> / / / / / Prints " [ 10 , 1 , 1 , 1 , 1 , 1 , 50 ] " <nl> / / / <nl> public protocol RangeReplaceableCollection <nl> / / / removed . <nl> / / / <nl> / / / In this example , three elements in the middle of an array of integers are <nl> - / / / replaced by the five elements of a ` Repeat < Int > ` instance . <nl> + / / / replaced by the five elements of a ` Repeated < Int > ` instance . <nl> / / / <nl> / / / var nums = [ 10 , 20 , 30 , 40 , 50 ] <nl> - / / / nums . replaceSubrange ( 1 . . . 3 , with : Repeat ( count : 5 , repeatedValue : 1 ) ) ) <nl> + / / / nums . replaceSubrange ( 1 . . . 3 , with : repeatElement ( 1 , count : 5 ) ) <nl> / / / print ( nums ) <nl> / / / / / Prints " [ 10 , 1 , 1 , 1 , 1 , 1 , 50 ] " <nl> / / / <nl> public protocol RangeReplaceableCollection <nl> / / / Prepares the collection to store the specified number of elements , when <nl> / / / doing so is appropriate for the underlying type . <nl> / / / <nl> - / / / Use this method to avoid multiple reallocations if you will be adding a <nl> - / / / known number of elements to a collection . A type that conforms to <nl> + / / / If you are adding a known number of elements to a collection , use this <nl> + / / / method to avoid multiple reallocations . A type that conforms to <nl> / / / ` RangeReplaceableCollection ` can choose how to respond when this method <nl> / / / is called . Depending on the type , it may make sense to allocate more or <nl> - / / / less storage than requested or to take no action at all . <nl> + / / / less storage than requested , or to take no action at all . <nl> / / / <nl> / / / - Parameter n : The requested number of elements to store . <nl> mutating func reserveCapacity ( _ n : IndexDistance ) <nl> public protocol RangeReplaceableCollection <nl> / / / Creates a new collection containing the specified number of a single , <nl> / / / repeated value . <nl> / / / <nl> - / / / Here ' s an example of creating an array initialized with five strings <nl> - / / / containing the letter " Z " . <nl> + / / / The following example creates an array initialized with five strings <nl> + / / / containing the letter * Z * . <nl> / / / <nl> / / / let fiveZs = Array ( repeating : " Z " , count : 5 ) <nl> / / / print ( fiveZs ) <nl> public protocol RangeReplaceableCollection <nl> / / / sequence . <nl> / / / <nl> / / / - Parameter elements : The sequence of elements for the new collection . <nl> + / / / ` elements ` must be finite . <nl> init < <nl> S : Sequence where S . Iterator . Element = = Iterator . Element <nl> > ( _ elements : S ) <nl> public protocol RangeReplaceableCollection <nl> / / / print ( numbers ) <nl> / / / / / Prints " [ 1 , 2 , 3 , 4 , 5 , 100 ] " <nl> / / / <nl> - / / / - Parameter x : The element to append to the collection . <nl> + / / / - Parameter newElement : The element to append to the collection . <nl> / / / <nl> / / / - Complexity : O ( 1 ) on average , over many additions to the same <nl> / / / collection . <nl> - mutating func append ( _ x : Iterator . Element ) <nl> + mutating func append ( _ newElement : Iterator . Element ) <nl> <nl> / * <nl> The ' append ( contentsOf : ) ' requirement should be an operator , but the compiler crashes : <nl> extension RangeReplaceableCollection { <nl> / / / repeated value . <nl> / / / <nl> / / / Here ' s an example of creating an array initialized with five strings <nl> - / / / containing the letter " Z " . <nl> + / / / containing the letter * Z * . <nl> / / / <nl> / / / let fiveZs = Array ( repeating : " Z " , count : 5 ) <nl> / / / print ( fiveZs ) <nl> extension RangeReplaceableCollection { <nl> / / / Prepares the collection to store the specified number of elements , when <nl> / / / doing so is appropriate for the underlying type . <nl> / / / <nl> - / / / Use this method to avoid multiple reallocations if you will be adding a <nl> - / / / known number of elements to a collection . A type that conforms to <nl> + / / / If you will be adding a known number of elements to a collection , use <nl> + / / / this method to avoid multiple reallocations . A type that conforms to <nl> / / / ` RangeReplaceableCollection ` can choose how to respond when this method <nl> / / / is called . Depending on the type , it may make sense to allocate more or <nl> / / / less storage than requested or to take no action at all . <nl> extension RangeReplaceableCollection <nl> / / / removed . <nl> / / / <nl> / / / In this example , three elements in the middle of an array of integers are <nl> - / / / replaced by the five elements of a ` Repeat < Int > ` instance . <nl> + / / / replaced by the five elements of a ` Repeated < Int > ` instance . <nl> / / / <nl> / / / var nums = [ 10 , 20 , 30 , 40 , 50 ] <nl> - / / / nums . replaceSubrange ( 1 . . . 3 , with : Repeat ( count : 5 , repeatedValue : 1 ) ) ) <nl> + / / / nums . replaceSubrange ( 1 . . . 3 , with : repeatElement ( 1 , count : 5 ) ) <nl> / / / print ( nums ) <nl> / / / / / Prints " [ 10 , 1 , 1 , 1 , 1 , 1 , 50 ] " <nl> / / / <nl> mmm a / stdlib / public / core / Sequence . swift <nl> ppp b / stdlib / public / core / Sequence . swift <nl> public protocol Sequence { <nl> / / / parameter . <nl> func forEach ( _ body : @ noescape ( Iterator . Element ) throws - > Void ) rethrows <nl> <nl> + / / Note : The complexity of Sequence . dropFirst ( _ : ) requirement <nl> + / / is documented as O ( n ) because Collection . dropFirst ( _ : ) is <nl> + / / implemented in O ( n ) , even though the default <nl> + / / implementation for Sequence . dropFirst ( _ : ) is O ( 1 ) . <nl> / / / Returns a subsequence containing all but the given number of initial <nl> / / / elements . <nl> / / / <nl> public protocol Sequence { <nl> / / / print ( numbers . suffix ( 10 ) ) <nl> / / / / / Prints " [ 1 , 2 , 3 , 4 , 5 ] " <nl> / / / <nl> - / / / - Parameter maxLength : The maximum number of elements to return . Must <nl> - / / / be greater than or equal to zero . <nl> + / / / - Parameter maxLength : The maximum number of elements to return . The <nl> + / / / value of ` maxLength ` must be greater than or equal to zero . <nl> / / / - Returns : A subsequence terminating at the end of this sequence with <nl> / / / at most ` maxLength ` elements . <nl> / / / <nl> extension Sequence { <nl> / / / print ( numbers . suffix ( 10 ) ) <nl> / / / / / Prints " [ 1 , 2 , 3 , 4 , 5 ] " <nl> / / / <nl> - / / / - Parameter maxLength : The maximum number of elements to return . Must be <nl> - / / / greater than or equal to zero . <nl> + / / / - Parameter maxLength : The maximum number of elements to return . The <nl> + / / / value of ` maxLength ` must be greater than or equal to zero . <nl> / / / - Complexity : O ( * n * ) , where * n * is the length of the sequence . <nl> @ warn_unused_result <nl> public func suffix ( _ maxLength : Int ) - > AnySequence < Iterator . Element > { <nl> extension Sequence where Iterator . Element : Equatable { <nl> / / / split the sequence are not returned as part of any subsequence . <nl> / / / <nl> / / / The following examples show the effects of the ` maxSplits ` and <nl> - / / / ` omittingEmptySubsequences ` parameters when splitting a string splitting <nl> - / / / a string at each space character ( " " ) . The first use of ` split ` returns <nl> - / / / each word that was originally separated by one or more spaces . <nl> + / / / ` omittingEmptySubsequences ` parameters when splitting a string at each <nl> + / / / space character ( " " ) . The first use of ` split ` returns each word that <nl> + / / / was originally separated by one or more spaces . <nl> / / / <nl> / / / let line = " BLANCHE : I don ' t want realism . I want magic ! " <nl> / / / print ( line . characters . split ( separator : " " ) <nl> extension Sequence where <nl> / / / - Returns : A subsequence starting after the specified number of <nl> / / / elements . <nl> / / / <nl> - / / / - Complexity : O ( * n * ) , where * n * is the number of elements to drop from <nl> - / / / the beginning of the sequence . <nl> + / / / - Complexity : O ( 1 ) . <nl> @ warn_unused_result <nl> public func dropFirst ( _ n : Int ) - > AnySequence < Iterator . Element > { <nl> _precondition ( n > = 0 , " Can ' t drop a negative number of elements from a sequence " ) <nl> extension Sequence where <nl> / / / print ( numbers . prefix ( 10 ) ) <nl> / / / / / Prints " [ 1 , 2 , 3 , 4 , 5 ] " <nl> / / / <nl> - / / / - Parameter maxLength : The maximum number of elements to return . Must <nl> - / / / be greater than or equal to zero . <nl> + / / / - Parameter maxLength : The maximum number of elements to return . The <nl> + / / / value of ` maxLength ` must be greater than or equal to zero . <nl> / / / - Returns : A subsequence starting at the beginning of this sequence <nl> / / / with at most ` maxLength ` elements . <nl> / / / <nl> mmm a / stdlib / public / core / SetAlgebra . swift <nl> ppp b / stdlib / public / core / SetAlgebra . swift <nl> public protocol SetAlgebra : Equatable , ArrayLiteralConvertible { <nl> @ warn_unused_result <nl> func symmetricDifference ( _ other : Self ) - > Self <nl> <nl> - / / / If ` newMember ` is not already contained in ` self ` , inserts it . <nl> + / / / Inserts the given element in the set if it is not already present . <nl> / / / <nl> - / / / If the element is already contained in the set , this method has no <nl> - / / / effect . In this example , a new element is inserted into ` classDays ` , a <nl> - / / / set of days of the week . When an existing element is inserted , the <nl> - / / / ` classDays ` set does not change . <nl> + / / / If an element equal to ` newMember ` is already contained in the set , this <nl> + / / / method has no effect . In this example , a new element is inserted into <nl> + / / / ` classDays ` , a set of days of the week . When an existing element is <nl> + / / / inserted , the ` classDays ` set does not change . <nl> / / / <nl> / / / enum DayOfTheWeek : Int { <nl> / / / case sunday , monday , tuesday , wednesday , thursday , <nl> public protocol SetAlgebra : Equatable , ArrayLiteralConvertible { <nl> / / / print ( classDays ) <nl> / / / / / Prints " [ . friday , . wednesday , . monday ] " <nl> / / / <nl> - / / / - Returns : ` ( true , newMember ) ` if ` newMember ` was not contained in <nl> - / / / ` self ` . Otherwise , returns ` ( false , oldMember ) ` , where ` oldMember ` is <nl> - / / / the member of ` self ` equal to ` newMember ` ( which may be <nl> - / / / distinguishable from ` newMember ` , e . g . via ` = = = ` ) . <nl> - / / / <nl> - / / / - Postcondition : ` self . contains ( newMember ) ` . <nl> + / / / - Parameter newMember : An element to insert into the set . <nl> + / / / - Returns : ` ( true , newMember ) ` if ` newMember ` was not contained in the <nl> + / / / set . If an element equal to ` newMember ` was already contained in the <nl> + / / / set , the method returns ` ( false , oldMember ) ` , where ` oldMember ` is the <nl> + / / / element that was equal to ` newMember ` . In some cases , ` oldMember ` may <nl> + / / / be distinguishable from ` newMember ` by identity comparison or some <nl> + / / / other means . <nl> @ discardableResult <nl> mutating func insert ( <nl> _ newMember : Element <nl> ) - > ( inserted : Bool , memberAfterInsert : Element ) <nl> <nl> - / / / If ` self ` intersects ` [ e ] ` , removes and returns an element ` r ` <nl> - / / / such that ` self . intersection ( [ e ] ) = = [ r ] ` ; returns ` nil ` <nl> - / / / otherwise . <nl> + / / / Removes the given element and any elements subsumed by the given element . <nl> / / / <nl> - / / / - Note : for ordinary sets where ` Self ` is not the same type as <nl> - / / / ` Element ` , ` s . remove ( e ) ` removes and returns an element equal <nl> - / / / to ` e ` ( which may be distinguishable from ` e ` , e . g . via <nl> - / / / ` = = = ` ) , or returns ` nil ` if no such element existed . <nl> + / / / - Parameter member : The element of the set to remove . <nl> + / / / - Returns : For ordinary sets , an element equal to ` member ` if ` member ` is <nl> + / / / contained in the set ; otherwise , ` nil ` . In some cases , a returned <nl> + / / / element may be distinguishable from ` newMember ` by identity comparison <nl> + / / / or some other means . <nl> / / / <nl> - / / / - Postcondition : ` self . intersection ( [ e ] ) . isEmpty ` <nl> + / / / For sets where the set type and element type are the same , like <nl> + / / / ` OptionSet ` types , this method returns any intersection between the set <nl> + / / / and ` [ member ] ` , or ` nil ` if the intersection is empty . <nl> @ discardableResult <nl> - mutating func remove ( _ e : Element ) - > Element ? <nl> + mutating func remove ( _ member : Element ) - > Element ? <nl> <nl> - / / / Inserts ` e ` unconditionally . <nl> + / / / Inserts the given element into the set unconditionally . <nl> + / / / <nl> + / / / If an element equal to ` newMember ` is already contained in the set , <nl> + / / / ` newMember ` replaces the existing element . In this example , an existing <nl> + / / / element is inserted into ` classDays ` , a set of days of the week . <nl> + / / / <nl> + / / / enum DayOfTheWeek : Int { <nl> + / / / case sunday , monday , tuesday , wednesday , thursday , <nl> + / / / friday , saturday <nl> + / / / } <nl> / / / <nl> - / / / - Returns : a former member ` r ` of ` self ` such that <nl> - / / / ` self . intersection ( [ e ] ) = = [ r ] ` if ` self . intersection ( [ e ] ) ` was <nl> - / / / non - empty . Returns ` nil ` otherwise . <nl> + / / / var classDays : Set < DayOfTheWeek > = [ . monday , . wednesday , . friday ] <nl> + / / / print ( classDays . update ( with : . monday ) ) <nl> + / / / / / Prints " Optional ( . monday ) " <nl> / / / <nl> - / / / - Note : for ordinary sets where ` Self ` is not the same type as <nl> - / / / ` Element ` , ` s . update ( with : e ) ` returns an element equal <nl> - / / / to ` e ` ( which may be distinguishable from ` e ` , e . g . via <nl> - / / / ` = = = ` ) , or returns ` nil ` if no such element existed . <nl> + / / / - Parameter newMember : An element to insert into the set . <nl> + / / / - Returns : For ordinary sets , an element equal to ` newMember ` if the set <nl> + / / / already contained such a member ; otherwise , ` nil ` . In some cases , the <nl> + / / / returned element may be distinguishable from ` newMember ` by identity <nl> + / / / comparison or some other means . <nl> / / / <nl> - / / / - Postcondition : ` self . contains ( e ) ` <nl> + / / / For sets where the set type and element type are the same , like <nl> + / / / ` OptionSet ` types , this method returns any intersection between the <nl> + / / / set and ` [ newMember ] ` , or ` nil ` if the intersection is empty . <nl> @ discardableResult <nl> - mutating func update ( with e : Element ) - > Element ? <nl> + mutating func update ( with newMember : Element ) - > Element ? <nl> <nl> / / / Adds the elements of the given set to the set . <nl> / / / <nl> extension SetAlgebra { <nl> / / / strings : <nl> / / / <nl> / / / let ingredients : Set = [ " cocoa beans " , " sugar " , " cocoa butter " , " salt " ] <nl> - / / / if ingredients . isSupersetOf ( [ " sugar " , " salt " ] ) { <nl> + / / / if ingredients . isSuperset ( of : [ " sugar " , " salt " ] ) { <nl> / / / print ( " Whatever it is , it ' s bound to be delicious ! " ) <nl> / / / } <nl> / / / / / Prints " Whatever it is , it ' s bound to be delicious ! " <nl> mmm a / stdlib / public / core / Slice . swift . gyb <nl> ppp b / stdlib / public / core / Slice . swift . gyb <nl> from gyb_stdlib_support import ( <nl> <nl> def get_slice_doc_comment ( Self ) : <nl> return " " " \ <nl> - / / / A view into a sub - sequence of elements of another collection . <nl> + / / / A view into a subsequence of elements of another collection . <nl> / / / <nl> - / / / A ` % s ` instance stores the base collection , the start and end indices of <nl> - / / / the view . It does not copy the elements from the collection into separate <nl> - / / / storage . Thus , creating a slice has ` O ( 1 ) ` complexity . <nl> + / / / A slice stores a base collection and the start and end indices of the view . <nl> + / / / It does not copy the elements from the collection into separate storage . <nl> + / / / Thus , creating a slice has O ( 1 ) complexity . <nl> / / / <nl> - / / / A ` % s ` instance inherits the value or reference semantics of the base <nl> - / / / collection . That is , if a ` % s ` instance is wrapped around a mutable <nl> - / / / collection that has value semantics ( for example , ` Array ` ) , mutating the <nl> - / / / original collection would not affect the copy stored inside of the slice . <nl> + / / / Slices Share Indices <nl> + / / / mmmmmmmmmmmmmmmmmm - - <nl> / / / <nl> - / / / An element of a slice is located under the same index in the slice and in <nl> - / / / the base collection , as long as neither the collection or the slice were <nl> - / / / mutated . Thus , indices of a slice can be used interchangeably with indices <nl> - / / / of the base collection . <nl> + / / / Indices of a slice can be used interchangeably with indices of the base <nl> + / / / collection . An element of a slice is located under the same index in the <nl> + / / / slice and in the base collection , as long as neither the collection nor <nl> + / / / the slice has been mutated since the slice was created . <nl> / / / <nl> - / / / - Warning : Long - term storage of ` % s ` instances is discouraged . <nl> + / / / For example , suppose you have an array holding the number of absences from <nl> + / / / each class during a session . <nl> / / / <nl> - / / / Because a ` % s ` presents a * view * onto the storage of some larger <nl> - / / / collection even after the original collection goes out of scope , storing <nl> - / / / the slice may prolong the lifetime of elements that are no longer <nl> - / / / accessible , which can manifest as apparent memory and object leakage . To <nl> - / / / prevent this effect , use slices only for transient computation . \ <nl> - " " " % ( Self , Self , Self , Self , Self ) <nl> + / / / var absences = [ 0 , 2 , 0 , 4 , 0 , 3 , 1 , 0 ] <nl> + / / / <nl> + / / / You ' re tasked with finding the day with the most absences in the second <nl> + / / / half of the session . To find the index of the day in question , follow <nl> + / / / these setps : <nl> + / / / <nl> + / / / 1 ) Create a slice of the ` absences ` array that holds the second half of the <nl> + / / / days . <nl> + / / / 2 ) Use the ` max ( isOrderedBefore : ) ` method to determine the index of the day <nl> + / / / with the most absences . <nl> + / / / 3 ) Print the result using the index found in step 2 on the original <nl> + / / / ` absences ` array . <nl> + / / / <nl> + / / / Here ' s an implementation of those steps : <nl> + / / / <nl> + / / / let secondHalf = absences . suffix ( absences . count / 2 ) <nl> + / / / if let i = secondHalf . indices . max ( isOrderedBefore : { secondHalf [ $ 0 ] < secondHalf [ $ 1 ] } ) { <nl> + / / / print ( " Highest second - half absences : \ ( absences [ i ] ) " ) <nl> + / / / } <nl> + / / / / / Prints " Highest second - half absences : 3 " <nl> + / / / <nl> + / / / Slices Inherit Semantics <nl> + / / / mmmmmmmmmmmmmmmmmmmmmmmm <nl> + / / / <nl> + / / / A slice inherits the value or reference semantics of its base collection . <nl> + / / / That is , if a ` % ( SliceType ) s ` instance is wrapped around a mutable <nl> + / / / collection that has value semantics , such as an array , mutating the <nl> + / / / original collection would trigger a copy of that collection , and not <nl> + / / / affect the base collection stored inside of the slice . <nl> + / / / <nl> + / / / For example , if you update the last element of the ` absences ` array from <nl> + / / / ` 0 ` to ` 2 ` , the ` secondHalf ` slice is unchanged . <nl> + / / / <nl> + / / / absences [ 7 ] = 2 <nl> + / / / print ( absences ) <nl> + / / / / / Prints " [ 0 , 2 , 0 , 4 , 0 , 3 , 1 , 2 ] " <nl> + / / / print ( secondHalf ) <nl> + / / / / / Prints " [ 0 , 3 , 1 , 0 ] " <nl> + / / / <nl> + / / / - Important : Use slices only for transient computation . <nl> + / / / A slice may hold a reference to the entire storage of a larger <nl> + / / / collection , not just to the portion it presents , even after the base <nl> + / / / collection ' s lifetime ends . Long - term storage of a slice may therefore <nl> + / / / prolong the lifetime of elements that are no longer otherwise <nl> + / / / accessible , which can erroneously appear to be memory leakage . \ <nl> + " " " % { " SliceType " : Self } <nl> } % <nl> <nl> / / FIXME ( ABI ) ( compiler limitation ) : There should be just one slice type <nl> def get_slice_doc_comment ( Self ) : <nl> $ { get_slice_doc_comment ( Self ) } <nl> % if Mutable : <nl> / / / <nl> - / / / - Warning : ` $ { Self } ` requires the setter of ` Base . subscript ( _ : Index ) ` <nl> - / / / to not invalidate indices . If you are writing a collection and mutations <nl> - / / / need to invalidate indices , don ' t use ` $ { Self } ` , use ` Slice ` or <nl> - / / / define your own ` Base . SubSequence ` type that takes that into account . <nl> + / / / - Note : ` $ { Self } ` requires that the base collection ' s ` subscript ( _ : Index ) ` <nl> + / / / setter does not invalidate indices . If you are writing a collection and <nl> + / / / mutations need to invalidate indices , don ' t use ` $ { Self } ` as its <nl> + / / / subsequence type . Instead , use the nonmutable ` Slice ` or define your own <nl> + / / / subsequence type that takes your index invalidation requirements into <nl> + / / / account . <nl> % end <nl> public struct $ { Self } < Base : $ { BaseRequirements } > <nl> : $ { SelfProtocols } { <nl> public struct $ { Self } < Base : $ { BaseRequirements } > <nl> } <nl> % end <nl> <nl> - / / / Create a view into collection ` base ` that allows access within ` bounds ` . <nl> + / / / Creates a view into the given collection that allows access to elements <nl> + / / / within the specified range . <nl> + / / / <nl> + / / / It is unusual to need to call this method directly . Instead , create a <nl> + / / / slice of a collection by using the collection ' s range - based subscript or <nl> + / / / by using methods that return a subsequence . <nl> + / / / <nl> + / / / let singleDigits = 0 . . . 9 <nl> + / / / let subSequence = singleDigits . dropFirst ( 5 ) <nl> + / / / print ( Array ( subSequence ) ) <nl> + / / / / / Prints " [ 5 , 6 , 7 , 8 , 9 ] " <nl> / / / <nl> - / / / - Complexity : O ( 1 ) . <nl> + / / / - Parameters : <nl> + / / / - base : The collection to create a view into . <nl> + / / / - bounds : The range of indices to allow access to in the new slice . <nl> public init ( base : Base , bounds : Range < Index > ) { <nl> self . _base = base <nl> self . _startIndex = bounds . lowerBound <nl> mmm a / test / SourceKit / DocSupport / doc_clang_module . swift . response <nl> ppp b / test / SourceKit / DocSupport / doc_clang_module . swift . response <nl> extension FooRuncingOptions { <nl> <nl> mutating func remove ( _ member : Self ) - > Self ? <nl> <nl> - mutating func update ( with e : Self ) - > Self ? <nl> + mutating func update ( with newMember : Self ) - > Self ? <nl> } <nl> <nl> extension FooRuncingOptions { <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> key . offset : 1869 , <nl> - key . length : 1 <nl> + key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> key . offset : 1869 , <nl> - key . length : 1 <nl> + key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs9OptionSet4SelfMx " , <nl> - key . offset : 1872 , <nl> + key . offset : 1880 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs9OptionSet4SelfMx " , <nl> - key . offset : 1881 , <nl> + key . offset : 1889 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 1890 , <nl> + key . offset : 1898 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooRuncingOptions " , <nl> key . usr : " c : @ E @ FooRuncingOptions " , <nl> - key . offset : 1900 , <nl> + key . offset : 1908 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 1925 , <nl> + key . offset : 1933 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 1937 , <nl> + key . offset : 1945 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 1949 , <nl> + key . offset : 1957 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 1958 , <nl> + key . offset : 1966 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 1963 , <nl> + key . offset : 1971 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 1973 , <nl> + key . offset : 1981 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 1975 , <nl> + key . offset : 1983 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 1975 , <nl> + key . offset : 1983 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs9OptionSet4SelfMx " , <nl> - key . offset : 1982 , <nl> + key . offset : 1990 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 1993 , <nl> + key . offset : 2001 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2002 , <nl> + key . offset : 2010 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2007 , <nl> + key . offset : 2015 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2024 , <nl> + key . offset : 2032 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2026 , <nl> + key . offset : 2034 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2026 , <nl> + key . offset : 2034 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs9OptionSet4SelfMx " , <nl> - key . offset : 2033 , <nl> + key . offset : 2041 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 2044 , <nl> + key . offset : 2052 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2053 , <nl> + key . offset : 2061 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2058 , <nl> + key . offset : 2066 , <nl> key . length : 23 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2082 , <nl> + key . offset : 2090 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2084 , <nl> + key . offset : 2092 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2084 , <nl> + key . offset : 2092 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs9OptionSet4SelfMx " , <nl> - key . offset : 2091 , <nl> + key . offset : 2099 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2100 , <nl> + key . offset : 2108 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooRuncingOptions " , <nl> key . usr : " c : @ E @ FooRuncingOptions " , <nl> - key . offset : 2110 , <nl> + key . offset : 2118 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 2135 , <nl> + key . offset : 2143 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2147 , <nl> + key . offset : 2155 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2152 , <nl> + key . offset : 2160 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " Sequence " , <nl> key . usr : " s : Ps8Sequence " , <nl> - key . offset : 2156 , <nl> + key . offset : 2164 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2165 , <nl> + key . offset : 2173 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . typeidentifier , <nl> - key . offset : 2171 , <nl> + key . offset : 2179 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . typeidentifier , <nl> - key . offset : 2173 , <nl> + key . offset : 2181 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . typeidentifier , <nl> - key . offset : 2182 , <nl> + key . offset : 2190 , <nl> key . length : 7 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . typeidentifier , <nl> - key . offset : 2193 , <nl> + key . offset : 2201 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2212 , <nl> + key . offset : 2220 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2214 , <nl> + key . offset : 2222 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2214 , <nl> + key . offset : 2222 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . typeidentifier , <nl> - key . offset : 2224 , <nl> + key . offset : 2232 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 2232 , <nl> + key . offset : 2240 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2244 , <nl> + key . offset : 2252 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2249 , <nl> + key . offset : 2257 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2262 , <nl> + key . offset : 2270 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2249 , <nl> + key . offset : 2257 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2262 , <nl> + key . offset : 2270 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooRuncingOptions " , <nl> key . usr : " c : @ E @ FooRuncingOptions " , <nl> - key . offset : 2276 , <nl> + key . offset : 2284 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 2303 , <nl> + key . offset : 2311 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2312 , <nl> + key . offset : 2320 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2317 , <nl> + key . offset : 2325 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2326 , <nl> + key . offset : 2334 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2328 , <nl> + key . offset : 2336 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2328 , <nl> + key . offset : 2336 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2335 , <nl> + key . offset : 2343 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2346 , <nl> + key . offset : 2354 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2351 , <nl> + key . offset : 2359 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2360 , <nl> + key . offset : 2368 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2363 , <nl> + key . offset : 2371 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2360 , <nl> + key . offset : 2368 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2363 , <nl> + key . offset : 2371 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2370 , <nl> + key . offset : 2378 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Bool " , <nl> key . usr : " s : Sb " , <nl> - key . offset : 2379 , <nl> + key . offset : 2387 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2389 , <nl> + key . offset : 2397 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2394 , <nl> + key . offset : 2402 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2405 , <nl> + key . offset : 2413 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2408 , <nl> + key . offset : 2416 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2405 , <nl> + key . offset : 2413 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2408 , <nl> + key . offset : 2416 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2415 , <nl> + key . offset : 2423 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Bool " , <nl> key . usr : " s : Sb " , <nl> - key . offset : 2424 , <nl> + key . offset : 2432 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2434 , <nl> + key . offset : 2442 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2439 , <nl> + key . offset : 2447 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2450 , <nl> + key . offset : 2458 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2455 , <nl> + key . offset : 2463 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2450 , <nl> + key . offset : 2458 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2455 , <nl> + key . offset : 2463 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2462 , <nl> + key . offset : 2470 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Bool " , <nl> key . usr : " s : Sb " , <nl> - key . offset : 2471 , <nl> + key . offset : 2479 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2481 , <nl> + key . offset : 2489 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2486 , <nl> + key . offset : 2494 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2498 , <nl> + key . offset : 2506 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2500 , <nl> + key . offset : 2508 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2500 , <nl> + key . offset : 2508 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2507 , <nl> + key . offset : 2515 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2516 , <nl> + key . offset : 2524 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2526 , <nl> + key . offset : 2534 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2530 , <nl> + key . offset : 2538 , <nl> key . length : 7 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Bool " , <nl> key . usr : " s : Sb " , <nl> - key . offset : 2539 , <nl> + key . offset : 2547 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2546 , <nl> + key . offset : 2554 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2557 , <nl> + key . offset : 2565 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2562 , <nl> + key . offset : 2570 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2579 , <nl> + key . offset : 2587 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2582 , <nl> + key . offset : 2590 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2579 , <nl> + key . offset : 2587 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2582 , <nl> + key . offset : 2590 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2589 , <nl> + key . offset : 2597 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Bool " , <nl> key . usr : " s : Sb " , <nl> - key . offset : 2598 , <nl> + key . offset : 2606 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2608 , <nl> + key . offset : 2616 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2613 , <nl> + key . offset : 2621 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2628 , <nl> + key . offset : 2636 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2631 , <nl> + key . offset : 2639 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2628 , <nl> + key . offset : 2636 , <nl> key . length : 2 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2631 , <nl> + key . offset : 2639 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . generic_type_param , <nl> key . name : " Self " , <nl> key . usr : " s : tPs10SetAlgebra4SelfMx " , <nl> - key . offset : 2638 , <nl> + key . offset : 2646 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Bool " , <nl> key . usr : " s : Sb " , <nl> - key . offset : 2647 , <nl> + key . offset : 2655 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2654 , <nl> + key . offset : 2662 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2661 , <nl> + key . offset : 2669 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2679 , <nl> + key . offset : 2687 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2683 , <nl> + key . offset : 2691 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 2686 , <nl> + key . offset : 2694 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2697 , <nl> + key . offset : 2705 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2701 , <nl> + key . offset : 2709 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 2704 , <nl> + key . offset : 2712 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2716 , <nl> + key . offset : 2724 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2728 , <nl> + key . offset : 2736 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2733 , <nl> + key . offset : 2741 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2735 , <nl> + key . offset : 2743 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2733 , <nl> + key . offset : 2741 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2735 , <nl> + key . offset : 2743 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 2738 , <nl> + key . offset : 2746 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2745 , <nl> + key . offset : 2753 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2747 , <nl> + key . offset : 2755 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2745 , <nl> + key . offset : 2753 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2747 , <nl> + key . offset : 2755 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 2750 , <nl> + key . offset : 2758 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2760 , <nl> + key . offset : 2768 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2767 , <nl> + key . offset : 2775 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2785 , <nl> + key . offset : 2793 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2789 , <nl> + key . offset : 2797 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 2792 , <nl> + key . offset : 2800 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2803 , <nl> + key . offset : 2811 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2807 , <nl> + key . offset : 2815 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 2810 , <nl> + key . offset : 2818 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2822 , <nl> + key . offset : 2830 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2834 , <nl> + key . offset : 2842 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2839 , <nl> + key . offset : 2847 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2841 , <nl> + key . offset : 2849 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2839 , <nl> + key . offset : 2847 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2841 , <nl> + key . offset : 2849 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 2844 , <nl> + key . offset : 2852 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2851 , <nl> + key . offset : 2859 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2853 , <nl> + key . offset : 2861 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2851 , <nl> + key . offset : 2859 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2853 , <nl> + key . offset : 2861 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 2856 , <nl> + key . offset : 2864 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2866 , <nl> + key . offset : 2874 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2876 , <nl> + key . offset : 2884 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooStruct2 " , <nl> key . usr : " c : @ S @ FooStruct2 " , <nl> - key . offset : 2896 , <nl> + key . offset : 2904 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2907 , <nl> + key . offset : 2915 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2914 , <nl> + key . offset : 2922 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2939 , <nl> + key . offset : 2947 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2943 , <nl> + key . offset : 2951 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 2946 , <nl> + key . offset : 2954 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2957 , <nl> + key . offset : 2965 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2961 , <nl> + key . offset : 2969 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 2964 , <nl> + key . offset : 2972 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2976 , <nl> + key . offset : 2984 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 2988 , <nl> + key . offset : 2996 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 2993 , <nl> + key . offset : 3001 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 2995 , <nl> + key . offset : 3003 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2993 , <nl> + key . offset : 3001 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 2995 , <nl> + key . offset : 3003 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 2998 , <nl> + key . offset : 3006 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3005 , <nl> + key . offset : 3013 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3007 , <nl> + key . offset : 3015 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3005 , <nl> + key . offset : 3013 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3007 , <nl> + key . offset : 3015 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 3010 , <nl> + key . offset : 3018 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3020 , <nl> + key . offset : 3028 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3030 , <nl> + key . offset : 3038 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3044 , <nl> + key . offset : 3052 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3050 , <nl> + key . offset : 3058 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3054 , <nl> + key . offset : 3062 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3065 , <nl> + key . offset : 3073 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3071 , <nl> + key . offset : 3079 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3076 , <nl> + key . offset : 3084 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3085 , <nl> + key . offset : 3093 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3087 , <nl> + key . offset : 3095 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3087 , <nl> + key . offset : 3095 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3090 , <nl> + key . offset : 3098 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3100 , <nl> + key . offset : 3108 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3106 , <nl> + key . offset : 3114 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3111 , <nl> + key . offset : 3119 , <nl> key . length : 22 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3134 , <nl> + key . offset : 3142 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3136 , <nl> + key . offset : 3144 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3139 , <nl> + key . offset : 3147 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3149 , <nl> + key . offset : 3157 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3155 , <nl> + key . offset : 3163 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3160 , <nl> + key . offset : 3168 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3169 , <nl> + key . offset : 3177 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3171 , <nl> + key . offset : 3179 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3171 , <nl> + key . offset : 3179 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3174 , <nl> + key . offset : 3182 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3181 , <nl> + key . offset : 3189 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3183 , <nl> + key . offset : 3191 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3183 , <nl> + key . offset : 3191 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Float " , <nl> key . usr : " s : Sf " , <nl> - key . offset : 3186 , <nl> + key . offset : 3194 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3193 , <nl> + key . offset : 3201 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3195 , <nl> + key . offset : 3203 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3195 , <nl> + key . offset : 3203 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Double " , <nl> key . usr : " s : Sd " , <nl> - key . offset : 3198 , <nl> + key . offset : 3206 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3206 , <nl> + key . offset : 3214 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3208 , <nl> + key . offset : 3216 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3208 , <nl> + key . offset : 3216 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " UnsafeMutablePointer " , <nl> key . usr : " s : Sp " , <nl> - key . offset : 3211 , <nl> + key . offset : 3219 , <nl> key . length : 20 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3232 , <nl> + key . offset : 3240 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3244 , <nl> + key . offset : 3252 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3250 , <nl> + key . offset : 3258 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3255 , <nl> + key . offset : 3263 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3272 , <nl> + key . offset : 3280 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3274 , <nl> + key . offset : 3282 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3274 , <nl> + key . offset : 3282 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Float " , <nl> key . usr : " s : Sf " , <nl> - key . offset : 3281 , <nl> + key . offset : 3289 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3291 , <nl> + key . offset : 3299 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3300 , <nl> + key . offset : 3308 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3305 , <nl> + key . offset : 3313 , <nl> key . length : 26 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3332 , <nl> + key . offset : 3340 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3334 , <nl> + key . offset : 3342 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3334 , <nl> + key . offset : 3342 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Float " , <nl> key . usr : " s : Sf " , <nl> - key . offset : 3342 , <nl> + key . offset : 3350 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3352 , <nl> + key . offset : 3360 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 3361 , <nl> + key . offset : 3369 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3371 , <nl> + key . offset : 3379 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3376 , <nl> + key . offset : 3384 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 3395 , <nl> + key . offset : 3403 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3405 , <nl> + key . offset : 3413 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3410 , <nl> + key . offset : 3418 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3429 , <nl> + key . offset : 3437 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3434 , <nl> + key . offset : 3442 , <nl> key . length : 19 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3456 , <nl> + key . offset : 3464 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3461 , <nl> + key . offset : 3469 , <nl> key . length : 19 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3483 , <nl> + key . offset : 3491 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3488 , <nl> + key . offset : 3496 , <nl> key . length : 19 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3510 , <nl> + key . offset : 3518 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3515 , <nl> + key . offset : 3523 , <nl> key . length : 19 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3537 , <nl> + key . offset : 3545 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3542 , <nl> + key . offset : 3550 , <nl> key . length : 19 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3564 , <nl> + key . offset : 3572 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3569 , <nl> + key . offset : 3577 , <nl> key . length : 32 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 3602 , <nl> + key . offset : 3610 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 3604 , <nl> + key . offset : 3612 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3604 , <nl> + key . offset : 3612 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3607 , <nl> + key . offset : 3615 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3617 , <nl> + key . offset : 3625 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3623 , <nl> + key . offset : 3631 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3632 , <nl> + key . offset : 3640 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3655 , <nl> + key . offset : 3663 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3660 , <nl> + key . offset : 3668 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3680 , <nl> + key . offset : 3688 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3685 , <nl> + key . offset : 3693 , <nl> key . length : 33 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3726 , <nl> + key . offset : 3734 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3731 , <nl> + key . offset : 3739 , <nl> key . length : 33 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3772 , <nl> + key . offset : 3780 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3779 , <nl> + key . offset : 3787 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3784 , <nl> + key . offset : 3792 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3809 , <nl> + key . offset : 3817 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3813 , <nl> + key . offset : 3821 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3827 , <nl> + key . offset : 3835 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3835 , <nl> + key . offset : 3843 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3839 , <nl> + key . offset : 3847 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3850 , <nl> + key . offset : 3858 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3854 , <nl> + key . offset : 3862 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3868 , <nl> + key . offset : 3876 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3876 , <nl> + key . offset : 3884 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3880 , <nl> + key . offset : 3888 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3891 , <nl> + key . offset : 3899 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3895 , <nl> + key . offset : 3903 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 3909 , <nl> + key . offset : 3917 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3917 , <nl> + key . offset : 3925 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3925 , <nl> + key . offset : 3933 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3934 , <nl> + key . offset : 3942 , <nl> key . length : 18 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " FooProtocolBase " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase " , <nl> - key . offset : 3955 , <nl> + key . offset : 3963 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 3975 , <nl> + key . offset : 3983 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 3981 , <nl> + key . offset : 3989 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4001 , <nl> + key . offset : 4009 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4006 , <nl> + key . offset : 4014 , <nl> key . length : 20 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4034 , <nl> + key . offset : 4042 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4039 , <nl> + key . offset : 4047 , <nl> key . length : 20 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 4060 , <nl> + key . offset : 4068 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 4062 , <nl> + key . offset : 4070 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4062 , <nl> + key . offset : 4070 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4072 , <nl> + key . offset : 4080 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 4087 , <nl> + key . offset : 4095 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4106 , <nl> + key . offset : 4114 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 4119 , <nl> + key . offset : 4127 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4131 , <nl> + key . offset : 4139 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 4137 , <nl> + key . offset : 4145 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 4143 , <nl> + key . offset : 4151 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4137 , <nl> + key . offset : 4145 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4143 , <nl> + key . offset : 4151 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Float " , <nl> key . usr : " s : Sf " , <nl> - key . offset : 4146 , <nl> + key . offset : 4154 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4158 , <nl> + key . offset : 4166 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4163 , <nl> + key . offset : 4171 , <nl> key . length : 29 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4200 , <nl> + key . offset : 4208 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4206 , <nl> + key . offset : 4214 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4211 , <nl> + key . offset : 4219 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4236 , <nl> + key . offset : 4244 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4241 , <nl> + key . offset : 4249 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4261 , <nl> + key . offset : 4269 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4277 , <nl> + key . offset : 4285 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4282 , <nl> + key . offset : 4290 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4302 , <nl> + key . offset : 4310 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4318 , <nl> + key . offset : 4326 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4323 , <nl> + key . offset : 4331 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4344 , <nl> + key . offset : 4352 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4360 , <nl> + key . offset : 4368 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4365 , <nl> + key . offset : 4373 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4385 , <nl> + key . offset : 4393 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4398 , <nl> + key . offset : 4406 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4404 , <nl> + key . offset : 4412 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 4422 , <nl> + key . offset : 4430 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " FooProtocolDerived " , <nl> key . usr : " c : objc ( pl ) FooProtocolDerived " , <nl> - key . offset : 4436 , <nl> + key . offset : 4444 , <nl> key . length : 18 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4462 , <nl> + key . offset : 4470 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4466 , <nl> + key . offset : 4474 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4480 , <nl> + key . offset : 4488 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4491 , <nl> + key . offset : 4499 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4495 , <nl> + key . offset : 4503 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4509 , <nl> + key . offset : 4517 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4520 , <nl> + key . offset : 4528 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4524 , <nl> + key . offset : 4532 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4538 , <nl> + key . offset : 4546 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4546 , <nl> + key . offset : 4554 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4557 , <nl> + key . offset : 4565 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4562 , <nl> + key . offset : 4570 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4586 , <nl> + key . offset : 4594 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4591 , <nl> + key . offset : 4599 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 4608 , <nl> + key . offset : 4616 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 4610 , <nl> + key . offset : 4618 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4610 , <nl> + key . offset : 4618 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4613 , <nl> + key . offset : 4621 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4625 , <nl> + key . offset : 4633 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4630 , <nl> + key . offset : 4638 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 4647 , <nl> + key . offset : 4655 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 4649 , <nl> + key . offset : 4657 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4649 , <nl> + key . offset : 4657 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4652 , <nl> + key . offset : 4660 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 4659 , <nl> + key . offset : 4667 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 4665 , <nl> + key . offset : 4673 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4659 , <nl> + key . offset : 4667 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4665 , <nl> + key . offset : 4673 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4668 , <nl> + key . offset : 4676 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4680 , <nl> + key . offset : 4688 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4685 , <nl> + key . offset : 4693 , <nl> key . length : 29 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4722 , <nl> + key . offset : 4730 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4728 , <nl> + key . offset : 4736 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4733 , <nl> + key . offset : 4741 , <nl> key . length : 13 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4754 , <nl> + key . offset : 4762 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4759 , <nl> + key . offset : 4767 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4779 , <nl> + key . offset : 4787 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4795 , <nl> + key . offset : 4803 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4800 , <nl> + key . offset : 4808 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4820 , <nl> + key . offset : 4828 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4836 , <nl> + key . offset : 4844 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4841 , <nl> + key . offset : 4849 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4862 , <nl> + key . offset : 4870 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4878 , <nl> + key . offset : 4886 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4883 , <nl> + key . offset : 4891 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 4903 , <nl> + key . offset : 4911 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4916 , <nl> + key . offset : 4924 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4920 , <nl> + key . offset : 4928 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4933 , <nl> + key . offset : 4941 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4941 , <nl> + key . offset : 4949 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4947 , <nl> + key . offset : 4955 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4951 , <nl> + key . offset : 4959 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4964 , <nl> + key . offset : 4972 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4972 , <nl> + key . offset : 4980 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 4978 , <nl> + key . offset : 4986 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 4982 , <nl> + key . offset : 4990 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 4995 , <nl> + key . offset : 5003 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5003 , <nl> + key . offset : 5011 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5009 , <nl> + key . offset : 5017 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5013 , <nl> + key . offset : 5021 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " UInt32 " , <nl> key . usr : " s : Vs6UInt32 " , <nl> - key . offset : 5026 , <nl> + key . offset : 5034 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5035 , <nl> + key . offset : 5043 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5041 , <nl> + key . offset : 5049 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5045 , <nl> + key . offset : 5053 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " UInt64 " , <nl> key . usr : " s : Vs6UInt64 " , <nl> - key . offset : 5058 , <nl> + key . offset : 5066 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5067 , <nl> + key . offset : 5075 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5073 , <nl> + key . offset : 5081 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5077 , <nl> + key . offset : 5085 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 5096 , <nl> + key . offset : 5104 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5104 , <nl> + key . offset : 5112 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5110 , <nl> + key . offset : 5118 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5114 , <nl> + key . offset : 5122 , <nl> key . length : 17 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 5133 , <nl> + key . offset : 5141 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5141 , <nl> + key . offset : 5149 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5147 , <nl> + key . offset : 5155 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5152 , <nl> + key . offset : 5160 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5171 , <nl> + key . offset : 5179 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5176 , <nl> + key . offset : 5184 , <nl> key . length : 21 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5200 , <nl> + key . offset : 5208 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5207 , <nl> + key . offset : 5215 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5230 , <nl> + key . offset : 5238 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5234 , <nl> + key . offset : 5242 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 5237 , <nl> + key . offset : 5245 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5248 , <nl> + key . offset : 5256 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5260 , <nl> + key . offset : 5268 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 5265 , <nl> + key . offset : 5273 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 5267 , <nl> + key . offset : 5275 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5265 , <nl> + key . offset : 5273 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5267 , <nl> + key . offset : 5275 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 5270 , <nl> + key . offset : 5278 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5279 , <nl> + key . offset : 5287 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 5289 , <nl> + key . offset : 5297 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5309 , <nl> + key . offset : 5317 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5314 , <nl> + key . offset : 5322 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5334 , <nl> + key . offset : 5342 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5347 , <nl> + key . offset : 5355 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 5357 , <nl> + key . offset : 5365 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5377 , <nl> + key . offset : 5385 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5382 , <nl> + key . offset : 5390 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5402 , <nl> + key . offset : 5410 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5418 , <nl> + key . offset : 5426 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5423 , <nl> + key . offset : 5431 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5444 , <nl> + key . offset : 5452 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5457 , <nl> + key . offset : 5465 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 5467 , <nl> + key . offset : 5475 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5487 , <nl> + key . offset : 5495 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5492 , <nl> + key . offset : 5500 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5512 , <nl> + key . offset : 5520 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5525 , <nl> + key . offset : 5533 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5534 , <nl> + key . offset : 5542 , <nl> key . length : 13 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5552 , <nl> + key . offset : 5560 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5558 , <nl> + key . offset : 5566 , <nl> key . length : 21 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " _InternalProt " , <nl> key . usr : " c : objc ( pl ) _InternalProt " , <nl> - key . offset : 5582 , <nl> + key . offset : 5590 , <nl> key . length : 13 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5600 , <nl> + key . offset : 5608 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5606 , <nl> + key . offset : 5614 , <nl> key . length : 25 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 5634 , <nl> + key . offset : 5642 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 5654 , <nl> + key . offset : 5662 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5670 , <nl> + key . offset : 5678 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5674 , <nl> + key . offset : 5682 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5686 , <nl> + key . offset : 5694 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 5702 , <nl> + key . offset : 5710 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5718 , <nl> + key . offset : 5726 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5722 , <nl> + key . offset : 5730 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5740 , <nl> + key . offset : 5748 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5756 , <nl> + key . offset : 5764 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5760 , <nl> + key . offset : 5768 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5772 , <nl> + key . offset : 5780 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5788 , <nl> + key . offset : 5796 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5792 , <nl> + key . offset : 5800 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5803 , <nl> + key . offset : 5811 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 5819 , <nl> + key . offset : 5827 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5830 , <nl> + key . offset : 5838 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5834 , <nl> + key . offset : 5842 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5844 , <nl> + key . offset : 5852 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 5860 , <nl> + key . offset : 5868 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5865 , <nl> + key . offset : 5873 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5869 , <nl> + key . offset : 5877 , <nl> key . length : 7 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5878 , <nl> + key . offset : 5886 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5894 , <nl> + key . offset : 5902 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5898 , <nl> + key . offset : 5906 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 5906 , <nl> + key . offset : 5914 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5917 , <nl> + key . offset : 5925 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5922 , <nl> + key . offset : 5930 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5942 , <nl> + key . offset : 5950 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5958 , <nl> + key . offset : 5966 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 5963 , <nl> + key . offset : 5971 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 5983 , <nl> + key . offset : 5991 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 5999 , <nl> + key . offset : 6007 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6004 , <nl> + key . offset : 6012 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 6025 , <nl> + key . offset : 6033 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6041 , <nl> + key . offset : 6049 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6046 , <nl> + key . offset : 6054 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 6066 , <nl> + key . offset : 6074 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6079 , <nl> + key . offset : 6087 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6085 , <nl> + key . offset : 6093 , <nl> key . length : 21 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 6109 , <nl> + key . offset : 6117 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . attribute . builtin , <nl> - key . offset : 6129 , <nl> + key . offset : 6137 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6141 , <nl> + key . offset : 6149 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 6147 , <nl> + key . offset : 6155 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 6151 , <nl> + key . offset : 6159 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6147 , <nl> + key . offset : 6155 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6151 , <nl> + key . offset : 6159 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 6154 , <nl> + key . offset : 6162 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6166 , <nl> + key . offset : 6174 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6172 , <nl> + key . offset : 6180 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6177 , <nl> + key . offset : 6185 , <nl> key . length : 7 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 6185 , <nl> + key . offset : 6193 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 6187 , <nl> + key . offset : 6195 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6187 , <nl> + key . offset : 6195 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 6190 , <nl> + key . offset : 6198 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooUnavailableMembers " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers " , <nl> - key . offset : 6200 , <nl> + key . offset : 6208 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6211 , <nl> + key . offset : 6219 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6216 , <nl> + key . offset : 6224 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6235 , <nl> + key . offset : 6243 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6240 , <nl> + key . offset : 6248 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6264 , <nl> + key . offset : 6272 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6269 , <nl> + key . offset : 6277 , <nl> key . length : 10 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6287 , <nl> + key . offset : 6295 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6292 , <nl> + key . offset : 6300 , <nl> key . length : 22 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6322 , <nl> + key . offset : 6330 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6327 , <nl> + key . offset : 6335 , <nl> key . length : 22 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6357 , <nl> + key . offset : 6365 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6362 , <nl> + key . offset : 6370 , <nl> key . length : 21 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6391 , <nl> + key . offset : 6399 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6396 , <nl> + key . offset : 6404 , <nl> key . length : 23 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6427 , <nl> + key . offset : 6435 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6432 , <nl> + key . offset : 6440 , <nl> key . length : 25 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6465 , <nl> + key . offset : 6473 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6470 , <nl> + key . offset : 6478 , <nl> key . length : 25 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6503 , <nl> + key . offset : 6511 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6508 , <nl> + key . offset : 6516 , <nl> key . length : 24 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6540 , <nl> + key . offset : 6548 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6545 , <nl> + key . offset : 6553 , <nl> key . length : 26 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6579 , <nl> + key . offset : 6587 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6584 , <nl> + key . offset : 6592 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 6604 , <nl> + key . offset : 6612 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6620 , <nl> + key . offset : 6628 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6625 , <nl> + key . offset : 6633 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 6645 , <nl> + key . offset : 6653 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6661 , <nl> + key . offset : 6669 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6666 , <nl> + key . offset : 6674 , <nl> key . length : 15 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 6687 , <nl> + key . offset : 6695 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6703 , <nl> + key . offset : 6711 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6708 , <nl> + key . offset : 6716 , <nl> key . length : 14 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " AnyObject " , <nl> key . usr : " s : Ps9AnyObject " , <nl> - key . offset : 6728 , <nl> + key . offset : 6736 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6741 , <nl> + key . offset : 6749 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6751 , <nl> + key . offset : 6759 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooCFType " , <nl> key . usr : " c : Foo . h @ T @ FooCFTypeRef " , <nl> - key . offset : 6766 , <nl> + key . offset : 6774 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6776 , <nl> + key . offset : 6784 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6782 , <nl> + key . offset : 6790 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6796 , <nl> + key . offset : 6804 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6801 , <nl> + key . offset : 6809 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 6818 , <nl> + key . offset : 6826 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 6820 , <nl> + key . offset : 6828 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . class , <nl> key . name : " FooCFType " , <nl> key . usr : " c : Foo . h @ T @ FooCFTypeRef " , <nl> - key . offset : 6823 , <nl> + key . offset : 6831 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6835 , <nl> + key . offset : 6843 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6840 , <nl> + key . offset : 6848 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 6852 , <nl> + key . offset : 6860 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 6854 , <nl> + key . offset : 6862 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6854 , <nl> + key . offset : 6862 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 6857 , <nl> + key . offset : 6865 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int32 " , <nl> key . usr : " s : Vs5Int32 " , <nl> - key . offset : 6867 , <nl> + key . offset : 6875 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6873 , <nl> + key . offset : 6881 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6880 , <nl> + key . offset : 6888 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " RawRepresentable " , <nl> key . usr : " s : Ps16RawRepresentable " , <nl> - key . offset : 6894 , <nl> + key . offset : 6902 , <nl> key . length : 16 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . protocol , <nl> key . name : " Equatable " , <nl> key . usr : " s : Ps9Equatable " , <nl> - key . offset : 6912 , <nl> + key . offset : 6920 , <nl> key . length : 9 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6929 , <nl> + key . offset : 6937 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 6934 , <nl> + key . offset : 6942 , <nl> key . length : 1 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 6936 , <nl> + key . offset : 6944 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6936 , <nl> + key . offset : 6944 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " UInt32 " , <nl> key . usr : " s : Vs6UInt32 " , <nl> - key . offset : 6946 , <nl> + key . offset : 6954 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6959 , <nl> + key . offset : 6967 , <nl> key . length : 4 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . argument , <nl> - key . offset : 6964 , <nl> + key . offset : 6972 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . parameter , <nl> - key . offset : 6973 , <nl> + key . offset : 6981 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6964 , <nl> + key . offset : 6972 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 6973 , <nl> + key . offset : 6981 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " UInt32 " , <nl> key . usr : " s : Vs6UInt32 " , <nl> - key . offset : 6983 , <nl> + key . offset : 6991 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 6996 , <nl> + key . offset : 7004 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7000 , <nl> + key . offset : 7008 , <nl> key . length : 8 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " UInt32 " , <nl> key . usr : " s : Vs6UInt32 " , <nl> - key . offset : 7010 , <nl> + key . offset : 7018 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 7019 , <nl> + key . offset : 7027 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7023 , <nl> + key . offset : 7031 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooSubEnum1 " , <nl> key . usr : " c : @ E @ FooSubEnum1 " , <nl> - key . offset : 7037 , <nl> + key . offset : 7045 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7051 , <nl> + key . offset : 7059 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 7057 , <nl> + key . offset : 7065 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7061 , <nl> + key . offset : 7069 , <nl> key . length : 12 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooSubEnum1 " , <nl> key . usr : " c : @ E @ FooSubEnum1 " , <nl> - key . offset : 7075 , <nl> + key . offset : 7083 , <nl> key . length : 11 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7089 , <nl> + key . offset : 7097 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . keyword , <nl> - key . offset : 7095 , <nl> + key . offset : 7103 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7099 , <nl> + key . offset : 7107 , <nl> key . length : 25 <nl> } , <nl> { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " Int " , <nl> key . usr : " s : Si " , <nl> - key . offset : 7126 , <nl> + key . offset : 7134 , <nl> key . length : 3 <nl> } , <nl> { <nl> key . kind : source . lang . swift . syntaxtype . identifier , <nl> - key . offset : 7132 , <nl> + key . offset : 7140 , <nl> key . length : 3 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> ] , <nl> key . doc . full_as_xml : " < Other > < Name > < / Name > < Declaration > extension FooRuncingOptions where Element = = Self < / Declaration > < Abstract > < Para > < codeVoice > OptionSet < / codeVoice > requirements for which default implementations are supplied when < codeVoice > Element = = Self < / codeVoice > , which is the default . < / Para > < / Abstract > < Discussion > < Note > < Para > A type conforming to < codeVoice > OptionSet < / codeVoice > can implement any of these initializers or methods , and those implementations will be used in lieu of these defaults . < / Para > < / Note > < / Discussion > < / Other > " , <nl> key . offset : 1624 , <nl> - key . length : 264 , <nl> + key . length : 272 , <nl> key . extends : { <nl> key . kind : source . lang . swift . ref . struct , <nl> key . name : " FooRuncingOptions " , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " insert ( _ : ) " , <nl> key . usr : " s : FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T8insertedSb17memberAfterInsertwxS0__ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T8insertedSb17memberAfterInsertwxS0__ " , <nl> - key . doc . full_as_xml : " < Function > < Name > insert ( _ : ) < / Name > < USR > s : FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T8insertedSb17memberAfterInsertwxS0__ < / USR > < Declaration > mutating func insert ( _ newMember : Self ) - & gt ; ( inserted : Bool , memberAfterInsert : Self ) < / Declaration > < Abstract > < Para > Inserts the given element into the option set if it is not already a member . < / Para > < / Abstract > < Parameters > < Parameter > < Name > newMember < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > The element to insert . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > ( true , newMember ) < / codeVoice > if < codeVoice > e < / codeVoice > was not contained in < codeVoice > self < / codeVoice > . Otherwise , returns < codeVoice > ( false , oldMember ) < / codeVoice > , where < codeVoice > oldMember < / codeVoice > is the member of < codeVoice > self < / codeVoice > equal to < codeVoice > newMember < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > For example : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let purchasePrice = 87 . 55 ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ var freeOptions : ShippingOptions = [ . standard ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ if purchasePrice > 50 { ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ freeOptions . insert ( . priority ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ } ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( freeOptions . contains ( . priority ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < Postcondition > < Para > < codeVoice > self . contains ( newMember ) < / codeVoice > . < / Para > < / Postcondition > < / Discussion > < / Function > " , <nl> + key . doc . full_as_xml : " < Function > < Name > insert ( _ : ) < / Name > < USR > s : FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T8insertedSb17memberAfterInsertwxS0__ < / USR > < Declaration > mutating func insert ( _ newMember : Self ) - & gt ; ( inserted : Bool , memberAfterInsert : Self ) < / Declaration > < Abstract > < Para > Inserts the given element into the option set if it is not already a member . < / Para > < / Abstract > < Parameters > < Parameter > < Name > newMember < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > The element to insert . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > ( true , newMember ) < / codeVoice > if < codeVoice > newMember < / codeVoice > was not contained in < codeVoice > self < / codeVoice > . Otherwise , returns < codeVoice > ( false , oldMember ) < / codeVoice > , where < codeVoice > oldMember < / codeVoice > is the member of the set equal to < codeVoice > newMember < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > For example : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let purchasePrice = 87 . 55 ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ var freeOptions : ShippingOptions = [ . standard , . priority ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ if purchasePrice > 50 { ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ freeOptions . insert ( . secondDay ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ } ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( freeOptions . contains ( . secondDay ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> key . offset : 1702 , <nl> key . length : 84 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > insert < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > newMember < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < tuple > ( < tuple . element > < tuple . element . argument_label > inserted < / tuple . element . argument_label > : < tuple . element . type > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / tuple . element . type > < / tuple . element > , < tuple . element > < tuple . element . argument_label > memberAfterInsert < / tuple . element . argument_label > : < tuple . element . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / tuple . element . type > < / tuple . element > ) < / tuple > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " remove ( _ : ) " , <nl> key . usr : " s : FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__ " , <nl> - key . doc . full_as_xml : " < Function > < Name > remove ( _ : ) < / Name > < USR > s : FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__ < / USR > < Declaration > mutating func remove ( _ member : Self ) - & gt ; Self ? < / Declaration > < Abstract > < Para > Removes a given element if it is contained in the option set ; otherwise , removes all elements subsumed by the given element . < / Para > < / Abstract > < Parameters > < Parameter > < Name > member < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > The element of the set to remove . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > member < / codeVoice > if it was contained in the set ; otherwise , < codeVoice > nil < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > In the following example , removing < codeVoice > . express < / codeVoice > empties the option set but returns < codeVoice > nil < / codeVoice > because the option set doesn ’ t contain all the elements of < codeVoice > . express < / codeVoice > . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ var options : ShippingOptions = [ . secondDay , . priority ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let priorityOption = options . remove ( . priority ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( priorityOption = = . priority ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let expressOption = options . remove ( . express ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( expressOption = = . express ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " false \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( options . isEmpty ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < Postcondition > < Para > < codeVoice > self . intersection ( [ member ] ) . isEmpty < / codeVoice > < / Para > < / Postcondition > < / Discussion > < / Function > " , <nl> + key . doc . full_as_xml : " < Function > < Name > remove ( _ : ) < / Name > < USR > s : FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__ < / USR > < Declaration > mutating func remove ( _ member : Self ) - & gt ; Self ? < / Declaration > < Abstract > < Para > Removes the given element and all elements subsumed by the given element . < / Para > < / Abstract > < Parameters > < Parameter > < Name > member < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > The element of the set to remove . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > The intersection of < codeVoice > [ member ] < / codeVoice > and the set if the intersection was nonempty ; otherwise , < codeVoice > nil < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > For example : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ var options : ShippingOptions = [ . secondDay , . priority ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let priorityOption = options . remove ( . priority ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( priorityOption = = . priority ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( options . remove ( . priority ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " nil \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < Para > In the following example , the < codeVoice > . express < / codeVoice > element is passed to < codeVoice > remove ( _ : ) < / codeVoice > . Although < codeVoice > . express < / codeVoice > is not a member of < codeVoice > options < / codeVoice > , < codeVoice > . express < / codeVoice > subsumes the remaining < codeVoice > . secondDay < / codeVoice > element of the option set . Therefore , < codeVoice > options < / codeVoice > is emptied and the intersection between < codeVoice > . express < / codeVoice > and < codeVoice > options < / codeVoice > is returned . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let expressOption = options . remove ( . express ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( expressOption = = . express ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " false \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( expressOption = = . secondDay ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> key . offset : 1792 , <nl> key . length : 45 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . attribute . builtin > < syntaxtype . attribute . name > @ discardableResult < / syntaxtype . attribute . name > < / syntaxtype . attribute . builtin > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > remove < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > member < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > ? < / decl . function . returntype > < / decl . function . method . instance > " , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " update ( with : ) " , <nl> key . usr : " s : FesRxs9OptionSetxzwx7ElementrS_6updateFT4withwxS0__GSqwxS0__ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetxzwx7ElementrS_6updateFT4withwxS0__GSqwxS0__ " , <nl> - key . doc . full_as_xml : " < Function > < Name > update ( with : ) < / Name > < USR > s : FesRxs9OptionSetxzwx7ElementrS_6updateFT4withwxS0__GSqwxS0__ < / USR > < Declaration > mutating func update ( with e : Self ) - & gt ; Self ? < / Declaration > < Abstract > < Para > Inserts < codeVoice > e < / codeVoice > unconditionally . < / Para > < / Abstract > < ResultDiscussion > < Para > a former member < codeVoice > r < / codeVoice > of < codeVoice > self < / codeVoice > such that < codeVoice > self . intersection ( [ e ] ) = = [ r ] < / codeVoice > if < codeVoice > self . intersection ( [ e ] ) < / codeVoice > was non - empty . Returns < codeVoice > nil < / codeVoice > otherwise . < / Para > < / ResultDiscussion > < Discussion > < Postcondition > < Para > < codeVoice > self . contains ( e ) < / codeVoice > < / Para > < / Postcondition > < / Discussion > < / Function > " , <nl> + key . doc . full_as_xml : " < Function > < Name > update ( with : ) < / Name > < USR > s : FesRxs9OptionSetxzwx7ElementrS_6updateFT4withwxS0__GSqwxS0__ < / USR > < Declaration > mutating func update ( with newMember : Self ) - & gt ; Self ? < / Declaration > < Abstract > < Para > Inserts the given element into the set . < / Para > < / Abstract > < ResultDiscussion > < Para > The intersection of < codeVoice > [ newMember ] < / codeVoice > and the set if the intersection was nonempty ; otherwise , < codeVoice > nil < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > If < codeVoice > newMember < / codeVoice > is not contained in the set but subsumes current members of the set , the subsumed members are returned . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ var options : ShippingOptions = [ . secondDay , . priority ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let replaced = options . update ( with : . express ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( replaced = = . secondDay ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> key . offset : 1843 , <nl> - key . length : 43 , <nl> - key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . attribute . builtin > < syntaxtype . attribute . name > @ discardableResult < / syntaxtype . attribute . name > < / syntaxtype . attribute . builtin > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > update < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > with < / decl . var . parameter . argument_label > < decl . var . parameter . name > e < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > ? < / decl . function . returntype > < / decl . function . method . instance > " , <nl> + key . length : 51 , <nl> + key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . attribute . builtin > < syntaxtype . attribute . name > @ discardableResult < / syntaxtype . attribute . name > < / syntaxtype . attribute . builtin > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > update < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > with < / decl . var . parameter . argument_label > < decl . var . parameter . name > newMember < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > ? < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " with " , <nl> - key . name : " e " , <nl> - key . offset : 1872 , <nl> + key . name : " newMember " , <nl> + key . offset : 1880 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> } <nl> ] , <nl> key . doc . full_as_xml : " < Other > < Name > < / Name > < Declaration > extension FooRuncingOptions where RawValue : BitwiseOperations < / Declaration > < Abstract > < Para > < codeVoice > OptionSet < / codeVoice > requirements for which default implementations are supplied when < codeVoice > RawValue < / codeVoice > conforms to < codeVoice > BitwiseOperations < / codeVoice > , which is the usual case . Each distinct bit of an option set ’ s < codeVoice > . rawValue < / codeVoice > corresponds to a disjoint value of the < codeVoice > OptionSet < / codeVoice > . < / Para > < / Abstract > < Discussion > < Note > < Para > A type conforming to < codeVoice > OptionSet < / codeVoice > can implement any of these initializers or methods , and those implementations will be used in lieu of these defaults . < / Para > < / Note > < List - Bullet > < Item > < Para > < codeVoice > union < / codeVoice > is implemented as a bitwise “ or ” ( < codeVoice > | < / codeVoice > ) of < codeVoice > rawValue < / codeVoice > s < / Para > < / Item > < Item > < Para > < codeVoice > intersection < / codeVoice > is implemented as a bitwise “ and ” ( < codeVoice > & amp ; < / codeVoice > ) of < codeVoice > rawValue < / codeVoice > s < / Para > < / Item > < Item > < Para > < codeVoice > symmetricDifference < / codeVoice > is implemented as a bitwise “ exclusive or ” ( < codeVoice > ^ < / codeVoice > ) of < codeVoice > rawValue < / codeVoice > s < / Para > < / Item > < / List - Bullet > < / Discussion > < / Other > " , <nl> - key . offset : 1890 , <nl> + key . offset : 1898 , <nl> key . length : 208 , <nl> key . extends : { <nl> key . kind : source . lang . swift . ref . struct , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_cFT_x : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_cFT_x " , <nl> key . doc . full_as_xml : " < Function > < Name > init ( ) < / Name > < USR > s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_cFT_x < / USR > < Declaration > convenience init ( ) < / Declaration > < Abstract > < Para > Creates an empty option set . < / Para > < / Abstract > < ResultDiscussion > < Para > An option set that contains no elements . < / Para > < / ResultDiscussion > < Discussion > < Para > This initializer creates an option set with a raw value of zero . < / Para > < / Discussion > < / Function > " , <nl> - key . offset : 1925 , <nl> + key . offset : 1933 , <nl> key . length : 18 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > convenience < / syntaxtype . keyword > < syntaxtype . keyword > init < / syntaxtype . keyword > ( ) < / decl . function . constructor > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " formUnion ( _ : ) " , <nl> key . usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_9formUnionFxT_ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_9formUnionFxT_ " , <nl> - key . doc . full_as_xml : " < Function > < Name > formUnion ( _ : ) < / Name > < USR > s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_9formUnionFxT_ < / USR > < Declaration > mutating func formUnion ( _ other : Self ) < / Declaration > < Abstract > < Para > Inserts the elements of another set into this option set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > An option set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > This method is implemented as a < codeVoice > | < / codeVoice > ( bitwise OR ) operation on the two sets ’ raw values . < / Para > < Postcondition > < Para > < codeVoice > self . isSuperset ( of : other ) < / codeVoice > < / Para > < / Postcondition > < / Discussion > < / Function > " , <nl> - key . offset : 1949 , <nl> + key . doc . full_as_xml : " < Function > < Name > formUnion ( _ : ) < / Name > < USR > s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_9formUnionFxT_ < / USR > < Declaration > mutating func formUnion ( _ other : Self ) < / Declaration > < Abstract > < Para > Inserts the elements of another set into this option set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > An option set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > This method is implemented as a < codeVoice > | < / codeVoice > ( bitwise OR ) operation on the two sets ’ raw values . < / Para > < / Discussion > < / Function > " , <nl> + key . offset : 1957 , <nl> key . length : 38 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > formUnion < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " other " , <nl> - key . offset : 1982 , <nl> + key . offset : 1990 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " formIntersection ( _ : ) " , <nl> key . usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16formIntersectionFxT_ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16formIntersectionFxT_ " , <nl> - key . doc . full_as_xml : " < Function > < Name > formIntersection ( _ : ) < / Name > < USR > s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16formIntersectionFxT_ < / USR > < Declaration > mutating func formIntersection ( _ other : Self ) < / Declaration > < Abstract > < Para > Removes all elements of this option set that are not also present in the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > An option set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > This method is implemented as a < codeVoice > & amp ; < / codeVoice > ( bitwise AND ) operation on the two sets ’ raw values . < / Para > < Postcondition > < Para > < codeVoice > self . isSubset ( of : other ) < / codeVoice > < / Para > < / Postcondition > < / Discussion > < / Function > " , <nl> - key . offset : 1993 , <nl> + key . doc . full_as_xml : " < Function > < Name > formIntersection ( _ : ) < / Name > < USR > s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16formIntersectionFxT_ < / USR > < Declaration > mutating func formIntersection ( _ other : Self ) < / Declaration > < Abstract > < Para > Removes all elements of this option set that are not also present in the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > An option set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > This method is implemented as a < codeVoice > & amp ; < / codeVoice > ( bitwise AND ) operation on the two sets ’ raw values . < / Para > < / Discussion > < / Function > " , <nl> + key . offset : 2001 , <nl> key . length : 45 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > formIntersection < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " other " , <nl> - key . offset : 2033 , <nl> + key . offset : 2041 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_23formSymmetricDifferenceFxT_ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_23formSymmetricDifferenceFxT_ " , <nl> key . doc . full_as_xml : " < Function > < Name > formSymmetricDifference ( _ : ) < / Name > < USR > s : FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_23formSymmetricDifferenceFxT_ < / USR > < Declaration > mutating func formSymmetricDifference ( _ other : Self ) < / Declaration > < Abstract > < Para > Replaces this set with a new set containing all elements contained in either this set or the given set , but not in both . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > An option set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > This method is implemented as a < codeVoice > ^ < / codeVoice > ( bitwise XOR ) operation on the two sets ’ raw values . < / Para > < / Discussion > < / Function > " , <nl> - key . offset : 2044 , <nl> + key . offset : 2052 , <nl> key . length : 52 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > formSymmetricDifference < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs9OptionSet4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " other " , <nl> - key . offset : 2091 , <nl> + key . offset : 2099 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> { <nl> key . kind : source . lang . swift . decl . extension . struct , <nl> key . doc . full_as_xml : " < Other > < Name > < / Name > < Declaration > extension FooRuncingOptions < / Declaration > < Abstract > < Para > < codeVoice > SetAlgebra < / codeVoice > requirements for which default implementations are supplied . < / Para > < / Abstract > < Discussion > < Note > < Para > A type conforming to < codeVoice > SetAlgebra < / codeVoice > can implement any of these initializers or methods , and those implementations will be used in lieu of these defaults . < / Para > < / Note > < / Discussion > < / Other > " , <nl> - key . offset : 2100 , <nl> + key . offset : 2108 , <nl> key . length : 553 , <nl> key . extends : { <nl> key . kind : source . lang . swift . ref . struct , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> } <nl> ] , <nl> key . doc . full_as_xml : " < Function > < Name > init ( _ : ) < / Name > < USR > s : FEsPs10SetAlgebracuRd__s8Sequencewx7ElementzWd__8Iterator7Element_rFqd__x < / USR > < Declaration > convenience init & lt ; S : Sequence where S . Iterator . Element = = Element & gt ; ( _ sequence : S ) < / Declaration > < Abstract > < Para > Creates a new set from a finite sequence of items . < / Para > < / Abstract > < Parameters > < Parameter > < Name > sequence < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > The elements to use as members of the new set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > Use this initializer to create a new set from an existing sequence , like an array or a range : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let validIndices = Set ( 0 . . < 7 ) . subtracting ( [ 2 , 4 , 5 ] ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( validIndices ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " [ 6 , 0 , 1 , 3 ] \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2135 , <nl> + key . offset : 2143 , <nl> key . length : 91 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > convenience < / syntaxtype . keyword > < syntaxtype . keyword > init < / syntaxtype . keyword > & lt ; < decl . generic_type_param usr = \ " s : tFEsPs10SetAlgebracuRd__s8Sequencewx7ElementzWd__8Iterator7Element_rFqd__xL_1SMqd__ \ " > < decl . generic_type_param . name > S < / decl . generic_type_param . name > : < decl . generic_type_param . constraint > < ref . protocol usr = \ " s : Ps8Sequence \ " > Sequence < / ref . protocol > < / decl . generic_type_param . constraint > < / decl . generic_type_param > < syntaxtype . keyword > where < / syntaxtype . keyword > < decl . generic_type_requirement > S . Iterator . Element = = FooRuncingOptions < / decl . generic_type_requirement > & gt ; ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > sequence < / decl . var . parameter . name > : < decl . var . parameter . type > S < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " sequence " , <nl> - key . offset : 2224 , <nl> + key . offset : 2232 , <nl> key . length : 1 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " init ( arrayLiteral : ) " , <nl> key . usr : " s : FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x " , <nl> - key . doc . full_as_xml : " < Function > < Name > init ( arrayLiteral : ) < / Name > < USR > s : FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x < / USR > < Declaration > convenience init ( arrayLiteral : Self . Element . . . ) < / Declaration > < Abstract > < Para > Creates a set containing the elements of the given array literal . < / Para > < / Abstract > < Parameters > < Parameter > < Name > arrayLiteral < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A list of elements of the new set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > Don ’ t directly call this initializer , which is used by the compiler when you use an array literal . Instead , create a new set using an array literal as its value by enclosing a comma - separated list of values in square brackets . You can use an array literal anywhere a set is expected by the type context . < / Para > < Para > Here , a set of strings is created from an array literal holding only strings : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let ingredients : Set = [ \ " cocoa beans \ " , \ " sugar \ " , \ " cocoa butter \ " , \ " salt \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ if ingredients . isSupersetOf ( [ \ " sugar \ " , \ " salt \ " ] ) { ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( \ " Whatever it is , it ' s bound to be delicious ! \ " ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ } ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " Whatever it is , it ' s bound to be delicious ! \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2232 , <nl> + key . doc . full_as_xml : " < Function > < Name > init ( arrayLiteral : ) < / Name > < USR > s : FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x < / USR > < Declaration > convenience init ( arrayLiteral : Self . Element . . . ) < / Declaration > < Abstract > < Para > Creates a set containing the elements of the given array literal . < / Para > < / Abstract > < Parameters > < Parameter > < Name > arrayLiteral < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A list of elements of the new set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > Don ’ t directly call this initializer , which is used by the compiler when you use an array literal . Instead , create a new set using an array literal as its value by enclosing a comma - separated list of values in square brackets . You can use an array literal anywhere a set is expected by the type context . < / Para > < Para > Here , a set of strings is created from an array literal holding only strings : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let ingredients : Set = [ \ " cocoa beans \ " , \ " sugar \ " , \ " cocoa butter \ " , \ " salt \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ if ingredients . isSuperset ( of : [ \ " sugar \ " , \ " salt \ " ] ) { ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( \ " Whatever it is , it ' s bound to be delicious ! \ " ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ } ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " Whatever it is , it ' s bound to be delicious ! \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> + key . offset : 2240 , <nl> key . length : 65 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > convenience < / syntaxtype . keyword > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > arrayLiteral < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " c : @ E @ FooRuncingOptions \ " > FooRuncingOptions < / ref . struct > < / decl . var . parameter . type > . . . < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " arrayLiteral " , <nl> key . name : " arrayLiteral " , <nl> - key . offset : 2276 , <nl> + key . offset : 2284 , <nl> key . length : 17 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra8subtractFxT_ : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra8subtractFxT_ " , <nl> key . doc . full_as_xml : " < Function > < Name > subtract ( _ : ) < / Name > < USR > s : FEsPs10SetAlgebra8subtractFxT_ < / USR > < Declaration > mutating func subtract ( _ other : Self ) < / Declaration > < Abstract > < Para > Removes the elements of the given set from this set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < Discussion > < Para > For example : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ var employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let neighbors : Set = [ \ " Bethany \ " , \ " Eric \ " , \ " Forlani \ " , \ " Greta \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ employees . subtract ( neighbors ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( employees ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " [ \ " Diana \ " , \ " Chris \ " , \ " Alicia \ " ] \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2303 , <nl> + key . offset : 2311 , <nl> key . length : 37 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > mutating < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > subtract < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " other " , <nl> - key . offset : 2335 , <nl> + key . offset : 2343 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra8isSubsetFT2ofx_Sb : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra8isSubsetFT2ofx_Sb " , <nl> key . doc . full_as_xml : " < Function > < Name > isSubset ( of : ) < / Name > < USR > s : FEsPs10SetAlgebra8isSubsetFT2ofx_Sb < / USR > < Declaration > func isSubset ( of other : Self ) - & gt ; Bool < / Declaration > < Abstract > < Para > Returns a Boolean value that indicates whether the set is a subset of another set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > true < / codeVoice > if the set is a subset of < codeVoice > other < / codeVoice > ; otherwise , < codeVoice > false < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > Set < emphasis > A < / emphasis > is a subset of another set < emphasis > B < / emphasis > if every member of < emphasis > A < / emphasis > is also a member of < emphasis > B < / emphasis > . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let attendees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Diana \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( attendees . isSubset ( of : employees ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2346 , <nl> + key . offset : 2354 , <nl> key . length : 37 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > isSubset < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > of < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " of " , <nl> key . name : " other " , <nl> - key . offset : 2370 , <nl> + key . offset : 2378 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra10isSupersetFT2ofx_Sb : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra10isSupersetFT2ofx_Sb " , <nl> key . doc . full_as_xml : " < Function > < Name > isSuperset ( of : ) < / Name > < USR > s : FEsPs10SetAlgebra10isSupersetFT2ofx_Sb < / USR > < Declaration > func isSuperset ( of other : Self ) - & gt ; Bool < / Declaration > < Abstract > < Para > Returns a Boolean value that indicates whether the set is a superset of the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > true < / codeVoice > if the set is a superset of < codeVoice > other < / codeVoice > ; otherwise , < codeVoice > false < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > Set < emphasis > A < / emphasis > is a superset of another set < emphasis > B < / emphasis > if every member of < emphasis > B < / emphasis > is also a member of < emphasis > A < / emphasis > . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let attendees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Diana \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( employees . isSuperset ( of : attendees ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2389 , <nl> + key . offset : 2397 , <nl> key . length : 39 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > isSuperset < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > of < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " of " , <nl> key . name : " other " , <nl> - key . offset : 2415 , <nl> + key . offset : 2423 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra10isDisjointFT4withx_Sb : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra10isDisjointFT4withx_Sb " , <nl> key . doc . full_as_xml : " < Function > < Name > isDisjoint ( with : ) < / Name > < USR > s : FEsPs10SetAlgebra10isDisjointFT4withx_Sb < / USR > < Declaration > func isDisjoint ( with other : Self ) - & gt ; Bool < / Declaration > < Abstract > < Para > Returns a Boolean value that indicates whether the set has no members in common with the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > true < / codeVoice > if the set has no elements in common with < codeVoice > other < / codeVoice > ; otherwise , < codeVoice > false < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > For example : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let visitors : Set = [ \ " Marcia \ " , \ " Nathaniel \ " , \ " Olivia \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( employees . isDisjoint ( with : visitors ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2434 , <nl> + key . offset : 2442 , <nl> key . length : 41 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > isDisjoint < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > with < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " with " , <nl> key . name : " other " , <nl> - key . offset : 2462 , <nl> + key . offset : 2470 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra11subtractingFxx : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra11subtractingFxx " , <nl> key . doc . full_as_xml : " < Function > < Name > subtracting ( _ : ) < / Name > < USR > s : FEsPs10SetAlgebra11subtractingFxx < / USR > < Declaration > func subtracting ( _ other : Self ) - & gt ; Self < / Declaration > < Abstract > < Para > Returns a new set containing the elements of this set that do not occur in the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > A new set . < / Para > < / ResultDiscussion > < Discussion > < Para > For example : < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let neighbors : Set = [ \ " Bethany \ " , \ " Eric \ " , \ " Forlani \ " , \ " Greta \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let nonNeighbors = employees . subtract ( neighbors ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( nonNeighbors ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " [ \ " Diana \ " , \ " Chris \ " , \ " Alicia \ " ] \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2481 , <nl> + key . offset : 2489 , <nl> key . length : 39 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > subtracting < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " other " , <nl> - key . offset : 2507 , <nl> + key . offset : 2515 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : vEsPs10SetAlgebra7isEmptySb : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : vEsPs10SetAlgebra7isEmptySb " , <nl> key . doc . full_as_xml : " < Other > < Name > isEmpty < / Name > < USR > s : vEsPs10SetAlgebra7isEmptySb < / USR > < Declaration > var isEmpty : Bool { get } < / Declaration > < Abstract > < Para > A Boolean value that indicates whether the set has no elements . < / Para > < / Abstract > < / Other > " , <nl> - key . offset : 2526 , <nl> + key . offset : 2534 , <nl> key . length : 25 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > isEmpty < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra16isStrictSupersetFT2ofx_Sb : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra16isStrictSupersetFT2ofx_Sb " , <nl> key . doc . full_as_xml : " < Function > < Name > isStrictSuperset ( of : ) < / Name > < USR > s : FEsPs10SetAlgebra16isStrictSupersetFT2ofx_Sb < / USR > < Declaration > func isStrictSuperset ( of other : Self ) - & gt ; Bool < / Declaration > < Abstract > < Para > Returns a Boolean value that indicates whether this set is a strict superset of the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > true < / codeVoice > if the set is a strict superset of < codeVoice > other < / codeVoice > ; otherwise , < codeVoice > false < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > Set < emphasis > A < / emphasis > is a strict superset of another set < emphasis > B < / emphasis > if every member of < emphasis > B < / emphasis > is also a member of < emphasis > A < / emphasis > and < emphasis > A < / emphasis > contains at least one element that is < emphasis > not < / emphasis > a member of < emphasis > B < / emphasis > . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let attendees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Diana \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( employees . isStrictSuperset ( of : attendees ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( employees . isStrictSuperset ( of : employees ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " false \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2557 , <nl> + key . offset : 2565 , <nl> key . length : 45 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > isStrictSuperset < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > of < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " of " , <nl> key . name : " other " , <nl> - key . offset : 2589 , <nl> + key . offset : 2597 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . usr : " s : FEsPs10SetAlgebra14isStrictSubsetFT2ofx_Sb : : SYNTHESIZED : : c : @ E @ FooRuncingOptions " , <nl> key . original_usr : " s : FEsPs10SetAlgebra14isStrictSubsetFT2ofx_Sb " , <nl> key . doc . full_as_xml : " < Function > < Name > isStrictSubset ( of : ) < / Name > < USR > s : FEsPs10SetAlgebra14isStrictSubsetFT2ofx_Sb < / USR > < Declaration > func isStrictSubset ( of other : Self ) - & gt ; Bool < / Declaration > < Abstract > < Para > Returns a Boolean value that indicates whether this set is a strict subset of the given set . < / Para > < / Abstract > < Parameters > < Parameter > < Name > other < / Name > < Direction isExplicit = \ " 0 \ " > in < / Direction > < Discussion > < Para > A set of the same type as the current set . < / Para > < / Discussion > < / Parameter > < / Parameters > < ResultDiscussion > < Para > < codeVoice > true < / codeVoice > if the set is a strict subset of < codeVoice > other < / codeVoice > ; otherwise , < codeVoice > false < / codeVoice > . < / Para > < / ResultDiscussion > < Discussion > < Para > Set < emphasis > A < / emphasis > is a strict subset of another set < emphasis > B < / emphasis > if every member of < emphasis > A < / emphasis > is also a member of < emphasis > B < / emphasis > and < emphasis > B < / emphasis > contains at least one element that is not a member of < emphasis > A < / emphasis > . < / Para > < CodeListing language = \ " swift \ " > < zCodeLineNumbered > < ! [ CDATA [ let employees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Chris \ " , \ " Diana \ " , \ " Eric \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ let attendees : Set = [ \ " Alicia \ " , \ " Bethany \ " , \ " Diana \ " ] ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( attendees . isStrictSubset ( of : employees ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " true \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / A set is never a strict subset of itself : ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ print ( attendees . isStrictSubset ( of : attendees ) ) ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < ! [ CDATA [ / / Prints \ " false \ " ] ] > < / zCodeLineNumbered > < zCodeLineNumbered > < / zCodeLineNumbered > < / CodeListing > < / Discussion > < / Function > " , <nl> - key . offset : 2608 , <nl> + key . offset : 2616 , <nl> key . length : 43 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > isStrictSubset < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > of < / decl . var . parameter . argument_label > < decl . var . parameter . name > other < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . generic_type_param usr = \ " s : tPs10SetAlgebra4SelfMx \ " > Self < / ref . generic_type_param > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Sb \ " > Bool < / ref . struct > < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " of " , <nl> key . name : " other " , <nl> - key . offset : 2638 , <nl> + key . offset : 2646 , <nl> key . length : 4 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . struct , <nl> key . name : " FooStruct1 " , <nl> key . usr : " c : @ S @ FooStruct1 " , <nl> - key . offset : 2654 , <nl> + key . offset : 2662 , <nl> key . length : 105 , <nl> key . fully_annotated_decl : " < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > FooStruct1 < / decl . name > < / decl . struct > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " x " , <nl> key . usr : " c : @ S @ FooStruct1 @ FI @ x " , <nl> - key . offset : 2679 , <nl> + key . offset : 2687 , <nl> key . length : 12 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > x < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " y " , <nl> key . usr : " c : @ S @ FooStruct1 @ FI @ y " , <nl> - key . offset : 2697 , <nl> + key . offset : 2705 , <nl> key . length : 13 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > y < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( ) " , <nl> key . usr : " s : FVSC10FooStruct1cFT_S_ " , <nl> - key . offset : 2716 , <nl> + key . offset : 2724 , <nl> key . length : 6 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( ) < / decl . function . constructor > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( x : y : ) " , <nl> key . usr : " s : FVSC10FooStruct1cFT1xVs5Int321ySd_S_ " , <nl> - key . offset : 2728 , <nl> + key . offset : 2736 , <nl> key . length : 29 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > x < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > y < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " x " , <nl> key . name : " x " , <nl> - key . offset : 2738 , <nl> + key . offset : 2746 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " y " , <nl> key . name : " y " , <nl> - key . offset : 2750 , <nl> + key . offset : 2758 , <nl> key . length : 6 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . struct , <nl> key . name : " FooStruct2 " , <nl> key . usr : " c : @ S @ FooStruct2 " , <nl> - key . offset : 2760 , <nl> + key . offset : 2768 , <nl> key . length : 105 , <nl> key . fully_annotated_decl : " < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > FooStruct2 < / decl . name > < / decl . struct > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " x " , <nl> key . usr : " c : @ S @ FooStruct2 @ FI @ x " , <nl> - key . offset : 2785 , <nl> + key . offset : 2793 , <nl> key . length : 12 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > x < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " y " , <nl> key . usr : " c : @ S @ FooStruct2 @ FI @ y " , <nl> - key . offset : 2803 , <nl> + key . offset : 2811 , <nl> key . length : 13 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > y < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( ) " , <nl> key . usr : " s : FVSC10FooStruct2cFT_S_ " , <nl> - key . offset : 2822 , <nl> + key . offset : 2830 , <nl> key . length : 6 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( ) < / decl . function . constructor > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( x : y : ) " , <nl> key . usr : " s : FVSC10FooStruct2cFT1xVs5Int321ySd_S_ " , <nl> - key . offset : 2834 , <nl> + key . offset : 2842 , <nl> key . length : 29 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > x < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > y < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " x " , <nl> key . name : " x " , <nl> - key . offset : 2844 , <nl> + key . offset : 2852 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " y " , <nl> key . name : " y " , <nl> - key . offset : 2856 , <nl> + key . offset : 2864 , <nl> key . length : 6 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . typealias , <nl> key . name : " FooStructTypedef1 " , <nl> key . usr : " c : Foo . h @ T @ FooStructTypedef1 " , <nl> - key . offset : 2866 , <nl> + key . offset : 2874 , <nl> key . length : 40 , <nl> key . fully_annotated_decl : " < decl . typealias > < syntaxtype . keyword > typealias < / syntaxtype . keyword > < decl . name > FooStructTypedef1 < / decl . name > = < ref . struct usr = \ " c : @ S @ FooStruct2 \ " > FooStruct2 < / ref . struct > < / decl . typealias > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . struct , <nl> key . name : " FooStructTypedef2 " , <nl> key . usr : " c : @ SA @ FooStructTypedef2 " , <nl> - key . offset : 2907 , <nl> + key . offset : 2915 , <nl> key . length : 112 , <nl> key . fully_annotated_decl : " < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > FooStructTypedef2 < / decl . name > < / decl . struct > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " x " , <nl> key . usr : " c : @ SA @ FooStructTypedef2 @ FI @ x " , <nl> - key . offset : 2939 , <nl> + key . offset : 2947 , <nl> key . length : 12 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > x < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " y " , <nl> key . usr : " c : @ SA @ FooStructTypedef2 @ FI @ y " , <nl> - key . offset : 2957 , <nl> + key . offset : 2965 , <nl> key . length : 13 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > y < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( ) " , <nl> key . usr : " s : FVSC17FooStructTypedef2cFT_S_ " , <nl> - key . offset : 2976 , <nl> + key . offset : 2984 , <nl> key . length : 6 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( ) < / decl . function . constructor > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( x : y : ) " , <nl> key . usr : " s : FVSC17FooStructTypedef2cFT1xVs5Int321ySd_S_ " , <nl> - key . offset : 2988 , <nl> + key . offset : 2996 , <nl> key . length : 29 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > x < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > y < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " x " , <nl> key . name : " x " , <nl> - key . offset : 2998 , <nl> + key . offset : 3006 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " y " , <nl> key . name : " y " , <nl> - key . offset : 3010 , <nl> + key . offset : 3018 , <nl> key . length : 6 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " FooTypedef1 " , <nl> key . usr : " c : Foo . h @ T @ FooTypedef1 " , <nl> key . doc . full_as_xml : " < Typedef file = Foo . h line = \ " 59 \ " column = \ " 13 \ " > < Name > FooTypedef1 < / Name > < USR > c : Foo . h @ T @ FooTypedef1 < / USR > < Declaration > typealias FooTypedef1 = Int32 < / Declaration > < Abstract > < Para > Aaa . FooTypedef1 . Bbb . < / Para > < / Abstract > < / Typedef > " , <nl> - key . offset : 3020 , <nl> + key . offset : 3028 , <nl> key . length : 29 , <nl> key . fully_annotated_decl : " < decl . typealias > < syntaxtype . keyword > typealias < / syntaxtype . keyword > < decl . name > FooTypedef1 < / decl . name > = < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . typealias > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooIntVar " , <nl> key . usr : " c : @ fooIntVar " , <nl> key . doc . full_as_xml : " < Variable file = Foo . h line = \ " 62 \ " column = \ " 12 \ " > < Name > fooIntVar < / Name > < USR > c : @ fooIntVar < / USR > < Declaration > var fooIntVar : Int32 < / Declaration > < Abstract > < Para > Aaa . fooIntVar . Bbb . < / Para > < / Abstract > < / Variable > " , <nl> - key . offset : 3050 , <nl> + key . offset : 3058 , <nl> key . length : 20 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooIntVar < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooFunc1 ( _ : ) " , <nl> key . usr : " c : @ F @ fooFunc1 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 65 \ " column = \ " 5 \ " > < Name > fooFunc1 < / Name > < USR > c : @ F @ fooFunc1 < / USR > < Declaration > func fooFunc1 ( _ a : Int32 ) - > Int32 < / Declaration > < Abstract > < Para > Aaa . fooFunc1 . Bbb . < / Para > < / Abstract > < / Function > " , <nl> - key . offset : 3071 , <nl> + key . offset : 3079 , <nl> key . length : 34 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFunc1 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > a < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > < / decl . function . free > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " a " , <nl> - key . offset : 3090 , <nl> + key . offset : 3098 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooFunc1AnonymousParam ( _ : ) " , <nl> key . usr : " c : @ F @ fooFunc1AnonymousParam " , <nl> - key . offset : 3106 , <nl> + key . offset : 3114 , <nl> key . length : 48 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFunc1AnonymousParam < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > < / decl . function . free > " , <nl> key . entities : [ <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> - key . offset : 3139 , <nl> + key . offset : 3147 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooFunc3 ( _ : _ : _ : _ : ) " , <nl> key . usr : " c : @ F @ fooFunc3 " , <nl> - key . offset : 3155 , <nl> + key . offset : 3163 , <nl> key . length : 94 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFunc3 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > a < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > b < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sf \ " > Float < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > c < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sd \ " > Double < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > d < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sp \ " > UnsafeMutablePointer < / ref . struct > & lt ; < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > & gt ; ! < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > < / decl . function . free > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " a " , <nl> - key . offset : 3174 , <nl> + key . offset : 3182 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " b " , <nl> - key . offset : 3186 , <nl> + key . offset : 3194 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " c " , <nl> - key . offset : 3198 , <nl> + key . offset : 3206 , <nl> key . length : 6 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " d " , <nl> - key . offset : 3211 , <nl> + key . offset : 3219 , <nl> key . length : 28 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooFuncWithBlock ( _ : ) " , <nl> key . usr : " c : @ F @ fooFuncWithBlock " , <nl> - key . offset : 3250 , <nl> + key . offset : 3258 , <nl> key . length : 49 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithBlock < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > blk < / decl . var . parameter . name > : < decl . var . parameter . type > ( ( < ref . struct usr = \ " s : Sf \ " > Float < / ref . struct > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > ) ! < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . free > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " blk " , <nl> - key . offset : 3279 , <nl> + key . offset : 3287 , <nl> key . length : 19 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooFuncWithFunctionPointer ( _ : ) " , <nl> key . usr : " c : @ F @ fooFuncWithFunctionPointer " , <nl> - key . offset : 3300 , <nl> + key . offset : 3308 , <nl> key . length : 60 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithFunctionPointer < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > fptr < / decl . var . parameter . name > : < decl . var . parameter . type > ( ( < ref . struct usr = \ " s : Sf \ " > Float < / ref . struct > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > ) ! < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . free > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " fptr " , <nl> - key . offset : 3340 , <nl> + key . offset : 3348 , <nl> key . length : 19 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooFuncNoreturn1 ( ) " , <nl> key . usr : " c : @ F @ fooFuncNoreturn1 " , <nl> - key . offset : 3361 , <nl> + key . offset : 3369 , <nl> key . length : 33 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . attribute . builtin > < syntaxtype . attribute . name > @ noreturn < / syntaxtype . attribute . name > < / syntaxtype . attribute . builtin > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncNoreturn1 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooFuncNoreturn2 ( ) " , <nl> key . usr : " c : @ F @ fooFuncNoreturn2 " , <nl> - key . offset : 3395 , <nl> + key . offset : 3403 , <nl> key . length : 33 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . attribute . builtin > < syntaxtype . attribute . name > @ noreturn < / syntaxtype . attribute . name > < / syntaxtype . attribute . builtin > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncNoreturn2 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooFuncWithComment1 ( ) " , <nl> key . usr : " c : @ F @ fooFuncWithComment1 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 88 \ " column = \ " 6 \ " > < Name > fooFuncWithComment1 < / Name > < USR > c : @ F @ fooFuncWithComment1 < / USR > < Declaration > func fooFuncWithComment1 ( ) < / Declaration > < Abstract > < Para > Aaa . fooFuncWithComment1 . Bbb . Ccc . < / Para > < / Abstract > < Discussion > < Para > Ddd . < / Para > < / Discussion > < / Function > " , <nl> - key . offset : 3429 , <nl> + key . offset : 3437 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithComment1 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooFuncWithComment2 ( ) " , <nl> key . usr : " c : @ F @ fooFuncWithComment2 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 93 \ " column = \ " 6 \ " > < Name > fooFuncWithComment2 < / Name > < USR > c : @ F @ fooFuncWithComment2 < / USR > < Declaration > func fooFuncWithComment2 ( ) < / Declaration > < Abstract > < Para > Aaa . fooFuncWithComment2 . Bbb . < / Para > < / Abstract > < / Function > " , <nl> - key . offset : 3456 , <nl> + key . offset : 3464 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithComment2 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooFuncWithComment3 ( ) " , <nl> key . usr : " c : @ F @ fooFuncWithComment3 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 101 \ " column = \ " 6 \ " > < Name > fooFuncWithComment3 < / Name > < USR > c : @ F @ fooFuncWithComment3 < / USR > < Declaration > func fooFuncWithComment3 ( ) < / Declaration > < Abstract > < Para > Aaa . fooFuncWithComment3 . Bbb . < / Para > < / Abstract > < Discussion > < Para > Ccc . < / Para > < / Discussion > < / Function > " , <nl> - key . offset : 3483 , <nl> + key . offset : 3491 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithComment3 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooFuncWithComment4 ( ) " , <nl> key . usr : " c : @ F @ fooFuncWithComment4 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 107 \ " column = \ " 6 \ " > < Name > fooFuncWithComment4 < / Name > < USR > c : @ F @ fooFuncWithComment4 < / USR > < Declaration > func fooFuncWithComment4 ( ) < / Declaration > < Abstract > < Para > Aaa . fooFuncWithComment4 . Bbb . < / Para > < / Abstract > < Discussion > < Para > Ddd . < / Para > < / Discussion > < / Function > " , <nl> - key . offset : 3510 , <nl> + key . offset : 3518 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithComment4 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooFuncWithComment5 ( ) " , <nl> key . usr : " c : @ F @ fooFuncWithComment5 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 113 \ " column = \ " 6 \ " > < Name > fooFuncWithComment5 < / Name > < USR > c : @ F @ fooFuncWithComment5 < / USR > < Declaration > func fooFuncWithComment5 ( ) < / Declaration > < Abstract > < Para > Aaa . fooFuncWithComment5 . Bbb . Ccc . < / Para > < / Abstract > < Discussion > < Para > Ddd . < / Para > < / Discussion > < / Function > " , <nl> - key . offset : 3537 , <nl> + key . offset : 3545 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooFuncWithComment5 < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " redeclaredInMultipleModulesFunc1 ( _ : ) " , <nl> key . usr : " c : @ F @ redeclaredInMultipleModulesFunc1 " , <nl> key . doc . full_as_xml : " < Function file = Foo . h line = \ " 117 \ " column = \ " 5 \ " > < Name > redeclaredInMultipleModulesFunc1 < / Name > < USR > c : @ F @ redeclaredInMultipleModulesFunc1 < / USR > < Declaration > func redeclaredInMultipleModulesFunc1 ( _ a : Int32 ) - > Int32 < / Declaration > < Abstract > < Para > Aaa . redeclaredInMultipleModulesFunc1 . Bbb . < / Para > < / Abstract > < / Function > " , <nl> - key . offset : 3564 , <nl> + key . offset : 3572 , <nl> key . length : 58 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > redeclaredInMultipleModulesFunc1 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > a < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > < / decl . function . free > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " a " , <nl> - key . offset : 3607 , <nl> + key . offset : 3615 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " FooProtocolBase " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase " , <nl> key . doc . full_as_xml : " < Other file = Foo . h line = \ " 120 \ " column = \ " 11 \ " > < Name > FooProtocolBase < / Name > < USR > c : objc ( pl ) FooProtocolBase < / USR > < Declaration > protocol FooProtocolBase < / Declaration > < Abstract > < Para > Aaa . FooProtocolBase . Bbb . < / Para > < / Abstract > < / Other > " , <nl> - key . offset : 3623 , <nl> + key . offset : 3631 , <nl> key . length : 301 , <nl> key . fully_annotated_decl : " < decl . protocol > < syntaxtype . keyword > protocol < / syntaxtype . keyword > < decl . name > FooProtocolBase < / decl . name > < / decl . protocol > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooProtoFunc ( ) " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( im ) fooProtoFunc " , <nl> key . doc . full_as_xml : " < Function isInstanceMethod = \ " 1 \ " file = Foo . h line = \ " 124 \ " column = \ " 1 \ " > < Name > fooProtoFunc < / Name > < USR > c : objc ( pl ) FooProtocolBase ( im ) fooProtoFunc < / USR > < Declaration > func fooProtoFunc ( ) < / Declaration > < Abstract > < Para > Aaa . fooProtoFunc . Bbb . Ccc . < / Para > < / Abstract > < / Function > " , <nl> - key . offset : 3655 , <nl> + key . offset : 3663 , <nl> key . length : 19 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooProtoFunc < / decl . name > ( ) < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooProtoFuncWithExtraIndentation1 ( ) " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( im ) fooProtoFuncWithExtraIndentation1 " , <nl> key . doc . full_as_xml : " < Function isInstanceMethod = \ " 1 \ " file = Foo . h line = \ " 128 \ " column = \ " 3 \ " > < Name > fooProtoFuncWithExtraIndentation1 < / Name > < USR > c : objc ( pl ) FooProtocolBase ( im ) fooProtoFuncWithExtraIndentation1 < / USR > < Declaration > func fooProtoFuncWithExtraIndentation1 ( ) < / Declaration > < Abstract > < Para > Aaa . fooProtoFuncWithExtraIndentation1 . Bbb . Ccc . < / Para > < / Abstract > < / Function > " , <nl> - key . offset : 3680 , <nl> + key . offset : 3688 , <nl> key . length : 40 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooProtoFuncWithExtraIndentation1 < / decl . name > ( ) < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " fooProtoFuncWithExtraIndentation2 ( ) " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( im ) fooProtoFuncWithExtraIndentation2 " , <nl> key . doc . full_as_xml : " < Function isInstanceMethod = \ " 1 \ " file = Foo . h line = \ " 134 \ " column = \ " 3 \ " > < Name > fooProtoFuncWithExtraIndentation2 < / Name > < USR > c : objc ( pl ) FooProtocolBase ( im ) fooProtoFuncWithExtraIndentation2 < / USR > < Declaration > func fooProtoFuncWithExtraIndentation2 ( ) < / Declaration > < Abstract > < Para > Aaa . fooProtoFuncWithExtraIndentation2 . Bbb . Ccc . < / Para > < / Abstract > < / Function > " , <nl> - key . offset : 3726 , <nl> + key . offset : 3734 , <nl> key . length : 40 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooProtoFuncWithExtraIndentation2 < / decl . name > ( ) < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . static , <nl> key . name : " fooProtoClassFunc ( ) " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( cm ) fooProtoClassFunc " , <nl> - key . offset : 3772 , <nl> + key . offset : 3780 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . function . method . static > < syntaxtype . keyword > static < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooProtoClassFunc < / decl . name > ( ) < / decl . function . method . static > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " fooProperty1 " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( py ) fooProperty1 " , <nl> - key . offset : 3809 , <nl> + key . offset : 3817 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooProperty1 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " fooProperty2 " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( py ) fooProperty2 " , <nl> - key . offset : 3850 , <nl> + key . offset : 3858 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooProperty2 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " fooProperty3 " , <nl> key . usr : " c : objc ( pl ) FooProtocolBase ( py ) fooProperty3 " , <nl> - key . offset : 3891 , <nl> + key . offset : 3899 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooProperty3 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . protocol , <nl> key . name : " FooProtocolDerived " , <nl> key . usr : " c : objc ( pl ) FooProtocolDerived " , <nl> - key . offset : 3925 , <nl> + key . offset : 3933 , <nl> key . length : 49 , <nl> key . fully_annotated_decl : " < decl . protocol > < syntaxtype . keyword > protocol < / syntaxtype . keyword > < decl . name > FooProtocolDerived < / decl . name > : < ref . protocol usr = \ " c : objc ( pl ) FooProtocolBase \ " > FooProtocolBase < / ref . protocol > < / decl . protocol > " , <nl> key . conforms : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . class , <nl> key . name : " FooClassBase " , <nl> key . usr : " c : objc ( cs ) FooClassBase " , <nl> - key . offset : 3975 , <nl> + key . offset : 3983 , <nl> key . length : 422 , <nl> key . fully_annotated_decl : " < decl . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < decl . name > FooClassBase < / decl . name > < / decl . class > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooBaseInstanceFunc0 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) fooBaseInstanceFunc0 " , <nl> - key . offset : 4001 , <nl> + key . offset : 4009 , <nl> key . length : 27 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooBaseInstanceFunc0 < / decl . name > ( ) < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooBaseInstanceFunc1 ( _ : ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) fooBaseInstanceFunc1 : " , <nl> - key . offset : 4034 , <nl> + key . offset : 4042 , <nl> key . length : 66 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooBaseInstanceFunc1 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > anObject < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . class usr = \ " c : objc ( cs ) FooClassBase \ " > FooClassBase < / ref . class > ! < / decl . function . returntype > < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " anObject " , <nl> - key . offset : 4072 , <nl> + key . offset : 4080 , <nl> key . length : 10 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) init " , <nl> - key . offset : 4106 , <nl> + key . offset : 4114 , <nl> key . length : 7 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ! ( ) < / decl . function . constructor > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( float : ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) initWithFloat : " , <nl> - key . offset : 4119 , <nl> + key . offset : 4127 , <nl> key . length : 33 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > convenience < / syntaxtype . keyword > < syntaxtype . keyword > init < / syntaxtype . keyword > ! ( < decl . var . parameter > < decl . var . parameter . argument_label > float < / decl . var . parameter . argument_label > < decl . var . parameter . name > f < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Sf \ " > Float < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " float " , <nl> key . name : " f " , <nl> - key . offset : 4146 , <nl> + key . offset : 4154 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooBaseInstanceFuncOverridden ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) fooBaseInstanceFuncOverridden " , <nl> - key . offset : 4158 , <nl> + key . offset : 4166 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooBaseInstanceFuncOverridden < / decl . name > ( ) < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . class , <nl> key . name : " fooBaseClassFunc0 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( cm ) fooBaseClassFunc0 " , <nl> - key . offset : 4200 , <nl> + key . offset : 4208 , <nl> key . length : 30 , <nl> key . fully_annotated_decl : " < decl . function . method . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooBaseClassFunc0 < / decl . name > ( ) < / decl . function . method . class > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " _internalMeth3 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 " , <nl> - key . offset : 4236 , <nl> + key . offset : 4244 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth3 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " _internalMeth2 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 " , <nl> - key . offset : 4277 , <nl> + key . offset : 4285 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth2 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " nonInternalMeth ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth " , <nl> - key . offset : 4318 , <nl> + key . offset : 4326 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > nonInternalMeth < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " _internalMeth1 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 " , <nl> - key . offset : 4360 , <nl> + key . offset : 4368 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth1 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " FooClassDerived " , <nl> key . usr : " c : objc ( cs ) FooClassDerived " , <nl> key . doc . full_as_xml : " < Other file = Foo . h line = \ " 157 \ " column = \ " 12 \ " > < Name > FooClassDerived < / Name > < USR > c : objc ( cs ) FooClassDerived < / USR > < Declaration > class FooClassDerived : FooClassBase , FooProtocolDerived < / Declaration > < Abstract > < Para > Aaa . FooClassDerived . Bbb . < / Para > < / Abstract > < / Other > " , <nl> - key . offset : 4398 , <nl> + key . offset : 4406 , <nl> key . length : 517 , <nl> key . fully_annotated_decl : " < decl . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < decl . name > FooClassDerived < / decl . name > : < ref . class usr = \ " c : objc ( cs ) FooClassBase \ " > FooClassBase < / ref . class > , < ref . protocol usr = \ " c : objc ( pl ) FooProtocolDerived \ " > FooProtocolDerived < / ref . protocol > < / decl . class > " , <nl> key . inherits : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " fooProperty1 " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( py ) fooProperty1 " , <nl> - key . offset : 4462 , <nl> + key . offset : 4470 , <nl> key . length : 23 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooProperty1 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " fooProperty2 " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( py ) fooProperty2 " , <nl> - key . offset : 4491 , <nl> + key . offset : 4499 , <nl> key . length : 23 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooProperty2 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " fooProperty3 " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( py ) fooProperty3 " , <nl> - key . offset : 4520 , <nl> + key . offset : 4528 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooProperty3 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooInstanceFunc0 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( im ) fooInstanceFunc0 " , <nl> - key . offset : 4557 , <nl> + key . offset : 4565 , <nl> key . length : 23 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooInstanceFunc0 < / decl . name > ( ) < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooInstanceFunc1 ( _ : ) " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( im ) fooInstanceFunc1 : " , <nl> - key . offset : 4586 , <nl> + key . offset : 4594 , <nl> key . length : 33 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooInstanceFunc1 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > a < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " a " , <nl> - key . offset : 4613 , <nl> + key . offset : 4621 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooInstanceFunc2 ( _ : withB : ) " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( im ) fooInstanceFunc2 : withB : " , <nl> - key . offset : 4625 , <nl> + key . offset : 4633 , <nl> key . length : 49 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooInstanceFunc2 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > a < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > , < decl . var . parameter > < decl . var . parameter . argument_label > withB < / decl . var . parameter . argument_label > < decl . var . parameter . name > b < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . method . instance > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " a " , <nl> - key . offset : 4652 , <nl> + key . offset : 4660 , <nl> key . length : 5 <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " withB " , <nl> key . name : " b " , <nl> - key . offset : 4668 , <nl> + key . offset : 4676 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " fooBaseInstanceFuncOverridden ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( im ) fooBaseInstanceFuncOverridden " , <nl> - key . offset : 4680 , <nl> + key . offset : 4688 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooBaseInstanceFuncOverridden < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . inherits : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . class , <nl> key . name : " fooClassFunc0 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassDerived ( cm ) fooClassFunc0 " , <nl> - key . offset : 4722 , <nl> + key . offset : 4730 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . function . method . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooClassFunc0 < / decl . name > ( ) < / decl . function . method . class > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth3 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 : : SYNTHESIZED : : c : objc ( cs ) FooClassDerived " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 " , <nl> - key . offset : 4754 , <nl> + key . offset : 4762 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth3 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth2 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 : : SYNTHESIZED : : c : objc ( cs ) FooClassDerived " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 " , <nl> - key . offset : 4795 , <nl> + key . offset : 4803 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth2 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " nonInternalMeth ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth : : SYNTHESIZED : : c : objc ( cs ) FooClassDerived " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth " , <nl> - key . offset : 4836 , <nl> + key . offset : 4844 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > nonInternalMeth < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth1 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 : : SYNTHESIZED : : c : objc ( cs ) FooClassDerived " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 " , <nl> - key . offset : 4878 , <nl> + key . offset : 4886 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth1 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_1 " , <nl> key . usr : " c : Foo . h @ 3647 @ macro @ FOO_MACRO_1 " , <nl> - key . offset : 4916 , <nl> + key . offset : 4924 , <nl> key . length : 30 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_1 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_2 " , <nl> key . usr : " c : Foo . h @ 3669 @ macro @ FOO_MACRO_2 " , <nl> - key . offset : 4947 , <nl> + key . offset : 4955 , <nl> key . length : 30 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_2 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_3 " , <nl> key . usr : " c : Foo . h @ 3691 @ macro @ FOO_MACRO_3 " , <nl> - key . offset : 4978 , <nl> + key . offset : 4986 , <nl> key . length : 30 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_3 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_4 " , <nl> key . usr : " c : Foo . h @ 3755 @ macro @ FOO_MACRO_4 " , <nl> - key . offset : 5009 , <nl> + key . offset : 5017 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_4 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs6UInt32 \ " > UInt32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_5 " , <nl> key . usr : " c : Foo . h @ 3787 @ macro @ FOO_MACRO_5 " , <nl> - key . offset : 5041 , <nl> + key . offset : 5049 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_5 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs6UInt64 \ " > UInt64 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_REDEF_1 " , <nl> key . usr : " c : Foo . h @ 3937 @ macro @ FOO_MACRO_REDEF_1 " , <nl> - key . offset : 5073 , <nl> + key . offset : 5081 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_REDEF_1 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FOO_MACRO_REDEF_2 " , <nl> key . usr : " c : Foo . h @ 3994 @ macro @ FOO_MACRO_REDEF_2 " , <nl> - key . offset : 5110 , <nl> + key . offset : 5118 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FOO_MACRO_REDEF_2 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " theLastDeclInFoo ( ) " , <nl> key . usr : " c : @ F @ theLastDeclInFoo " , <nl> - key . offset : 5147 , <nl> + key . offset : 5155 , <nl> key . length : 23 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > theLastDeclInFoo < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " _internalTopLevelFunc ( ) " , <nl> key . usr : " c : @ F @ _internalTopLevelFunc " , <nl> - key . offset : 5171 , <nl> + key . offset : 5179 , <nl> key . length : 28 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalTopLevelFunc < / decl . name > ( ) < / decl . function . free > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . struct , <nl> key . name : " _InternalStruct " , <nl> key . usr : " c : @ S @ _InternalStruct " , <nl> - key . offset : 5200 , <nl> + key . offset : 5208 , <nl> key . length : 78 , <nl> key . fully_annotated_decl : " < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > _InternalStruct < / decl . name > < / decl . struct > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " x " , <nl> key . usr : " c : @ S @ _InternalStruct @ FI @ x " , <nl> - key . offset : 5230 , <nl> + key . offset : 5238 , <nl> key . length : 12 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > x < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( ) " , <nl> key . usr : " s : FVSC15_InternalStructcFT_S_ " , <nl> - key . offset : 5248 , <nl> + key . offset : 5256 , <nl> key . length : 6 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( ) < / decl . function . constructor > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( x : ) " , <nl> key . usr : " s : FVSC15_InternalStructcFT1xVs5Int32_S_ " , <nl> - key . offset : 5260 , <nl> + key . offset : 5268 , <nl> key . length : 16 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > x < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " x " , <nl> key . name : " x " , <nl> - key . offset : 5270 , <nl> + key . offset : 5278 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . extension . class , <nl> - key . offset : 5279 , <nl> + key . offset : 5287 , <nl> key . length : 67 , <nl> key . extends : { <nl> key . kind : source . lang . swift . ref . class , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " _internalMeth1 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 " , <nl> - key . offset : 5309 , <nl> + key . offset : 5317 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth1 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . extension . class , <nl> - key . offset : 5347 , <nl> + key . offset : 5355 , <nl> key . length : 109 , <nl> key . extends : { <nl> key . kind : source . lang . swift . ref . class , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " _internalMeth2 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 " , <nl> - key . offset : 5377 , <nl> + key . offset : 5385 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth2 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " nonInternalMeth ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth " , <nl> - key . offset : 5418 , <nl> + key . offset : 5426 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > nonInternalMeth < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> } , <nl> { <nl> key . kind : source . lang . swift . decl . extension . class , <nl> - key . offset : 5457 , <nl> + key . offset : 5465 , <nl> key . length : 67 , <nl> key . extends : { <nl> key . kind : source . lang . swift . ref . class , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " _internalMeth3 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 " , <nl> - key . offset : 5487 , <nl> + key . offset : 5495 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth3 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . protocol , <nl> key . name : " _InternalProt " , <nl> key . usr : " c : objc ( pl ) _InternalProt " , <nl> - key . offset : 5525 , <nl> + key . offset : 5533 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . protocol > < syntaxtype . keyword > protocol < / syntaxtype . keyword > < decl . name > _InternalProt < / decl . name > < / decl . protocol > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . class , <nl> key . name : " ClassWithInternalProt " , <nl> key . usr : " c : objc ( cs ) ClassWithInternalProt " , <nl> - key . offset : 5552 , <nl> + key . offset : 5560 , <nl> key . length : 47 , <nl> key . fully_annotated_decl : " < decl . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < decl . name > ClassWithInternalProt < / decl . name > : < ref . protocol usr = \ " c : objc ( pl ) _InternalProt \ " > _InternalProt < / ref . protocol > < / decl . class > " , <nl> key . conforms : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . class , <nl> key . name : " FooClassPropertyOwnership " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership " , <nl> - key . offset : 5600 , <nl> + key . offset : 5608 , <nl> key . length : 478 , <nl> key . fully_annotated_decl : " < decl . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < decl . name > FooClassPropertyOwnership < / decl . name > : < ref . class usr = \ " c : objc ( cs ) FooClassBase \ " > FooClassBase < / ref . class > < / decl . class > " , <nl> key . inherits : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " assignable " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) assignable " , <nl> - key . offset : 5654 , <nl> + key . offset : 5662 , <nl> key . length : 42 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > unowned ( unsafe ) < / syntaxtype . keyword > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > assignable < / decl . name > : < decl . var . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " unsafeAssignable " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) unsafeAssignable " , <nl> - key . offset : 5702 , <nl> + key . offset : 5710 , <nl> key . length : 48 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > unowned ( unsafe ) < / syntaxtype . keyword > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > unsafeAssignable < / decl . name > : < decl . var . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " retainable " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) retainable " , <nl> - key . offset : 5756 , <nl> + key . offset : 5764 , <nl> key . length : 26 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > retainable < / decl . name > : < decl . var . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " strongRef " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) strongRef " , <nl> - key . offset : 5788 , <nl> + key . offset : 5796 , <nl> key . length : 25 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > strongRef < / decl . name > : < decl . var . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " copyable " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) copyable " , <nl> - key . offset : 5819 , <nl> + key . offset : 5827 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . attribute . builtin > < syntaxtype . attribute . name > @ NSCopying < / syntaxtype . attribute . name > < / syntaxtype . attribute . builtin > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > copyable < / decl . name > : < decl . var . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " weakRef " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) weakRef " , <nl> - key . offset : 5860 , <nl> + key . offset : 5868 , <nl> key . length : 28 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > weak < / syntaxtype . keyword > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > weakRef < / decl . name > : < decl . var . type > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " scalar " , <nl> key . usr : " c : objc ( cs ) FooClassPropertyOwnership ( py ) scalar " , <nl> - key . offset : 5894 , <nl> + key . offset : 5902 , <nl> key . length : 17 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > scalar < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > < syntaxtype . keyword > set < / syntaxtype . keyword > } < / decl . var . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth3 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 : : SYNTHESIZED : : c : objc ( cs ) FooClassPropertyOwnership " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 " , <nl> - key . offset : 5917 , <nl> + key . offset : 5925 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth3 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth2 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 : : SYNTHESIZED : : c : objc ( cs ) FooClassPropertyOwnership " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 " , <nl> - key . offset : 5958 , <nl> + key . offset : 5966 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth2 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " nonInternalMeth ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth : : SYNTHESIZED : : c : objc ( cs ) FooClassPropertyOwnership " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth " , <nl> - key . offset : 5999 , <nl> + key . offset : 6007 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > nonInternalMeth < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth1 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 : : SYNTHESIZED : : c : objc ( cs ) FooClassPropertyOwnership " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 " , <nl> - key . offset : 6041 , <nl> + key . offset : 6049 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth1 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . class , <nl> key . name : " FooUnavailableMembers " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers " , <nl> - key . offset : 6079 , <nl> + key . offset : 6087 , <nl> key . length : 661 , <nl> key . fully_annotated_decl : " < decl . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < decl . name > FooUnavailableMembers < / decl . name > : < ref . class usr = \ " c : objc ( cs ) FooClassBase \ " > FooClassBase < / ref . class > < / decl . class > " , <nl> key . inherits : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( int : ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( cm ) unavailableMembersWithInt : " , <nl> - key . offset : 6129 , <nl> + key . offset : 6137 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > convenience < / syntaxtype . keyword > < syntaxtype . keyword > init < / syntaxtype . keyword > ! ( < decl . var . parameter > < decl . var . parameter . argument_label > int < / decl . var . parameter . argument_label > < decl . var . parameter . name > i < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " int " , <nl> key . name : " i " , <nl> - key . offset : 6154 , <nl> + key . offset : 6162 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . class , <nl> key . name : " withInt ( _ : ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( cm ) unavailableMembersWithInt : " , <nl> - key . offset : 6166 , <nl> + key . offset : 6174 , <nl> key . length : 39 , <nl> key . fully_annotated_decl : " < decl . function . method . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > withInt < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > i < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . class usr = \ " c : objc ( cs ) FooUnavailableMembers \ " > Self < / ref . class > ! < / decl . function . returntype > < / decl . function . method . class > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " i " , <nl> - key . offset : 6190 , <nl> + key . offset : 6198 , <nl> key . length : 5 <nl> } <nl> ] , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " unavailable ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) unavailable " , <nl> - key . offset : 6211 , <nl> + key . offset : 6219 , <nl> key . length : 18 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > unavailable < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " swiftUnavailable ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) swiftUnavailable " , <nl> - key . offset : 6235 , <nl> + key . offset : 6243 , <nl> key . length : 23 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > swiftUnavailable < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " deprecated ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) deprecated " , <nl> - key . offset : 6264 , <nl> + key . offset : 6272 , <nl> key . length : 17 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > deprecated < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityIntroduced ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityIntroduced " , <nl> - key . offset : 6287 , <nl> + key . offset : 6295 , <nl> key . length : 29 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityIntroduced < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityDeprecated ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityDeprecated " , <nl> - key . offset : 6322 , <nl> + key . offset : 6330 , <nl> key . length : 29 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityDeprecated < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityObsoleted ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityObsoleted " , <nl> - key . offset : 6357 , <nl> + key . offset : 6365 , <nl> key . length : 28 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityObsoleted < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityUnavailable ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityUnavailable " , <nl> - key . offset : 6391 , <nl> + key . offset : 6399 , <nl> key . length : 30 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityUnavailable < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityIntroducedMsg ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityIntroducedMsg " , <nl> - key . offset : 6427 , <nl> + key . offset : 6435 , <nl> key . length : 32 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityIntroducedMsg < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityDeprecatedMsg ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityDeprecatedMsg " , <nl> - key . offset : 6465 , <nl> + key . offset : 6473 , <nl> key . length : 32 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityDeprecatedMsg < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityObsoletedMsg ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityObsoletedMsg " , <nl> - key . offset : 6503 , <nl> + key . offset : 6511 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityObsoletedMsg < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . method . instance , <nl> key . name : " availabilityUnavailableMsg ( ) " , <nl> key . usr : " c : objc ( cs ) FooUnavailableMembers ( im ) availabilityUnavailableMsg " , <nl> - key . offset : 6540 , <nl> + key . offset : 6548 , <nl> key . length : 33 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > availabilityUnavailableMsg < / decl . name > ( ) < / decl . function . method . instance > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth3 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 : : SYNTHESIZED : : c : objc ( cs ) FooUnavailableMembers " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth3 " , <nl> - key . offset : 6579 , <nl> + key . offset : 6587 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth3 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth2 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 : : SYNTHESIZED : : c : objc ( cs ) FooUnavailableMembers " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth2 " , <nl> - key . offset : 6620 , <nl> + key . offset : 6628 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth2 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " nonInternalMeth ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth : : SYNTHESIZED : : c : objc ( cs ) FooUnavailableMembers " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) nonInternalMeth " , <nl> - key . offset : 6661 , <nl> + key . offset : 6669 , <nl> key . length : 36 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > nonInternalMeth < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . name : " _internalMeth1 ( ) " , <nl> key . usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 : : SYNTHESIZED : : c : objc ( cs ) FooUnavailableMembers " , <nl> key . original_usr : " c : objc ( cs ) FooClassBase ( im ) _internalMeth1 " , <nl> - key . offset : 6703 , <nl> + key . offset : 6711 , <nl> key . length : 35 , <nl> key . fully_annotated_decl : " < decl . function . method . instance > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > _internalMeth1 < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . protocol usr = \ " s : Ps9AnyObject \ " > AnyObject < / ref . protocol > ! < / decl . function . returntype > < / decl . function . method . instance > " <nl> } <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . typealias , <nl> key . name : " FooCFTypeRef " , <nl> key . usr : " c : Foo . h @ T @ FooCFTypeRef " , <nl> - key . offset : 6741 , <nl> + key . offset : 6749 , <nl> key . length : 34 , <nl> key . fully_annotated_decl : " < decl . typealias > < syntaxtype . keyword > typealias < / syntaxtype . keyword > < decl . name > FooCFTypeRef < / decl . name > = < ref . class usr = \ " c : Foo . h @ T @ FooCFTypeRef \ " > FooCFType < / ref . class > < / decl . typealias > " , <nl> key . attributes : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . class , <nl> key . name : " FooCFType " , <nl> key . usr : " c : Foo . h @ T @ FooCFTypeRef " , <nl> - key . offset : 6776 , <nl> + key . offset : 6784 , <nl> key . length : 19 , <nl> key . fully_annotated_decl : " < decl . class > < syntaxtype . keyword > class < / syntaxtype . keyword > < decl . name > FooCFType < / decl . name > < / decl . class > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " FooCFTypeRelease ( _ : ) " , <nl> key . usr : " c : @ F @ FooCFTypeRelease " , <nl> - key . offset : 6796 , <nl> + key . offset : 6804 , <nl> key . length : 38 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > FooCFTypeRelease < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . class usr = \ " c : Foo . h @ T @ FooCFTypeRef \ " > FooCFType < / ref . class > ! < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . free > " , <nl> key . entities : [ <nl> { <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> - key . offset : 6823 , <nl> + key . offset : 6831 , <nl> key . length : 10 <nl> } <nl> ] , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . free , <nl> key . name : " fooSubFunc1 ( _ : ) " , <nl> key . usr : " c : @ F @ fooSubFunc1 " , <nl> - key . offset : 6835 , <nl> + key . offset : 6843 , <nl> key . length : 37 , <nl> key . fully_annotated_decl : " < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooSubFunc1 < / decl . name > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > a < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) - & gt ; < decl . function . returntype > < ref . struct usr = \ " s : Vs5Int32 \ " > Int32 < / ref . struct > < / decl . function . returntype > < / decl . function . free > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " a " , <nl> - key . offset : 6857 , <nl> + key . offset : 6865 , <nl> key . length : 5 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . struct , <nl> key . name : " FooSubEnum1 " , <nl> key . usr : " c : @ E @ FooSubEnum1 " , <nl> - key . offset : 6873 , <nl> + key . offset : 6881 , <nl> key . length : 145 , <nl> key . fully_annotated_decl : " < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > FooSubEnum1 < / decl . name > : < ref . protocol usr = \ " s : Ps16RawRepresentable \ " > RawRepresentable < / ref . protocol > , < ref . protocol usr = \ " s : Ps9Equatable \ " > Equatable < / ref . protocol > < / decl . struct > " , <nl> key . conforms : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( _ : ) " , <nl> key . usr : " s : FVSC11FooSubEnum1cFVs6UInt32S_ " , <nl> - key . offset : 6929 , <nl> + key . offset : 6937 , <nl> key . length : 24 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > _ < / decl . var . parameter . argument_label > < decl . var . parameter . name > rawValue < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs6UInt32 \ " > UInt32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . entities : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " _ " , <nl> key . name : " rawValue " , <nl> - key . offset : 6946 , <nl> + key . offset : 6954 , <nl> key . length : 6 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . function . constructor , <nl> key . name : " init ( rawValue : ) " , <nl> key . usr : " s : FVSC11FooSubEnum1cFT8rawValueVs6UInt32_S_ " , <nl> - key . offset : 6959 , <nl> + key . offset : 6967 , <nl> key . length : 31 , <nl> key . fully_annotated_decl : " < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > rawValue < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = \ " s : Vs6UInt32 \ " > UInt32 < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > " , <nl> key . conforms : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . local , <nl> key . keyword : " rawValue " , <nl> key . name : " rawValue " , <nl> - key . offset : 6983 , <nl> + key . offset : 6991 , <nl> key . length : 6 <nl> } <nl> ] <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . instance , <nl> key . name : " rawValue " , <nl> key . usr : " s : vVSC11FooSubEnum18rawValueVs6UInt32 " , <nl> - key . offset : 6996 , <nl> + key . offset : 7004 , <nl> key . length : 20 , <nl> key . fully_annotated_decl : " < decl . var . instance > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > rawValue < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Vs6UInt32 \ " > UInt32 < / ref . struct > < / decl . var . type > < / decl . var . instance > " , <nl> key . conforms : [ <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FooSubEnum1X " , <nl> key . usr : " c : @ E @ FooSubEnum1 @ FooSubEnum1X " , <nl> - key . offset : 7019 , <nl> + key . offset : 7027 , <nl> key . length : 37 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FooSubEnum1X < / decl . name > : < decl . var . type > < ref . struct usr = \ " c : @ E @ FooSubEnum1 \ " > FooSubEnum1 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FooSubEnum1Y " , <nl> key . usr : " c : @ E @ FooSubEnum1 @ FooSubEnum1Y " , <nl> - key . offset : 7057 , <nl> + key . offset : 7065 , <nl> key . length : 37 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FooSubEnum1Y < / decl . name > : < decl . var . type > < ref . struct usr = \ " c : @ E @ FooSubEnum1 \ " > FooSubEnum1 < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } , <nl> var FooSubUnnamedEnumeratorA1 : Int { get } <nl> key . kind : source . lang . swift . decl . var . global , <nl> key . name : " FooSubUnnamedEnumeratorA1 " , <nl> key . usr : " c : @ Ea @ FooSubUnnamedEnumeratorA1 @ FooSubUnnamedEnumeratorA1 " , <nl> - key . offset : 7095 , <nl> + key . offset : 7103 , <nl> key . length : 42 , <nl> key . fully_annotated_decl : " < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > FooSubUnnamedEnumeratorA1 < / decl . name > : < decl . var . type > < ref . struct usr = \ " s : Si \ " > Int < / ref . struct > < / decl . var . type > { < syntaxtype . keyword > get < / syntaxtype . keyword > } < / decl . var . global > " <nl> } <nl>
|
[ stdlib ] Revise documentation for new indexing model
|
apple/swift
|
982e3d09f89aadadcec63ae8637188dcd1d12740
|
2016-05-19T15:16:14Z
|
mmm a / third - party <nl> ppp b / third - party <nl> @ @ - 1 + 1 @ @ <nl> - Subproject commit 13064d0cd09a0e46f09e7f5b3e6b1503cea7debf <nl> + Subproject commit 57ddc7942877befb97ecc3df2581a4de119049aa <nl>
|
Bump hhvm - third - party rev
|
facebook/hhvm
|
788bb2522a06734c3706a822ace870e0bbfc557b
|
2016-02-29T20:01:04Z
|
mmm a / test / test_optim . py <nl> ppp b / test / test_optim . py <nl> def test_adam ( self ) : <nl> with self . assertRaisesRegex ( ValueError , " Invalid beta parameter at index 0 : 1 . 0 " ) : <nl> optim . Adam ( None , lr = 1e - 2 , betas = ( 1 . 0 , 0 . 0 ) ) <nl> <nl> + with self . assertRaisesRegex ( ValueError , " Invalid weight_decay value : - 1 " ) : <nl> + optim . Adam ( None , lr = 1e - 2 , weight_decay = - 1 ) <nl> + <nl> def test_adamw ( self ) : <nl> self . _test_basic_cases ( <nl> lambda weight , bias : optim . AdamW ( [ weight , bias ] , lr = 1e - 3 ) <nl> def test_adamw ( self ) : <nl> lr = 1e - 3 ) <nl> ) <nl> <nl> + with self . assertRaisesRegex ( ValueError , " Invalid weight_decay value : - 1 " ) : <nl> + optim . AdamW ( None , lr = 1e - 2 , weight_decay = - 1 ) <nl> + <nl> def test_sparse_adam ( self ) : <nl> self . _test_rosenbrock_sparse ( <nl> lambda params : optim . SparseAdam ( params , lr = 4e - 2 ) , <nl> mmm a / torch / optim / adam . py <nl> ppp b / torch / optim / adam . py <nl> def __init__ ( self , params , lr = 1e - 3 , betas = ( 0 . 9 , 0 . 999 ) , eps = 1e - 8 , <nl> raise ValueError ( " Invalid beta parameter at index 0 : { } " . format ( betas [ 0 ] ) ) <nl> if not 0 . 0 < = betas [ 1 ] < 1 . 0 : <nl> raise ValueError ( " Invalid beta parameter at index 1 : { } " . format ( betas [ 1 ] ) ) <nl> + if not 0 . 0 < = weight_decay : <nl> + raise ValueError ( " Invalid weight_decay value : { } " . format ( weight_decay ) ) <nl> defaults = dict ( lr = lr , betas = betas , eps = eps , <nl> weight_decay = weight_decay , amsgrad = amsgrad ) <nl> super ( Adam , self ) . __init__ ( params , defaults ) <nl> mmm a / torch / optim / adamw . py <nl> ppp b / torch / optim / adamw . py <nl> def __init__ ( self , params , lr = 1e - 3 , betas = ( 0 . 9 , 0 . 999 ) , eps = 1e - 8 , <nl> raise ValueError ( " Invalid beta parameter at index 0 : { } " . format ( betas [ 0 ] ) ) <nl> if not 0 . 0 < = betas [ 1 ] < 1 . 0 : <nl> raise ValueError ( " Invalid beta parameter at index 1 : { } " . format ( betas [ 1 ] ) ) <nl> + if not 0 . 0 < = weight_decay : <nl> + raise ValueError ( " Invalid weight_decay value : { } " . format ( weight_decay ) ) <nl> defaults = dict ( lr = lr , betas = betas , eps = eps , <nl> weight_decay = weight_decay , amsgrad = amsgrad ) <nl> super ( AdamW , self ) . __init__ ( params , defaults ) <nl>
|
Add missing weight_decay parameter validation for Adam and AdamW ( )
|
pytorch/pytorch
|
d19a50bf277344dfddec491249005464df7eae44
|
2020-02-20T19:11:51Z
|
mmm a / source / common / upstream / cluster_manager_impl . cc <nl> ppp b / source / common / upstream / cluster_manager_impl . cc <nl> ClusterManagerImpl : : ClusterManagerImpl ( const Json : : Object & config , Stats : : Store & <nl> loadCluster ( cluster , stats , dns_resolver , ssl_context_manager , runtime , random ) ; <nl> } <nl> <nl> + Optional < std : : string > local_cluster_name ; <nl> + if ( config . hasObject ( " local_cluster_name " ) ) { <nl> + local_cluster_name . value ( config . getString ( " local_cluster_name " ) ) ; <nl> + if ( get ( local_cluster_name . value ( ) ) = = nullptr ) { <nl> + throw EnvoyException ( <nl> + fmt : : format ( " local cluster ' { } ' must be defined " , local_cluster_name . value ( ) ) ) ; <nl> + } <nl> + } <nl> + <nl> tls . set ( thread_local_slot_ , <nl> - [ this , & stats , & runtime , & random , local_zone_name , local_address ] ( <nl> + [ this , & stats , & runtime , & random , local_zone_name , local_address , local_cluster_name ] ( <nl> Event : : Dispatcher & dispatcher ) - > ThreadLocal : : ThreadLocalObjectPtr { <nl> return ThreadLocal : : ThreadLocalObjectPtr { new ThreadLocalClusterManagerImpl ( <nl> - * this , dispatcher , runtime , random , local_zone_name , local_address ) } ; <nl> + * this , dispatcher , runtime , random , local_zone_name , local_address , <nl> + local_cluster_name ) } ; <nl> } ) ; <nl> <nl> / / To avoid threading issues , for those clusters that start with hosts already in them ( like <nl> Http : : AsyncClient & ClusterManagerImpl : : httpAsyncClientForCluster ( const std : : stri <nl> ClusterManagerImpl : : ThreadLocalClusterManagerImpl : : ThreadLocalClusterManagerImpl ( <nl> ClusterManagerImpl & parent , Event : : Dispatcher & dispatcher , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random , const std : : string & local_zone_name , <nl> - const std : : string & local_address ) <nl> + const std : : string & local_address , const Optional < std : : string > & local_cluster_name ) <nl> : parent_ ( parent ) , dispatcher_ ( dispatcher ) { <nl> + / / If local cluster is defined then we need to initialize it first . <nl> + if ( local_cluster_name . valid ( ) ) { <nl> + auto & local_cluster = parent . primary_clusters_ [ local_cluster_name . value ( ) ] ; <nl> + thread_local_clusters_ [ local_cluster_name . value ( ) ] . reset ( <nl> + new ClusterEntry ( * this , * local_cluster , runtime , random , parent . stats_ , dispatcher , <nl> + local_zone_name , local_address , nullptr ) ) ; <nl> + } <nl> + <nl> + const HostSet * local_host_set = <nl> + local_cluster_name . valid ( ) ? & thread_local_clusters_ [ local_cluster_name . value ( ) ] - > host_set_ <nl> + : nullptr ; <nl> + <nl> for ( auto & cluster : parent . primary_clusters_ ) { <nl> - thread_local_clusters_ [ cluster . first ] . reset ( new ClusterEntry ( * this , * cluster . second , runtime , <nl> - random , parent . stats_ , dispatcher , <nl> - local_zone_name , local_address ) ) ; <nl> + / / If local cluster name is set then we already initialized this cluster . <nl> + if ( local_cluster_name . valid ( ) & & local_cluster_name . value ( ) = = cluster . first ) { <nl> + continue ; <nl> + } <nl> + <nl> + thread_local_clusters_ [ cluster . first ] . reset ( <nl> + new ClusterEntry ( * this , * cluster . second , runtime , random , parent . stats_ , dispatcher , <nl> + local_zone_name , local_address , local_host_set ) ) ; <nl> } <nl> <nl> for ( auto & cluster : thread_local_clusters_ ) { <nl> void ClusterManagerImpl : : ThreadLocalClusterManagerImpl : : shutdown ( ) { <nl> ClusterManagerImpl : : ThreadLocalClusterManagerImpl : : ClusterEntry : : ClusterEntry ( <nl> ThreadLocalClusterManagerImpl & parent , const Cluster & cluster , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random , Stats : : Store & stats_store , Event : : Dispatcher & dispatcher , <nl> - const std : : string & local_zone_name , const std : : string & local_address ) <nl> + const std : : string & local_zone_name , const std : : string & local_address , <nl> + const HostSet * local_host_set ) <nl> : parent_ ( parent ) , primary_cluster_ ( cluster ) , <nl> http_async_client_ ( <nl> cluster , stats_store , dispatcher , local_zone_name , parent . parent_ , runtime , random , <nl> ClusterManagerImpl : : ThreadLocalClusterManagerImpl : : ClusterEntry : : ClusterEntry ( <nl> <nl> switch ( cluster . lbType ( ) ) { <nl> case LoadBalancerType : : LeastRequest : { <nl> - lb_ . reset ( new LeastRequestLoadBalancer ( host_set_ , cluster . stats ( ) , runtime , random ) ) ; <nl> + lb_ . reset ( <nl> + new LeastRequestLoadBalancer ( host_set_ , local_host_set , cluster . stats ( ) , runtime , random ) ) ; <nl> break ; <nl> } <nl> case LoadBalancerType : : Random : { <nl> - lb_ . reset ( new RandomLoadBalancer ( host_set_ , cluster . stats ( ) , runtime , random ) ) ; <nl> + lb_ . reset ( new RandomLoadBalancer ( host_set_ , local_host_set , cluster . stats ( ) , runtime , random ) ) ; <nl> break ; <nl> } <nl> case LoadBalancerType : : RoundRobin : { <nl> - lb_ . reset ( new RoundRobinLoadBalancer ( host_set_ , cluster . stats ( ) , runtime , random ) ) ; <nl> + lb_ . reset ( <nl> + new RoundRobinLoadBalancer ( host_set_ , local_host_set , cluster . stats ( ) , runtime , random ) ) ; <nl> break ; <nl> } <nl> } <nl> mmm a / source / common / upstream / cluster_manager_impl . h <nl> ppp b / source / common / upstream / cluster_manager_impl . h <nl> class ClusterManagerImpl : public ClusterManager { <nl> ClusterEntry ( ThreadLocalClusterManagerImpl & parent , const Cluster & cluster , <nl> Runtime : : Loader & runtime , Runtime : : RandomGenerator & random , <nl> Stats : : Store & stats_store , Event : : Dispatcher & dispatcher , <nl> - const std : : string & local_zone_name , const std : : string & local_address ) ; <nl> + const std : : string & local_zone_name , const std : : string & local_address , <nl> + const HostSet * local_host_set ) ; <nl> <nl> Http : : ConnectionPool : : Instance * connPool ( ResourcePriority priority ) ; <nl> <nl> class ClusterManagerImpl : public ClusterManager { <nl> ThreadLocalClusterManagerImpl ( ClusterManagerImpl & parent , Event : : Dispatcher & dispatcher , <nl> Runtime : : Loader & runtime , Runtime : : RandomGenerator & random , <nl> const std : : string & local_zone_name , <nl> - const std : : string & local_address ) ; <nl> + const std : : string & local_address , <nl> + const Optional < std : : string > & local_cluster_name ) ; <nl> void drainConnPools ( HostPtr old_host , ConnPoolsContainer & container ) ; <nl> static void updateClusterMembership ( const std : : string & name , ConstHostVectorPtr hosts , <nl> ConstHostVectorPtr healthy_hosts , <nl> class ClusterManagerImpl : public ClusterManager { <nl> ConstHostVectorPtr local_zone_healthy_hosts , <nl> const std : : vector < HostPtr > & hosts_added , <nl> const std : : vector < HostPtr > & hosts_removed , <nl> - ThreadLocal : : Instance & tls , uint32_t thead_local_slot ) ; <nl> + ThreadLocal : : Instance & tls , uint32_t thread_local_slot ) ; <nl> <nl> / / ThreadLocal : : ThreadLocalObject <nl> void shutdown ( ) override ; <nl> mmm a / source / common / upstream / load_balancer_impl . cc <nl> ppp b / source / common / upstream / load_balancer_impl . cc <nl> ConstHostPtr RoundRobinLoadBalancer : : chooseHost ( ) { <nl> return hosts_to_use [ rr_index_ + + % hosts_to_use . size ( ) ] ; <nl> } <nl> <nl> - LeastRequestLoadBalancer : : LeastRequestLoadBalancer ( const HostSet & host_set , ClusterStats & stats , <nl> - Runtime : : Loader & runtime , <nl> + LeastRequestLoadBalancer : : LeastRequestLoadBalancer ( const HostSet & host_set , <nl> + const HostSet * local_host_set , <nl> + ClusterStats & stats , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) <nl> - : LoadBalancerBase ( host_set , stats , runtime , random ) { <nl> + : LoadBalancerBase ( host_set , local_host_set , stats , runtime , random ) { <nl> host_set . addMemberUpdateCb ( <nl> [ this ] ( const std : : vector < HostPtr > & , const std : : vector < HostPtr > & hosts_removed ) - > void { <nl> if ( last_host_ ) { <nl> mmm a / source / common / upstream / load_balancer_impl . h <nl> ppp b / source / common / upstream / load_balancer_impl . h <nl> namespace Upstream { <nl> * / <nl> class LoadBalancerBase { <nl> protected : <nl> - LoadBalancerBase ( const HostSet & host_set , ClusterStats & stats , Runtime : : Loader & runtime , <nl> - Runtime : : RandomGenerator & random ) <nl> - : stats_ ( stats ) , runtime_ ( runtime ) , random_ ( random ) , host_set_ ( host_set ) { } <nl> + LoadBalancerBase ( const HostSet & host_set , const HostSet * local_host_set , ClusterStats & stats , <nl> + Runtime : : Loader & runtime , Runtime : : RandomGenerator & random ) <nl> + : stats_ ( stats ) , runtime_ ( runtime ) , random_ ( random ) , host_set_ ( host_set ) , <nl> + local_host_set_ ( local_host_set ) { } <nl> <nl> / * * <nl> * Pick the host list to use ( healthy or all depending on how many in the set are not healthy ) . <nl> class LoadBalancerBase { <nl> <nl> private : <nl> const HostSet & host_set_ ; <nl> + const HostSet * local_host_set_ ; <nl> } ; <nl> <nl> / * * <nl> class LoadBalancerBase { <nl> * / <nl> class RoundRobinLoadBalancer : public LoadBalancer , LoadBalancerBase { <nl> public : <nl> - RoundRobinLoadBalancer ( const HostSet & host_set , ClusterStats & stats , Runtime : : Loader & runtime , <nl> + RoundRobinLoadBalancer ( const HostSet & host_set , const HostSet * local_host_set_ , <nl> + ClusterStats & stats , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) <nl> - : LoadBalancerBase ( host_set , stats , runtime , random ) { } <nl> + : LoadBalancerBase ( host_set , local_host_set_ , stats , runtime , random ) { } <nl> <nl> / / Upstream : : LoadBalancer <nl> ConstHostPtr chooseHost ( ) override ; <nl> class RoundRobinLoadBalancer : public LoadBalancer , LoadBalancerBase { <nl> * / <nl> class LeastRequestLoadBalancer : public LoadBalancer , LoadBalancerBase { <nl> public : <nl> - LeastRequestLoadBalancer ( const HostSet & host_set , ClusterStats & stats , Runtime : : Loader & runtime , <nl> + LeastRequestLoadBalancer ( const HostSet & host_set , const HostSet * local_host_set_ , <nl> + ClusterStats & stats , Runtime : : Loader & runtime , <nl> Runtime : : RandomGenerator & random ) ; <nl> <nl> / / Upstream : : LoadBalancer <nl> class LeastRequestLoadBalancer : public LoadBalancer , LoadBalancerBase { <nl> * / <nl> class RandomLoadBalancer : public LoadBalancer , LoadBalancerBase { <nl> public : <nl> - RandomLoadBalancer ( const HostSet & host_set , ClusterStats & stats , Runtime : : Loader & runtime , <nl> - Runtime : : RandomGenerator & random ) <nl> - : LoadBalancerBase ( host_set , stats , runtime , random ) { } <nl> + RandomLoadBalancer ( const HostSet & host_set , const HostSet * local_host_set , ClusterStats & stats , <nl> + Runtime : : Loader & runtime , Runtime : : RandomGenerator & random ) <nl> + : LoadBalancerBase ( host_set , local_host_set , stats , runtime , random ) { } <nl> <nl> / / Upstream : : LoadBalancer <nl> ConstHostPtr chooseHost ( ) override ; <nl> mmm a / test / common / upstream / cluster_manager_impl_test . cc <nl> ppp b / test / common / upstream / cluster_manager_impl_test . cc <nl> TEST_F ( ClusterManagerImplTest , UnknownClusterType ) { <nl> EXPECT_THROW ( create ( loader ) , EnvoyException ) ; <nl> } <nl> <nl> + TEST_F ( ClusterManagerImplTest , LocalClusterNotDefined ) { <nl> + std : : string json = R " EOF ( <nl> + { <nl> + " local_cluster_name " : " new_cluster " , <nl> + " clusters " : [ <nl> + { <nl> + " name " : " cluster_1 " , <nl> + " connect_timeout_ms " : 250 , <nl> + " type " : " static " , <nl> + " lb_type " : " round_robin " , <nl> + " hosts " : [ { " url " : " tcp : / / 127 . 0 . 0 . 1 : 11001 " } ] <nl> + } , <nl> + { <nl> + " name " : " cluster_2 " , <nl> + " connect_timeout_ms " : 250 , <nl> + " type " : " static " , <nl> + " lb_type " : " round_robin " , <nl> + " hosts " : [ { " url " : " tcp : / / 127 . 0 . 0 . 1 : 11002 " } ] <nl> + } ] <nl> + } <nl> + ) EOF " ; <nl> + <nl> + Json : : StringLoader loader ( json ) ; <nl> + EXPECT_THROW ( create ( loader ) , EnvoyException ) ; <nl> + } <nl> + <nl> + TEST_F ( ClusterManagerImplTest , LocalClusterDefined ) { <nl> + std : : string json = R " EOF ( <nl> + { <nl> + " local_cluster_name " : " new_cluster " , <nl> + " clusters " : [ <nl> + { <nl> + " name " : " cluster_1 " , <nl> + " connect_timeout_ms " : 250 , <nl> + " type " : " static " , <nl> + " lb_type " : " round_robin " , <nl> + " hosts " : [ { " url " : " tcp : / / 127 . 0 . 0 . 1 : 11001 " } ] <nl> + } , <nl> + { <nl> + " name " : " cluster_2 " , <nl> + " connect_timeout_ms " : 250 , <nl> + " type " : " static " , <nl> + " lb_type " : " round_robin " , <nl> + " hosts " : [ { " url " : " tcp : / / 127 . 0 . 0 . 1 : 11002 " } ] <nl> + } , <nl> + { <nl> + " name " : " new_cluster " , <nl> + " connect_timeout_ms " : 250 , <nl> + " type " : " static " , <nl> + " lb_type " : " round_robin " , <nl> + " hosts " : [ { " url " : " tcp : / / 127 . 0 . 0 . 1 : 11002 " } ] <nl> + } ] <nl> + } <nl> + ) EOF " ; <nl> + <nl> + Json : : StringLoader loader ( json ) ; <nl> + create ( loader ) ; <nl> + } <nl> + <nl> TEST_F ( ClusterManagerImplTest , DuplicateCluster ) { <nl> std : : string json = R " EOF ( <nl> { <nl> mmm a / test / common / upstream / load_balancer_impl_test . cc <nl> ppp b / test / common / upstream / load_balancer_impl_test . cc <nl> class RoundRobinLoadBalancerTest : public testing : : Test { <nl> NiceMock < Runtime : : MockRandomGenerator > random_ ; <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> ClusterStats stats_ ; <nl> - RoundRobinLoadBalancer lb_ { cluster_ , stats_ , runtime_ , random_ } ; <nl> + RoundRobinLoadBalancer lb_ { cluster_ , nullptr , stats_ , runtime_ , random_ } ; <nl> } ; <nl> <nl> TEST_F ( RoundRobinLoadBalancerTest , NoHosts ) { EXPECT_EQ ( nullptr , lb_ . chooseHost ( ) ) ; } <nl> class LeastRequestLoadBalancerTest : public testing : : Test { <nl> NiceMock < Runtime : : MockRandomGenerator > random_ ; <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> ClusterStats stats_ ; <nl> - LeastRequestLoadBalancer lb_ { cluster_ , stats_ , runtime_ , random_ } ; <nl> + LeastRequestLoadBalancer lb_ { cluster_ , nullptr , stats_ , runtime_ , random_ } ; <nl> } ; <nl> <nl> TEST_F ( LeastRequestLoadBalancerTest , NoHosts ) { EXPECT_EQ ( nullptr , lb_ . chooseHost ( ) ) ; } <nl> class RandomLoadBalancerTest : public testing : : Test { <nl> NiceMock < Runtime : : MockRandomGenerator > random_ ; <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> ClusterStats stats_ ; <nl> - RandomLoadBalancer lb_ { cluster_ , stats_ , runtime_ , random_ } ; <nl> + RandomLoadBalancer lb_ { cluster_ , nullptr , stats_ , runtime_ , random_ } ; <nl> } ; <nl> <nl> TEST_F ( RandomLoadBalancerTest , NoHosts ) { EXPECT_EQ ( nullptr , lb_ . chooseHost ( ) ) ; } <nl> mmm a / test / common / upstream / load_balancer_simulation_test . cc <nl> ppp b / test / common / upstream / load_balancer_simulation_test . cc <nl> class DISABLED_SimulationTest : public testing : : Test { <nl> Stats : : IsolatedStoreImpl stats_store_ ; <nl> ClusterStats stats_ ; <nl> / / TODO : make per originating host load balancer . <nl> - RandomLoadBalancer lb_ { cluster_ , stats_ , runtime_ , random_ } ; <nl> + RandomLoadBalancer lb_ { cluster_ , nullptr , stats_ , runtime_ , random_ } ; <nl> } ; <nl> <nl> TEST_F ( DISABLED_SimulationTest , strictlyEqualDistribution ) { <nl>
|
Make cluster manager know about local cluster ( )
|
envoyproxy/envoy
|
0809f52d2e217ad48cd8e2b4fd5af3de11915a60
|
2016-10-14T22:54:19Z
|
mmm a / dlib / optimization . h <nl> ppp b / dlib / optimization . h <nl> <nl> # include " optimization / max_cost_assignment . h " <nl> # include " optimization / max_sum_submatrix . h " <nl> # include " optimization / find_max_factor_graph_nmplp . h " <nl> + # include " optimization / find_max_factor_graph_viterbi . h " <nl> <nl> # endif / / DLIB_OPTIMIZATIOn_HEADER <nl> <nl> new file mode 100644 <nl> index 000000000 . . 62942ac69 <nl> mmm / dev / null <nl> ppp b / dlib / optimization / find_max_factor_graph_viterbi . h <nl> <nl> + / / Copyright ( C ) 2011 Davis E . King ( davis @ dlib . net ) <nl> + / / License : Boost Software License See LICENSE . txt for the full license . <nl> + # ifndef DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_H__ <nl> + # define DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_H__ <nl> + <nl> + # include " find_max_factor_graph_viterbi_abstract . h " <nl> + # include < vector > <nl> + # include " . . / matrix . h " <nl> + # include " . . / array2d . h " <nl> + <nl> + <nl> + namespace dlib <nl> + { <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + namespace impl <nl> + { <nl> + struct viterbi_data <nl> + { <nl> + viterbi_data ( ) : val ( 0 ) , back_index ( 0 ) { } <nl> + double val ; <nl> + unsigned long back_index ; <nl> + } ; <nl> + <nl> + template < long NC > <nl> + inline bool advance_state ( <nl> + matrix < unsigned long , 1 , NC > & node_states , <nl> + unsigned long num_states <nl> + ) <nl> + / * ! <nl> + ensures <nl> + - advances node_states to the next state by adding 1 <nl> + to node_states ( node_states . size ( ) - 1 ) and carrying any <nl> + rollover ( modulo num_states ) . Stores the result into # node_states . <nl> + - if ( # node_states is all zeros ) then <nl> + - returns false <nl> + - else <nl> + - returns true <nl> + ! * / <nl> + { <nl> + for ( long i = node_states . size ( ) - 1 ; i > = 0 ; - - i ) <nl> + { <nl> + node_states ( i ) + = 1 ; <nl> + if ( node_states ( i ) < num_states ) <nl> + return true ; <nl> + <nl> + node_states ( i ) = 0 ; <nl> + } <nl> + return false ; <nl> + } <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + template < <nl> + typename map_problem <nl> + > <nl> + void find_max_factor_graph_viterbi ( <nl> + const map_problem & prob , <nl> + std : : vector < unsigned long > & map_assignment <nl> + ) <nl> + { <nl> + using namespace dlib : : impl ; <nl> + const unsigned long order = map_problem : : order ; <nl> + const unsigned long num_states = map_problem : : num_states ; <nl> + COMPILE_TIME_ASSERT ( num_states > 0 ) ; <nl> + <nl> + <nl> + DLIB_ASSERT ( std : : pow ( num_states , order ) < std : : numeric_limits < unsigned long > : : max ( ) , <nl> + " \ t void find_max_factor_graph_viterbi ( ) " <nl> + < < " \ n \ t The order is way too large for this algorithm to handle . " <nl> + < < " \ n \ t order : " < < order <nl> + < < " \ n \ t num_states : " < < num_states <nl> + < < " \ n \ t std : : pow ( num_states , order ) : " < < std : : pow ( num_states , order ) <nl> + < < " \ n \ t std : : numeric_limits < unsigned long > : : max ( ) : " < < std : : numeric_limits < unsigned long > : : max ( ) <nl> + ) ; <nl> + <nl> + const unsigned long trellis_size = static_cast < unsigned long > ( std : : pow ( num_states , order ) ) ; <nl> + unsigned long init_ring_size = 1 ; <nl> + <nl> + array2d < impl : : viterbi_data > trellis ; <nl> + trellis . set_size ( prob . number_of_nodes ( ) , trellis_size ) ; <nl> + <nl> + <nl> + for ( unsigned long node = 0 ; node < prob . number_of_nodes ( ) ; + + node ) <nl> + { <nl> + <nl> + if ( node < order ) <nl> + { <nl> + matrix < unsigned long , 1 , 0 > node_states ; <nl> + node_states . set_size ( std : : min < int > ( node , order ) + 1 ) ; <nl> + node_states = 0 ; <nl> + <nl> + unsigned long idx = 0 ; <nl> + if ( node = = 0 ) <nl> + { <nl> + do <nl> + { <nl> + trellis [ node ] [ idx ] . val = prob . factor_value ( node , node_states ) ; <nl> + + + idx ; <nl> + } while ( advance_state ( node_states , num_states ) ) ; <nl> + } <nl> + else <nl> + { <nl> + init_ring_size * = num_states ; <nl> + do <nl> + { <nl> + const unsigned long back_index = idx % init_ring_size ; <nl> + trellis [ node ] [ idx ] . val = prob . factor_value ( node , node_states ) + trellis [ node - 1 ] [ back_index ] . val ; <nl> + trellis [ node ] [ idx ] . back_index = back_index ; <nl> + + + idx ; <nl> + } while ( advance_state ( node_states , num_states ) ) ; <nl> + <nl> + } <nl> + } <nl> + else <nl> + { <nl> + matrix < unsigned long , 1 , order + 1 > node_states ; <nl> + node_states = 0 ; <nl> + <nl> + unsigned long count = 0 ; <nl> + for ( unsigned long i = 0 ; i < trellis_size ; + + i ) <nl> + { <nl> + unsigned long back_index = 0 ; <nl> + double best_score = - std : : numeric_limits < double > : : infinity ( ) ; <nl> + for ( unsigned long s = 0 ; s < num_states ; + + s ) <nl> + { <nl> + const double temp = prob . factor_value ( node , node_states ) + trellis [ node - 1 ] [ count % trellis_size ] . val ; <nl> + if ( temp > best_score ) <nl> + { <nl> + best_score = temp ; <nl> + back_index = count % trellis_size ; <nl> + } <nl> + <nl> + advance_state ( node_states , num_states ) ; <nl> + + + count ; <nl> + } <nl> + <nl> + trellis [ node ] [ i ] . val = best_score ; <nl> + trellis [ node ] [ i ] . back_index = back_index ; <nl> + } <nl> + } <nl> + } <nl> + <nl> + <nl> + map_assignment . resize ( prob . number_of_nodes ( ) ) ; <nl> + / / Figure out which state of the last node has the biggest value . <nl> + unsigned long back_index = 0 ; <nl> + double best_val = - std : : numeric_limits < double > : : infinity ( ) ; <nl> + for ( long i = 0 ; i < trellis . nc ( ) ; + + i ) <nl> + { <nl> + if ( trellis [ trellis . nr ( ) - 1 ] [ i ] . val > best_val ) <nl> + { <nl> + best_val = trellis [ trellis . nr ( ) - 1 ] [ i ] . val ; <nl> + back_index = i ; <nl> + } <nl> + } <nl> + / / Follow the back links to find the decoding . <nl> + for ( long node = map_assignment . size ( ) - 1 ; node > = 0 ; - - node ) <nl> + { <nl> + map_assignment [ node ] = back_index / init_ring_size ; <nl> + back_index = trellis [ node ] [ back_index ] . back_index ; <nl> + if ( node < ( long ) order ) <nl> + init_ring_size / = num_states ; <nl> + } <nl> + <nl> + } <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + } <nl> + <nl> + # endif / / DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_H__ <nl> + <nl> + <nl> new file mode 100644 <nl> index 000000000 . . 12ab4c902 <nl> mmm / dev / null <nl> ppp b / dlib / optimization / find_max_factor_graph_viterbi_abstract . h <nl> <nl> + / / Copyright ( C ) 2011 Davis E . King ( davis @ dlib . net ) <nl> + / / License : Boost Software License See LICENSE . txt for the full license . <nl> + # undef DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_ABSTRACT_H__ <nl> + # ifdef DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_ABSTRACT_H__ <nl> + <nl> + # include < vector > <nl> + # include " . . / matrix . h " <nl> + <nl> + <nl> + namespace dlib <nl> + { <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + class map_problem <nl> + { <nl> + / * ! <nl> + WHAT THIS OBJECT REPRESENTS <nl> + This object represents a chain - structured factor graph or graphical <nl> + model . In particular , this object defines the interface a MAP problem <nl> + on a factor graph must implement if it is to be solved using the <nl> + find_max_factor_graph_viterbi ( ) routine defined at the bottom of this file . <nl> + <nl> + Note that there is no dlib : : map_problem object . What you are looking <nl> + at here is simply the interface definition for a map problem . You must <nl> + implement your own version of this object for the problem you wish to <nl> + solve and then pass it to the find_max_factor_graph_viterbi ( ) routine . <nl> + ! * / <nl> + <nl> + public : <nl> + <nl> + / / This model can represent a high order Markov chain . If order = = 1 then map_problem <nl> + / / represents a basic chain - structured graph where nodes only depend on their immediate <nl> + / / neighbors . However , high order Markov models can also be used by setting order > 1 . <nl> + const static unsigned long order ; <nl> + <nl> + / / Defines the number of states attainable by each variable / node in the graph . <nl> + const static unsigned long num_states ; <nl> + <nl> + unsigned long number_of_nodes ( <nl> + ) const ; <nl> + / * ! <nl> + ensures <nl> + - returns the number of nodes in the factor graph . Or in other words , <nl> + returns the number of variables in the MAP problem . <nl> + ! * / <nl> + <nl> + template < <nl> + typename EXP <nl> + > <nl> + double factor_value ( <nl> + unsigned long node_id , <nl> + const matrix_exp < EXP > & node_states <nl> + ) const ; <nl> + / * ! <nl> + requires <nl> + - EXP : : type = = unsigned long <nl> + ( i . e . node_states contains unsigned longs ) <nl> + - node_id < number_of_nodes ( ) <nl> + - node_states . size ( ) = = min ( node_id , order ) + 1 <nl> + - max ( node_states ) < num_states <nl> + ensures <nl> + - In a chain - structured graph , each node has a potential function associated with <nl> + it . The potential function operates on the variable given by the node as well <nl> + as the order previous variables . Therefore , factor_value ( ) returns the value <nl> + of the factor / potential function associated with node node_id where the following <nl> + nodes take on the values defined below : <nl> + - node_states ( 0 ) = = the value of the node with ID node_id <nl> + - node_states ( i ) = = the value of the node with ID node_id - i <nl> + ! * / <nl> + <nl> + } ; <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + template < <nl> + typename map_problem <nl> + > <nl> + void find_max_factor_graph_viterbi ( <nl> + const map_problem & prob , <nl> + std : : vector < unsigned long > & map_assignment <nl> + ) ; <nl> + / * ! <nl> + requires <nl> + - map_problem : : num_states > 0 <nl> + - std : : pow ( map_problem : : num_states , map_problem : : order ) < std : : numeric_limits < unsigned long > : : max ( ) <nl> + ( i . e . The Viterbi algorithm is exponential in the order of the map problem . So don ' t <nl> + make order too large . ) <nl> + - map_problem = = an object with an interface compatible with the map_problem <nl> + object defined at the top of this file . <nl> + ensures <nl> + - This function is a tool for exactly solving the MAP problem in a chain - structured <nl> + graphical model or factor graph . That is , it attempts to solve a certain kind of <nl> + optimization problem which can be defined as follows : <nl> + - Let X be a set of prob . number_of_nodes ( ) integer valued variables , each taking <nl> + a value in the range [ 0 , map_problem : : num_states ) . <nl> + - Let X ( i ) = the ith variable in X . <nl> + - Let F ( i ) = factor_value_i ( X ( i ) , X ( i - 1 ) , . . . , X ( i - map_problem : : order ) ) <nl> + ( This is the value returned by prob . factor_value ( i , node_states ) . Note that <nl> + each factor value function operates on at most map_problem : : order + 1 variables . <nl> + Moreover , the variables are adjacent and hence the graph is " chain - structured " . ) <nl> + <nl> + Then this function finds the assignments to the X variables which <nl> + maximizes : sum over all valid i : F ( i ) <nl> + <nl> + - # map_assignment = = the result of the optimization . <nl> + - # map_assignment . size ( ) = = prob . number_of_nodes ( ) <nl> + - for all valid i : <nl> + - # map_assignment [ i ] < map_problem : : num_states <nl> + - # map_assignment [ i ] = = The MAP assignment for node / variable i . <nl> + ! * / <nl> + <nl> + / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + } <nl> + <nl> + # endif / / DLIB_FIND_MAX_FACTOR_GRAPH_VITERBi_ABSTRACT_H__ <nl> + <nl> + <nl> + <nl>
|
Added the find_max_factor_graph_viterbi ( ) routine for performing MAP
|
davisking/dlib
|
ccac84538dc110bfd3a89e36801714909b43b58e
|
2011-09-18T19:19:22Z
|
mmm a / folly / Conv . h <nl> ppp b / folly / Conv . h <nl> estimateSpaceNeeded ( T ) { <nl> return 1 ; <nl> } <nl> <nl> - / * * <nl> - * Ubiquitous helper template for writing string appenders <nl> - * / <nl> - template < class T > struct IsSomeString { <nl> - enum { value = std : : is_same < T , std : : string > : : value <nl> - | | std : : is_same < T , fbstring > : : value } ; <nl> - } ; <nl> - <nl> / * * <nl> * Everything implicitly convertible to const char * gets appended . <nl> * / <nl> mmm a / folly / IPAddress . cpp <nl> ppp b / folly / IPAddress . cpp <nl> <nl> # include < string > <nl> # include < vector > <nl> <nl> + # include < folly / Conv . h > <nl> # include < folly / String . h > <nl> + # include < folly / detail / IPAddressSource . h > <nl> <nl> using std : : ostream ; <nl> using std : : string ; <nl> CIDRNetwork IPAddress : : createNetwork ( StringPiece ipSlashCidr , <nl> <nl> if ( elemCount = = 0 | | / / weird invalid string <nl> elemCount > 2 ) { / / invalid string ( IP / CIDR / extras ) <nl> - throw IPAddressFormatException ( " Invalid ipSlashCidr specified . " , <nl> - " Expected IP / CIDR format , got " , <nl> - " ' " , ipSlashCidr , " ' " ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " Invalid ipSlashCidr specified . " , <nl> + " Expected IP / CIDR format , got " , <nl> + " ' " , <nl> + ipSlashCidr , <nl> + " ' " ) ) ; <nl> } <nl> IPAddress subnet ( vec . at ( 0 ) ) ; <nl> uint8_t cidr = ( defaultCidr > - 1 ) ? defaultCidr : ( subnet . isV4 ( ) ? 32 : 128 ) ; <nl> CIDRNetwork IPAddress : : createNetwork ( StringPiece ipSlashCidr , <nl> try { <nl> cidr = to < uint8_t > ( vec . at ( 1 ) ) ; <nl> } catch ( . . . ) { <nl> - throw IPAddressFormatException ( " Mask value " , <nl> - " ' " , vec . at ( 1 ) , " ' not a valid mask " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Mask value " , " ' " , vec . at ( 1 ) , " ' not a valid mask " ) ) ; <nl> } <nl> } <nl> if ( cidr > subnet . bitCount ( ) ) { <nl> - throw IPAddressFormatException ( " CIDR value ' " , cidr , " ' " , <nl> - " is > network bit count " , <nl> - " ' " , subnet . bitCount ( ) , " ' " ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " CIDR value ' " , <nl> + cidr , <nl> + " ' " , <nl> + " is > network bit count " , <nl> + " ' " , <nl> + subnet . bitCount ( ) , <nl> + " ' " ) ) ; <nl> } <nl> return std : : make_pair ( applyMask ? subnet . mask ( cidr ) : subnet , cidr ) ; <nl> } <nl> <nl> + / / public static <nl> + std : : string IPAddress : : networkToString ( const CIDRNetwork & network ) { <nl> + return network . first . str ( ) + " / " + folly : : to < std : : string > ( network . second ) ; <nl> + } <nl> + <nl> / / public static <nl> IPAddress IPAddress : : fromBinary ( ByteRange bytes ) { <nl> if ( bytes . size ( ) = = 4 ) { <nl> IPAddress IPAddress : : fromBinary ( ByteRange bytes ) { <nl> return IPAddress ( IPAddressV6 : : fromBinary ( bytes ) ) ; <nl> } else { <nl> string hexval = detail : : Bytes : : toHex ( bytes . data ( ) , bytes . size ( ) ) ; <nl> - throw IPAddressFormatException ( " Invalid address with hex value " , <nl> - " ' " , hexval , " ' " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Invalid address with hex value " , " ' " , hexval , " ' " ) ) ; <nl> } <nl> } <nl> <nl> IPAddress : : IPAddress ( StringPiece addr ) <nl> { <nl> string ip = addr . str ( ) ; / / inet_pton ( ) needs NUL - terminated string <nl> auto throwFormatException = [ & ] ( const string & msg ) { <nl> - throw IPAddressFormatException ( " Invalid IP ' " , ip , " ' : " , msg ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Invalid IP ' " , ip , " ' : " , msg ) ) ; <nl> } ; <nl> <nl> if ( ip . size ( ) < 2 ) { <nl> IPAddress : : longestCommonPrefix ( const CIDRNetwork & one , const CIDRNetwork & two ) { <nl> return { IPAddress ( 0 ) , 0 } ; <nl> } <nl> <nl> + [ [ noreturn ] ] void IPAddress : : asV4Throw ( ) const { <nl> + auto fam = detail : : familyNameStr ( family ( ) ) ; <nl> + throw InvalidAddressFamilyException ( to < std : : string > ( <nl> + " Can ' t convert address with family " , fam , " to AF_INET address " ) ) ; <nl> + } <nl> + <nl> + [ [ noreturn ] ] void IPAddress : : asV6Throw ( ) const { <nl> + auto fam = detail : : familyNameStr ( family ( ) ) ; <nl> + throw InvalidAddressFamilyException ( to < std : : string > ( <nl> + " Can ' t convert address with family " , fam , " to AF_INET6 address " ) ) ; <nl> + } <nl> + <nl> + <nl> } / / folly <nl> mmm a / folly / IPAddress . h <nl> ppp b / folly / IPAddress . h <nl> <nl> # pragma once <nl> <nl> # include < functional > <nl> - # include < iostream > <nl> + # include < iosfwd > <nl> # include < memory > <nl> # include < string > <nl> # include < utility > / / std : : pair <nl> <nl> - # include < boost / operators . hpp > <nl> - <nl> - # include < folly / Conv . h > <nl> - # include < folly / Format . h > <nl> # include < folly / Range . h > <nl> # include < folly / IPAddressException . h > <nl> # include < folly / IPAddressV4 . h > <nl> typedef std : : pair < IPAddress , uint8_t > CIDRNetwork ; <nl> * CHECK ( IPAddress : : createIPv6 ( v4addr ) = = v6map . asV6 ( ) ) ; <nl> * @ encode <nl> * / <nl> - class IPAddress : boost : : totally_ordered < IPAddress > { <nl> + class IPAddress { <nl> public : <nl> / / returns true iff the input string can be parsed as an ip - address <nl> static bool validate ( StringPiece ip ) ; <nl> class IPAddress : boost : : totally_ordered < IPAddress > { <nl> * <nl> * @ return string representing the netblock <nl> * / <nl> - static std : : string networkToString ( const CIDRNetwork & network ) { <nl> - return network . first . str ( ) + " / " + folly : : to < std : : string > ( network . second ) ; <nl> - } <nl> + static std : : string networkToString ( const CIDRNetwork & network ) ; <nl> <nl> / * * <nl> * Create a new IPAddress instance from the provided binary data <nl> class IPAddress : boost : : totally_ordered < IPAddress > { <nl> * @ throws IPAddressFormatException is not a V4 instance <nl> * / <nl> const IPAddressV4 & asV4 ( ) const { <nl> - if ( ! isV4 ( ) ) { <nl> - auto familyName = detail : : familyNameStr ( family ( ) ) ; <nl> - throw InvalidAddressFamilyException ( " Can ' t convert address with family " , <nl> - familyName , " to AF_INET address " ) ; <nl> + if ( UNLIKELY ( ! isV4 ( ) ) ) { <nl> + asV4Throw ( ) ; <nl> } <nl> return addr_ . ipV4Addr ; <nl> } <nl> class IPAddress : boost : : totally_ordered < IPAddress > { <nl> * @ throws InvalidAddressFamilyException is not a V6 instance <nl> * / <nl> const IPAddressV6 & asV6 ( ) const { <nl> - if ( ! isV6 ( ) ) { <nl> - auto familyName = detail : : familyNameStr ( family ( ) ) ; <nl> - throw InvalidAddressFamilyException ( " Can ' t convert address with family " , <nl> - familyName , " to AF_INET6 address " ) ; <nl> + if ( UNLIKELY ( ! isV6 ( ) ) ) { <nl> + asV6Throw ( ) ; <nl> } <nl> return addr_ . ipV6Addr ; <nl> } <nl> class IPAddress : boost : : totally_ordered < IPAddress > { <nl> } <nl> <nl> private : <nl> + [ [ noreturn ] ] void asV4Throw ( ) const ; <nl> + [ [ noreturn ] ] void asV6Throw ( ) const ; <nl> + <nl> typedef union IPAddressV46 { <nl> IPAddressV4 ipV4Addr ; <nl> IPAddressV6 ipV6Addr ; <nl> void toAppend ( IPAddress addr , fbstring * result ) ; <nl> bool operator = = ( const IPAddress & addr1 , const IPAddress & addr2 ) ; <nl> / / Return true if addr1 < addr2 <nl> bool operator < ( const IPAddress & addr1 , const IPAddress & addr2 ) ; <nl> + / / Derived operators <nl> + inline bool operator ! = ( const IPAddress & a , const IPAddress & b ) { <nl> + return ! ( a = = b ) ; <nl> + } <nl> + inline bool operator > ( const IPAddress & a , const IPAddress & b ) { <nl> + return b < a ; <nl> + } <nl> + inline bool operator < = ( const IPAddress & a , const IPAddress & b ) { <nl> + return ! ( a > b ) ; <nl> + } <nl> + inline bool operator > = ( const IPAddress & a , const IPAddress & b ) { <nl> + return ! ( a < b ) ; <nl> + } <nl> <nl> } / / folly <nl> <nl> mmm a / folly / IPAddressException . h <nl> ppp b / folly / IPAddressException . h <nl> <nl> <nl> # include < exception > <nl> # include < string > <nl> + # include < utility > <nl> <nl> - # include < folly / Conv . h > <nl> # include < folly / detail / IPAddress . h > <nl> <nl> namespace folly { <nl> namespace folly { <nl> * / <nl> class IPAddressFormatException : public std : : exception { <nl> public : <nl> - explicit IPAddressFormatException ( const std : : string & msg ) <nl> - : msg_ ( msg ) { } <nl> - IPAddressFormatException ( <nl> - const IPAddressFormatException & ) = default ; <nl> - template < typename . . . Args > <nl> - explicit IPAddressFormatException ( Args & & . . . args ) <nl> - : msg_ ( to < std : : string > ( std : : forward < Args > ( args ) . . . ) ) { } <nl> + explicit IPAddressFormatException ( std : : string msg ) noexcept <nl> + : msg_ ( std : : move ( msg ) ) { } <nl> + IPAddressFormatException ( const IPAddressFormatException & ) = default ; <nl> + IPAddressFormatException ( IPAddressFormatException & & ) = default ; <nl> + IPAddressFormatException & operator = ( const IPAddressFormatException & ) = <nl> + default ; <nl> + IPAddressFormatException & operator = ( IPAddressFormatException & & ) = default ; <nl> <nl> virtual ~ IPAddressFormatException ( ) noexcept { } <nl> virtual const char * what ( void ) const noexcept { <nl> class IPAddressFormatException : public std : : exception { <nl> } <nl> <nl> private : <nl> - const std : : string msg_ ; <nl> + std : : string msg_ ; <nl> } ; <nl> <nl> class InvalidAddressFamilyException : public IPAddressFormatException { <nl> public : <nl> - explicit InvalidAddressFamilyException ( const std : : string & msg ) <nl> - : IPAddressFormatException ( msg ) { } <nl> - InvalidAddressFamilyException ( <nl> - const InvalidAddressFamilyException & ) = default ; <nl> - explicit InvalidAddressFamilyException ( sa_family_t family ) <nl> - : IPAddressFormatException ( " Address family " + <nl> - detail : : familyNameStr ( family ) + <nl> - " is not AF_INET or AF_INET6 " ) { } <nl> - template < typename . . . Args > <nl> - explicit InvalidAddressFamilyException ( Args & & . . . args ) <nl> - : IPAddressFormatException ( std : : forward < Args > ( args ) . . . ) { } <nl> + explicit InvalidAddressFamilyException ( std : : string msg ) noexcept <nl> + : IPAddressFormatException ( std : : move ( msg ) ) { } <nl> + explicit InvalidAddressFamilyException ( sa_family_t family ) noexcept <nl> + : InvalidAddressFamilyException ( <nl> + " Address family " + detail : : familyNameStr ( family ) + <nl> + " is not AF_INET or AF_INET6 " ) { } <nl> + InvalidAddressFamilyException ( const InvalidAddressFamilyException & ) = default ; <nl> + InvalidAddressFamilyException ( InvalidAddressFamilyException & & ) = default ; <nl> + InvalidAddressFamilyException & operator = ( <nl> + const InvalidAddressFamilyException & ) = default ; <nl> + InvalidAddressFamilyException & operator = ( InvalidAddressFamilyException & & ) = <nl> + default ; <nl> } ; <nl> <nl> } / / folly <nl> mmm a / folly / IPAddressV4 . cpp <nl> ppp b / folly / IPAddressV4 . cpp <nl> <nl> # include < folly / Format . h > <nl> # include < folly / IPAddress . h > <nl> # include < folly / IPAddressV6 . h > <nl> + # include < folly / detail / IPAddressSource . h > <nl> <nl> using std : : ostream ; <nl> using std : : string ; <nl> uint32_t IPAddressV4 : : toLong ( StringPiece ip ) { <nl> auto str = ip . str ( ) ; <nl> in_addr addr ; <nl> if ( inet_pton ( AF_INET , str . c_str ( ) , & addr ) ! = 1 ) { <nl> - throw IPAddressFormatException ( " Can ' t convert invalid IP ' " , ip , " ' " , <nl> - " to long " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Can ' t convert invalid IP ' " , ip , " ' " , " to long " ) ) ; <nl> } <nl> return addr . s_addr ; <nl> } <nl> IPAddressV4 : : IPAddressV4 ( StringPiece addr ) <nl> { <nl> auto ip = addr . str ( ) ; <nl> if ( inet_pton ( AF_INET , ip . c_str ( ) , & addr_ . inAddr_ ) ! = 1 ) { <nl> - throw IPAddressFormatException ( " Invalid IPv4 address ' " , addr , " ' " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Invalid IPv4 address ' " , addr , " ' " ) ) ; <nl> } <nl> } <nl> <nl> IPAddressV4 : : IPAddressV4 ( const in_addr src ) <nl> / / public <nl> void IPAddressV4 : : setFromBinary ( ByteRange bytes ) { <nl> if ( bytes . size ( ) ! = 4 ) { <nl> - throw IPAddressFormatException ( " Invalid IPv4 binary data : length must " <nl> - " be 4 bytes , got " , bytes . size ( ) ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " Invalid IPv4 binary data : length must " , <nl> + " be 4 bytes , got " , <nl> + bytes . size ( ) ) ) ; <nl> } <nl> memcpy ( & addr_ . inAddr_ . s_addr , bytes . data ( ) , sizeof ( in_addr ) ) ; <nl> } <nl> bool IPAddressV4 : : inSubnet ( StringPiece cidrNetwork ) const { <nl> auto subnetInfo = IPAddress : : createNetwork ( cidrNetwork ) ; <nl> auto addr = subnetInfo . first ; <nl> if ( ! addr . isV4 ( ) ) { <nl> - throw IPAddressFormatException ( " Address ' " , addr . toJson ( ) , " ' " , <nl> - " is not a V4 address " ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " Address ' " , addr . toJson ( ) , " ' " , " is not a V4 address " ) ) ; <nl> } <nl> return inSubnetWithMask ( addr . asV4 ( ) , fetchMask ( subnetInfo . second ) ) ; <nl> } <nl> bool IPAddressV4 : : isMulticast ( ) const { <nl> IPAddressV4 IPAddressV4 : : mask ( size_t numBits ) const { <nl> static const auto bits = bitCount ( ) ; <nl> if ( numBits > bits ) { <nl> - throw IPAddressFormatException ( " numBits ( " , numBits , <nl> - " ) > bitsCount ( " , bits , " ) " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " numBits ( " , numBits , " ) > bitsCount ( " , bits , " ) " ) ) ; <nl> } <nl> <nl> ByteArray4 ba = detail : : Bytes : : mask ( fetchMask ( numBits ) , addr_ . bytes_ ) ; <nl> uint8_t IPAddressV4 : : getNthMSByte ( size_t byteIndex ) const { <nl> const ByteArray4 IPAddressV4 : : fetchMask ( size_t numBits ) { <nl> static const uint8_t bits = bitCount ( ) ; <nl> if ( numBits > bits ) { <nl> - throw IPAddressFormatException ( " IPv4 addresses are 32 bits " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " IPv4 addresses are 32 bits " ) ) ; <nl> } <nl> / / masks_ is backed by an array so is zero indexed <nl> return masks_ [ numBits ] ; <nl> } <nl> + / / public static <nl> + CIDRNetworkV4 IPAddressV4 : : longestCommonPrefix ( <nl> + const CIDRNetworkV4 & one , <nl> + const CIDRNetworkV4 & two ) { <nl> + auto prefix = detail : : Bytes : : longestCommonPrefix ( <nl> + one . first . addr_ . bytes_ , one . second , two . first . addr_ . bytes_ , two . second ) ; <nl> + return { IPAddressV4 ( prefix . first ) , prefix . second } ; <nl> + } <nl> <nl> / / static private <nl> const std : : array < ByteArray4 , 33 > IPAddressV4 : : masks_ = { { <nl> mmm a / folly / IPAddressV4 . h <nl> ppp b / folly / IPAddressV4 . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < functional > <nl> - # include < iostream > <nl> + # include < cstring > <nl> <nl> - # include < boost / operators . hpp > <nl> + # include < array > <nl> + # include < functional > <nl> + # include < iosfwd > <nl> <nl> # include < folly / Hash . h > <nl> # include < folly / Range . h > <nl> typedef std : : array < uint8_t , 4 > ByteArray4 ; <nl> * <nl> * @ see IPAddress <nl> * / <nl> - class IPAddressV4 : boost : : totally_ordered < IPAddressV4 > { <nl> + class IPAddressV4 { <nl> public : <nl> / / returns true iff the input string can be parsed as an ipv4 - address <nl> static bool validate ( StringPiece ip ) ; <nl> class IPAddressV4 : boost : : totally_ordered < IPAddressV4 > { <nl> <nl> / / @ see IPAddress # isZero <nl> bool isZero ( ) const { <nl> - return detail : : Bytes : : isZero ( bytes ( ) , 4 ) ; <nl> + constexpr auto zero = ByteArray4 { { } } ; <nl> + return 0 = = std : : memcmp ( bytes ( ) , zero . data ( ) , zero . size ( ) ) ; <nl> } <nl> <nl> bool isLinkLocalBroadcast ( ) const { <nl> class IPAddressV4 : boost : : totally_ordered < IPAddressV4 > { <nl> * / <nl> static const ByteArray4 fetchMask ( size_t numBits ) ; <nl> <nl> - / / Given 2 IPAddressV4 , mask pairs extract the longest common IPAddress , <nl> + / / Given 2 IPAddressV4 , mask pairs extract the longest common IPAddress , <nl> / / mask pair <nl> static CIDRNetworkV4 longestCommonPrefix ( <nl> - const CIDRNetworkV4 & one , const CIDRNetworkV4 & two ) { <nl> - auto prefix = <nl> - detail : : Bytes : : longestCommonPrefix ( one . first . addr_ . bytes_ , one . second , <nl> - two . first . addr_ . bytes_ , two . second ) ; <nl> - return { IPAddressV4 ( prefix . first ) , prefix . second } ; <nl> - } <nl> + const CIDRNetworkV4 & one , <nl> + const CIDRNetworkV4 & two ) ; <nl> / / Number of bytes in the address representation . <nl> static size_t byteCount ( ) { return 4 ; } <nl> / / get nth most significant bit - 0 indexed <nl> inline bool operator = = ( const IPAddressV4 & addr1 , const IPAddressV4 & addr2 ) { <nl> inline bool operator < ( const IPAddressV4 & addr1 , const IPAddressV4 & addr2 ) { <nl> return ( addr1 . toLongHBO ( ) < addr2 . toLongHBO ( ) ) ; <nl> } <nl> + / / Derived operators <nl> + inline bool operator ! = ( const IPAddressV4 & a , const IPAddressV4 & b ) { <nl> + return ! ( a = = b ) ; <nl> + } <nl> + inline bool operator > ( const IPAddressV4 & a , const IPAddressV4 & b ) { <nl> + return b < a ; <nl> + } <nl> + inline bool operator < = ( const IPAddressV4 & a , const IPAddressV4 & b ) { <nl> + return ! ( a > b ) ; <nl> + } <nl> + inline bool operator > = ( const IPAddressV4 & a , const IPAddressV4 & b ) { <nl> + return ! ( a < b ) ; <nl> + } <nl> <nl> } / / folly <nl> <nl> mmm a / folly / IPAddressV6 . cpp <nl> ppp b / folly / IPAddressV6 . cpp <nl> <nl> # include < folly / IPAddress . h > <nl> # include < folly / IPAddressV4 . h > <nl> # include < folly / MacAddress . h > <nl> + # include < folly / detail / IPAddressSource . h > <nl> <nl> using std : : ostream ; <nl> using std : : string ; <nl> IPAddressV6 : : IPAddressV6 ( StringPiece addr ) { <nl> <nl> / / Allow addresses surrounded in brackets <nl> if ( ip . size ( ) < 2 ) { <nl> - throw IPAddressFormatException ( " Invalid IPv6 address ' " , ip , <nl> - " ' : address too short " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Invalid IPv6 address ' " , ip , " ' : address too short " ) ) ; <nl> } <nl> if ( ip . front ( ) = = ' [ ' & & ip . back ( ) = = ' ] ' ) { <nl> ip = ip . substr ( 1 , ip . size ( ) - 2 ) ; <nl> IPAddressV6 : : IPAddressV6 ( StringPiece addr ) { <nl> scope_ = ipAddr - > sin6_scope_id ; <nl> freeaddrinfo ( result ) ; <nl> } else { <nl> - throw IPAddressFormatException ( " Invalid IPv6 address ' " , ip , " ' " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " Invalid IPv6 address ' " , ip , " ' " ) ) ; <nl> } <nl> } <nl> <nl> IPAddressV6 : : AddressStorage : : AddressStorage ( MacAddress mac ) { <nl> <nl> void IPAddressV6 : : setFromBinary ( ByteRange bytes ) { <nl> if ( bytes . size ( ) ! = 16 ) { <nl> - throw IPAddressFormatException ( " Invalid IPv6 binary data : length must " <nl> - " be 16 bytes , got " , bytes . size ( ) ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " Invalid IPv6 binary data : length must " , <nl> + " be 16 bytes , got " , <nl> + bytes . size ( ) ) ) ; <nl> } <nl> memcpy ( & addr_ . in6Addr_ . s6_addr , bytes . data ( ) , sizeof ( in6_addr ) ) ; <nl> scope_ = 0 ; <nl> bool IPAddressV6 : : inSubnet ( StringPiece cidrNetwork ) const { <nl> auto subnetInfo = IPAddress : : createNetwork ( cidrNetwork ) ; <nl> auto addr = subnetInfo . first ; <nl> if ( ! addr . isV6 ( ) ) { <nl> - throw IPAddressFormatException ( " Address ' " , addr . toJson ( ) , " ' " , <nl> - " is not a V6 address " ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " Address ' " , addr . toJson ( ) , " ' " , " is not a V6 address " ) ) ; <nl> } <nl> return inSubnetWithMask ( addr . asV6 ( ) , fetchMask ( subnetInfo . second ) ) ; <nl> } <nl> IPAddressV6 IPAddressV6 : : getSolicitedNodeAddress ( ) const { <nl> IPAddressV6 IPAddressV6 : : mask ( size_t numBits ) const { <nl> static const auto bits = bitCount ( ) ; <nl> if ( numBits > bits ) { <nl> - throw IPAddressFormatException ( " numBits ( " , numBits , " ) > bitCount ( " , <nl> - bits , " ) " ) ; <nl> + throw IPAddressFormatException ( <nl> + to < std : : string > ( " numBits ( " , numBits , " ) > bitCount ( " , bits , " ) " ) ) ; <nl> } <nl> ByteArray16 ba = detail : : Bytes : : mask ( fetchMask ( numBits ) , addr_ . bytes_ ) ; <nl> return IPAddressV6 ( ba ) ; <nl> string IPAddressV6 : : str ( ) const { <nl> string ip ( buffer ) ; <nl> return ip ; <nl> } else { <nl> - throw IPAddressFormatException ( " Invalid address with hex " , <nl> - " ' " , detail : : Bytes : : toHex ( bytes ( ) , 16 ) , " ' " ) ; <nl> + throw IPAddressFormatException ( to < std : : string > ( <nl> + " Invalid address with hex " , <nl> + " ' " , <nl> + detail : : Bytes : : toHex ( bytes ( ) , 16 ) , <nl> + " ' " ) ) ; <nl> } <nl> } <nl> <nl> const ByteArray16 IPAddressV6 : : fetchMask ( size_t numBits ) { <nl> return masks_ [ numBits ] ; <nl> } <nl> <nl> + / / public static <nl> + CIDRNetworkV6 IPAddressV6 : : longestCommonPrefix ( <nl> + const CIDRNetworkV6 & one , <nl> + const CIDRNetworkV6 & two ) { <nl> + auto prefix = detail : : Bytes : : longestCommonPrefix ( <nl> + one . first . addr_ . bytes_ , one . second , two . first . addr_ . bytes_ , two . second ) ; <nl> + return { IPAddressV6 ( prefix . first ) , prefix . second } ; <nl> + } <nl> + <nl> / / protected <nl> bool IPAddressV6 : : inBinarySubnet ( const std : : array < uint8_t , 2 > addr , <nl> size_t numBits ) const { <nl> mmm a / folly / IPAddressV6 . h <nl> ppp b / folly / IPAddressV6 . h <nl> <nl> <nl> # pragma once <nl> <nl> + # include < cstring > <nl> + <nl> + # include < array > <nl> # include < functional > <nl> - # include < iostream > <nl> + # include < iosfwd > <nl> # include < map > <nl> # include < stdexcept > <nl> <nl> - # include < boost / operators . hpp > <nl> - <nl> # include < folly / Hash . h > <nl> # include < folly / Range . h > <nl> # include < folly / detail / IPAddress . h > <nl> typedef std : : array < uint8_t , 16 > ByteArray16 ; <nl> * Serializing / Deserializing IPAddressB6 ' s on different hosts <nl> * that use link - local scoping probably won ' t work . <nl> * / <nl> - class IPAddressV6 : boost : : totally_ordered < IPAddressV6 > { <nl> + class IPAddressV6 { <nl> public : <nl> / / V6 Address Type <nl> enum Type { <nl> class IPAddressV6 : boost : : totally_ordered < IPAddressV6 > { <nl> <nl> / / @ see IPAddress # isZero <nl> bool isZero ( ) const { <nl> - return detail : : Bytes : : isZero ( bytes ( ) , 16 ) ; <nl> + constexpr auto zero = ByteArray16 { { } } ; <nl> + return 0 = = std : : memcmp ( bytes ( ) , zero . data ( ) , zero . size ( ) ) ; <nl> } <nl> <nl> bool isLinkLocalBroadcast ( ) const ; <nl> class IPAddressV6 : boost : : totally_ordered < IPAddressV6 > { <nl> static const ByteArray16 fetchMask ( size_t numBits ) ; <nl> / / Given 2 IPAddressV6 , mask pairs extract the longest common IPAddress , <nl> / / mask pair <nl> - static CIDRNetworkV6 longestCommonPrefix ( const CIDRNetworkV6 & one , <nl> - const CIDRNetworkV6 & two ) { <nl> - auto prefix = detail : : Bytes : : longestCommonPrefix ( <nl> - one . first . addr_ . bytes_ , one . second , <nl> - two . first . addr_ . bytes_ , two . second ) ; <nl> - return { IPAddressV6 ( prefix . first ) , prefix . second } ; <nl> - } <nl> + static CIDRNetworkV6 longestCommonPrefix ( <nl> + const CIDRNetworkV6 & one , <nl> + const CIDRNetworkV6 & two ) ; <nl> / / Number of bytes in the address representation . <nl> static constexpr size_t byteCount ( ) { return 16 ; } <nl> <nl> inline bool operator < ( const IPAddressV6 & addr1 , const IPAddressV6 & addr2 ) { <nl> return cmp ; <nl> } <nl> } <nl> + / / Derived operators <nl> + inline bool operator ! = ( const IPAddressV6 & a , const IPAddressV6 & b ) { <nl> + return ! ( a = = b ) ; <nl> + } <nl> + inline bool operator > ( const IPAddressV6 & a , const IPAddressV6 & b ) { <nl> + return b < a ; <nl> + } <nl> + inline bool operator < = ( const IPAddressV6 & a , const IPAddressV6 & b ) { <nl> + return ! ( a > b ) ; <nl> + } <nl> + inline bool operator > = ( const IPAddressV6 & a , const IPAddressV6 & b ) { <nl> + return ! ( a < b ) ; <nl> + } <nl> <nl> } / / folly <nl> <nl> mmm a / folly / MacAddress . cpp <nl> ppp b / folly / MacAddress . cpp <nl> <nl> <nl> # include < folly / MacAddress . h > <nl> <nl> + # include < iostream > <nl> + <nl> # include < folly / Exception . h > <nl> # include < folly / IPAddressV6 . h > <nl> <nl> mmm a / folly / MacAddress . h <nl> ppp b / folly / MacAddress . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < iostream > <nl> - <nl> - # include < boost / operators . hpp > <nl> + # include < iosfwd > <nl> <nl> # include < folly / Bits . h > <nl> - # include < folly / Conv . h > <nl> + # include < folly / Range . h > <nl> <nl> namespace folly { <nl> <nl> class IPAddressV6 ; <nl> / * <nl> * MacAddress represents an IEEE 802 MAC address . <nl> * / <nl> - class MacAddress : private boost : : totally_ordered < MacAddress > { <nl> + class MacAddress { <nl> public : <nl> static constexpr size_t SIZE = 6 ; <nl> static const MacAddress BROADCAST ; <nl> class MacAddress : private boost : : totally_ordered < MacAddress > { <nl> return getByte ( 0 ) & 0x2 ; <nl> } <nl> <nl> - / / Equality and less - than operators . <nl> - / / boost : : totally_ordered provides the other comparison operators . <nl> + / / Comparison operators . <nl> <nl> bool operator = = ( const MacAddress & other ) const { <nl> / / All constructors and modifying methods make sure padding is 0 , <nl> class MacAddress : private boost : : totally_ordered < MacAddress > { <nl> return u64HBO ( ) < other . u64HBO ( ) ; <nl> } <nl> <nl> + bool operator ! = ( const MacAddress & other ) const { <nl> + return ! ( * this = = other ) ; <nl> + } <nl> + <nl> + bool operator > ( const MacAddress & other ) const { <nl> + return other < * this ; <nl> + } <nl> + <nl> + bool operator > = ( const MacAddress & other ) const { <nl> + return ! ( * this < other ) ; <nl> + } <nl> + <nl> + bool operator < = ( const MacAddress & other ) const { <nl> + return ! ( * this > other ) ; <nl> + } <nl> + <nl> private : <nl> explicit MacAddress ( uint64_t valueNBO ) { <nl> memcpy ( & bytes_ , & valueNBO , 8 ) ; <nl> mmm a / folly / Makefile . am <nl> ppp b / folly / Makefile . am <nl> nobase_follyinclude_HEADERS = \ <nl> detail / Futex . h \ <nl> detail / GroupVarintDetail . h \ <nl> detail / IPAddress . h \ <nl> + detail / IPAddressSource . h \ <nl> detail / Malloc . h \ <nl> detail / MemoryIdler . h \ <nl> detail / MPMCPipelineDetail . h \ <nl> libfolly_la_SOURCES = \ <nl> Bits . cpp \ <nl> Checksum . cpp \ <nl> detail / CacheLocality . cpp \ <nl> + detail / IPAddress . cpp \ <nl> dynamic . cpp \ <nl> File . cpp \ <nl> FileUtil . cpp \ <nl> mmm a / folly / Range . h <nl> ppp b / folly / Range . h <nl> struct hasher < folly : : Range < T * > , <nl> } <nl> } ; <nl> <nl> + / * * <nl> + * Ubiquitous helper template for knowing what ' s a string <nl> + * / <nl> + template < class T > struct IsSomeString { <nl> + enum { value = std : : is_same < T , std : : string > : : value <nl> + | | std : : is_same < T , fbstring > : : value } ; <nl> + } ; <nl> + <nl> } / / ! namespace folly <nl> <nl> # pragma GCC diagnostic pop <nl> mmm a / folly / SocketAddress . cpp <nl> ppp b / folly / SocketAddress . cpp <nl> <nl> <nl> # include < folly / SocketAddress . h > <nl> <nl> + # include < folly / Exception . h > <nl> # include < folly / Hash . h > <nl> <nl> # include < boost / functional / hash . hpp > <nl> <nl> # include < errno . h > <nl> # include < sstream > <nl> # include < string > <nl> + # include < system_error > <nl> <nl> namespace { <nl> <nl> mmm a / folly / SocketAddress . h <nl> ppp b / folly / SocketAddress . h <nl> <nl> <nl> # include < sys / types . h > <nl> # include < cstddef > <nl> - # include < iostream > <nl> + # include < iosfwd > <nl> # include < string > <nl> <nl> # include < folly / IPAddress . h > <nl> new file mode 100644 <nl> index 00000000000 . . 85fa0930cec <nl> mmm / dev / null <nl> ppp b / folly / detail / IPAddress . cpp <nl> <nl> + / * <nl> + * Copyright 2016 Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # include < folly / detail / IPAddress . h > <nl> + <nl> + # include < folly / Format . h > <nl> + <nl> + namespace folly { namespace detail { <nl> + <nl> + std : : string familyNameStrDefault ( sa_family_t family ) { <nl> + return folly : : sformat ( " sa_family_t ( { } ) " , folly : : to < std : : string > ( family ) ) ; <nl> + } <nl> + <nl> + [ [ noreturn ] ] void getNthMSBitImplThrow ( size_t bitCount , sa_family_t family ) { <nl> + throw std : : invalid_argument ( folly : : to < std : : string > ( <nl> + " Bit index must be < " , <nl> + bitCount , <nl> + " for addresses of type : " , <nl> + familyNameStr ( family ) ) ) ; <nl> + } <nl> + <nl> + } } <nl> mmm a / folly / detail / IPAddress . h <nl> ppp b / folly / detail / IPAddress . h <nl> <nl> <nl> # pragma once <nl> <nl> - # include < boost / noncopyable . hpp > <nl> - # include < glog / logging . h > <nl> - <nl> - # include < algorithm > <nl> - # include < array > <nl> - # include < cstring > <nl> # include < string > <nl> - # include < sstream > <nl> - # include < type_traits > <nl> - # include < vector > <nl> # include < sys / types . h > <nl> - <nl> - # include < folly / Conv . h > <nl> - # include < folly / Format . h > <nl> # include < folly / portability / Sockets . h > <nl> <nl> - / / BSDish platforms don ' t provide standard access to s6_addr16 <nl> - # ifndef s6_addr16 <nl> - # if defined ( __APPLE__ ) | | defined ( __FreeBSD__ ) | | \ <nl> - defined ( __NetBSD__ ) | | defined ( __OpenBSD__ ) <nl> - # define s6_addr16 __u6_addr . __u6_addr16 <nl> - # endif <nl> - # endif <nl> - <nl> namespace folly { namespace detail { <nl> <nl> + std : : string familyNameStrDefault ( sa_family_t family ) ; <nl> + <nl> inline std : : string familyNameStr ( sa_family_t family ) { <nl> switch ( family ) { <nl> case AF_INET : <nl> inline std : : string familyNameStr ( sa_family_t family ) { <nl> case AF_UNIX : <nl> return " AF_UNIX " ; <nl> default : <nl> - return folly : : format ( " sa_family_t ( { } ) " , <nl> - folly : : to < std : : string > ( family ) ) . str ( ) ; <nl> + return familyNameStrDefault ( family ) ; <nl> } <nl> } <nl> <nl> - template < typename IPAddrType > <nl> - inline bool getNthMSBitImpl ( const IPAddrType & ip , uint8_t bitIndex , <nl> - sa_family_t family ) { <nl> + [ [ noreturn ] ] void getNthMSBitImplThrow ( size_t bitCount , sa_family_t family ) ; <nl> + <nl> + template < typename IPAddrType > <nl> + inline bool <nl> + getNthMSBitImpl ( const IPAddrType & ip , uint8_t bitIndex , sa_family_t family ) { <nl> if ( bitIndex > = ip . bitCount ( ) ) { <nl> - throw std : : invalid_argument ( folly : : to < std : : string > ( " Bit index must be < " , <nl> - ip . bitCount ( ) , " for addresses of type : " , familyNameStr ( family ) ) ) ; <nl> + getNthMSBitImplThrow ( ip . bitCount ( ) , family ) ; <nl> } <nl> / / Underlying bytes are in n / w byte order <nl> return ( ip . getNthMSByte ( bitIndex / 8 ) & ( 0x80 > > ( bitIndex % 8 ) ) ) ! = 0 ; <nl> } <nl> <nl> - / * * <nl> - * Helper for working with unsigned char * or uint8_t * ByteArray values <nl> - * / <nl> - struct Bytes : private boost : : noncopyable { <nl> - / / return true if all values of src are zero <nl> - static bool isZero ( const uint8_t * src , std : : size_t len ) { <nl> - for ( std : : size_t i = 0 ; i < len ; i + + ) { <nl> - if ( src [ i ] ! = 0x00 ) { <nl> - return false ; <nl> - } <nl> - } <nl> - return true ; <nl> - } <nl> - <nl> - / / mask the values from two byte arrays , returning a new byte array <nl> - template < std : : size_t N > <nl> - static std : : array < uint8_t , N > mask ( const std : : array < uint8_t , N > & a , <nl> - const std : : array < uint8_t , N > & b ) { <nl> - static_assert ( N > 0 , " Can ' t mask an empty ByteArray " ) ; <nl> - std : : size_t asize = a . size ( ) ; <nl> - std : : array < uint8_t , N > ba { { 0 } } ; <nl> - for ( std : : size_t i = 0 ; i < asize ; i + + ) { <nl> - ba [ i ] = a [ i ] & b [ i ] ; <nl> - } <nl> - return ba ; <nl> - } <nl> - <nl> - template < std : : size_t N > <nl> - static std : : pair < std : : array < uint8_t , N > , uint8_t > <nl> - longestCommonPrefix ( <nl> - const std : : array < uint8_t , N > & one , uint8_t oneMask , <nl> - const std : : array < uint8_t , N > & two , uint8_t twoMask ) { <nl> - static constexpr auto kBitCount = N * 8 ; <nl> - static constexpr std : : array < uint8_t , 8 > kMasks { { <nl> - 0x80 , / / / 1 <nl> - 0xc0 , / / / 2 <nl> - 0xe0 , / / / 3 <nl> - 0xf0 , / / / 4 <nl> - 0xf8 , / / / 5 <nl> - 0xfc , / / / 6 <nl> - 0xfe , / / / 7 <nl> - 0xff / / / 8 <nl> - } } ; <nl> - if ( oneMask > kBitCount | | twoMask > kBitCount ) { <nl> - throw std : : invalid_argument ( folly : : to < std : : string > ( " Invalid mask " <nl> - " length : " , oneMask > twoMask ? oneMask : twoMask , <nl> - " . Mask length must be < = " , kBitCount ) ) ; <nl> - } <nl> - <nl> - auto mask = std : : min ( oneMask , twoMask ) ; <nl> - uint8_t byteIndex = 0 ; <nl> - std : : array < uint8_t , N > ba { { 0 } } ; <nl> - / / Compare a byte at a time . Note - I measured compared this with <nl> - / / going multiple bytes at a time ( 8 , 4 , 2 and 1 ) . It turns out <nl> - / / to be 20 - 25 % slower for 4 and 16 byte arrays . <nl> - while ( byteIndex * 8 < mask & & one [ byteIndex ] = = two [ byteIndex ] ) { <nl> - ba [ byteIndex ] = one [ byteIndex ] ; <nl> - + + byteIndex ; <nl> - } <nl> - auto bitIndex = std : : min ( mask , ( uint8_t ) ( byteIndex * 8 ) ) ; <nl> - / / Compute the bit up to which the two byte arrays match in the <nl> - / / unmatched byte . <nl> - / / Here the check is bitIndex < mask since the 0th mask entry in <nl> - / / kMasks array holds the mask for masking the MSb in this byte . <nl> - / / We could instead make it hold so that no 0th entry masks no <nl> - / / bits but thats a useless iteration . <nl> - while ( bitIndex < mask & & ( ( one [ bitIndex / 8 ] & kMasks [ bitIndex % 8 ] ) = = <nl> - ( two [ bitIndex / 8 ] & kMasks [ bitIndex % 8 ] ) ) ) { <nl> - ba [ bitIndex / 8 ] = one [ bitIndex / 8 ] & kMasks [ bitIndex % 8 ] ; <nl> - + + bitIndex ; <nl> - } <nl> - return { ba , bitIndex } ; <nl> - } <nl> - <nl> - / / create an in_addr from an uint8_t * <nl> - static inline in_addr mkAddress4 ( const uint8_t * src ) { <nl> - union { <nl> - in_addr addr ; <nl> - uint8_t bytes [ 4 ] ; <nl> - } addr ; <nl> - std : : memset ( & addr , 0 , 4 ) ; <nl> - std : : memcpy ( addr . bytes , src , 4 ) ; <nl> - return addr . addr ; <nl> - } <nl> - <nl> - / / create an in6_addr from an uint8_t * <nl> - static inline in6_addr mkAddress6 ( const uint8_t * src ) { <nl> - in6_addr addr ; <nl> - std : : memset ( & addr , 0 , 16 ) ; <nl> - std : : memcpy ( addr . s6_addr , src , 16 ) ; <nl> - return addr ; <nl> - } <nl> - <nl> - / / convert an uint8_t * to its hex value <nl> - static std : : string toHex ( const uint8_t * src , std : : size_t len ) { <nl> - static const char * const lut = " 0123456789abcdef " ; <nl> - std : : stringstream ss ; <nl> - for ( std : : size_t i = 0 ; i < len ; i + + ) { <nl> - const unsigned char c = src [ i ] ; <nl> - ss < < lut [ c > > 4 ] < < lut [ c & 15 ] ; <nl> - } <nl> - return ss . str ( ) ; <nl> - } <nl> - <nl> - private : <nl> - Bytes ( ) = delete ; <nl> - ~ Bytes ( ) = delete ; <nl> - } ; <nl> - <nl> - / / <nl> - / / Write a maximum amount of base - converted character digits , of a <nl> - / / given base , from an unsigned integral type into a byte buffer of <nl> - / / sufficient size . <nl> - / / <nl> - / / This function does not append null terminators . <nl> - / / <nl> - / / Output buffer size must be guaranteed by caller ( indirectly <nl> - / / controlled by DigitCount template parameter ) . <nl> - / / <nl> - / / Having these parameters at compile time allows compiler to <nl> - / / precompute several of the values , use smaller instructions , and <nl> - / / better optimize surrounding code . <nl> - / / <nl> - / / IntegralType : <nl> - / / - Something like uint8_t , uint16_t , etc <nl> - / / <nl> - / / DigitCount is the maximum number of digits to be printed <nl> - / / - This is tied to IntegralType and Base . For example : <nl> - / / - uint8_t in base 10 will print at most 3 digits ( " 255 " ) <nl> - / / - uint16_t in base 16 will print at most 4 hex digits ( " FFFF " ) <nl> - / / <nl> - / / Base is the desired output base of the string <nl> - / / - Base 10 will print [ 0 - 9 ] , base 16 will print [ 0 - 9a - f ] <nl> - / / <nl> - / / PrintAllDigits : <nl> - / / - Whether or not leading zeros should be printed <nl> - / / <nl> - template < class IntegralType , <nl> - IntegralType DigitCount , <nl> - IntegralType Base = 10 , <nl> - bool PrintAllDigits = false , <nl> - class = typename std : : enable_if < <nl> - std : : is_integral < IntegralType > : : value & & <nl> - std : : is_unsigned < IntegralType > : : value , <nl> - bool > : : type > <nl> - inline void writeIntegerString ( <nl> - IntegralType val , <nl> - char * * buffer ) { <nl> - char * buf = * buffer ; <nl> - <nl> - if ( ! PrintAllDigits & & val = = 0 ) { <nl> - * ( buf + + ) = ' 0 ' ; <nl> - * buffer = buf ; <nl> - return ; <nl> - } <nl> - <nl> - IntegralType powerToPrint = 1 ; <nl> - for ( int i = 1 ; i < DigitCount ; + + i ) { <nl> - powerToPrint * = Base ; <nl> - } <nl> - <nl> - bool found = PrintAllDigits ; <nl> - while ( powerToPrint ) { <nl> - <nl> - if ( found | | powerToPrint < = val ) { <nl> - IntegralType value = val / powerToPrint ; <nl> - if ( Base = = 10 | | value < 10 ) { <nl> - value + = ' 0 ' ; <nl> - } else { <nl> - value + = ( ' a ' - 10 ) ; <nl> - } <nl> - * ( buf + + ) = value ; <nl> - val % = powerToPrint ; <nl> - found = true ; <nl> - } <nl> - <nl> - powerToPrint / = Base ; <nl> - } <nl> - <nl> - * buffer = buf ; <nl> - } <nl> - <nl> - inline std : : string fastIpv4ToString ( <nl> - const in_addr & inAddr ) { <nl> - const uint8_t * octets = reinterpret_cast < const uint8_t * > ( & inAddr . s_addr ) ; <nl> - char str [ sizeof ( " 255 . 255 . 255 . 255 " ) ] ; <nl> - char * buf = str ; <nl> - <nl> - writeIntegerString < uint8_t , 3 > ( octets [ 0 ] , & buf ) ; <nl> - * ( buf + + ) = ' . ' ; <nl> - writeIntegerString < uint8_t , 3 > ( octets [ 1 ] , & buf ) ; <nl> - * ( buf + + ) = ' . ' ; <nl> - writeIntegerString < uint8_t , 3 > ( octets [ 2 ] , & buf ) ; <nl> - * ( buf + + ) = ' . ' ; <nl> - writeIntegerString < uint8_t , 3 > ( octets [ 3 ] , & buf ) ; <nl> - <nl> - return std : : string ( str , buf - str ) ; <nl> - } <nl> - <nl> - inline std : : string fastIpv6ToString ( const in6_addr & in6Addr ) { <nl> - # ifdef _MSC_VER <nl> - const uint16_t * bytes = reinterpret_cast < const uint16_t * > ( & in6Addr . u . Word ) ; <nl> - # else <nl> - const uint16_t * bytes = reinterpret_cast < const uint16_t * > ( & in6Addr . s6_addr16 ) ; <nl> - # endif <nl> - char str [ sizeof ( " 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 " ) ] ; <nl> - char * buf = str ; <nl> - <nl> - for ( int i = 0 ; i < 8 ; + + i ) { <nl> - writeIntegerString < uint16_t , <nl> - 4 , / / at most 4 hex digits per ushort <nl> - 16 , / / base 16 ( hex ) <nl> - true > ( htons ( bytes [ i ] ) , & buf ) ; <nl> - <nl> - if ( i ! = 7 ) { <nl> - * ( buf + + ) = ' : ' ; <nl> - } <nl> - } <nl> - <nl> - return std : : string ( str , buf - str ) ; <nl> - } <nl> - <nl> } } / / folly : : detail <nl> new file mode 100644 <nl> index 00000000000 . . e8a18110900 <nl> mmm / dev / null <nl> ppp b / folly / detail / IPAddressSource . h <nl> <nl> + / * <nl> + * Copyright 2016 Facebook , Inc . <nl> + * <nl> + * Licensed under the Apache License , Version 2 . 0 ( the " License " ) ; <nl> + * you may not use this file except in compliance with the License . <nl> + * You may obtain a copy of the License at <nl> + * <nl> + * http : / / www . apache . org / licenses / LICENSE - 2 . 0 <nl> + * <nl> + * Unless required by applicable law or agreed to in writing , software <nl> + * distributed under the License is distributed on an " AS IS " BASIS , <nl> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied . <nl> + * See the License for the specific language governing permissions and <nl> + * limitations under the License . <nl> + * / <nl> + <nl> + # pragma once <nl> + <nl> + # include < glog / logging . h > <nl> + # include < sys / types . h > <nl> + # include < algorithm > <nl> + # include < array > <nl> + # include < cstring > <nl> + # include < string > <nl> + # include < type_traits > <nl> + <nl> + # include < folly / Conv . h > <nl> + # include < folly / detail / IPAddress . h > <nl> + <nl> + / / BSDish platforms don ' t provide standard access to s6_addr16 <nl> + # ifndef s6_addr16 <nl> + # if defined ( __APPLE__ ) | | defined ( __FreeBSD__ ) | | defined ( __NetBSD__ ) | | \ <nl> + defined ( __OpenBSD__ ) <nl> + # define s6_addr16 __u6_addr . __u6_addr16 <nl> + # endif <nl> + # endif <nl> + <nl> + namespace folly { <nl> + namespace detail { <nl> + <nl> + / * * <nl> + * Helper for working with unsigned char * or uint8_t * ByteArray values <nl> + * / <nl> + struct Bytes { <nl> + / / mask the values from two byte arrays , returning a new byte array <nl> + template < std : : size_t N > <nl> + static std : : array < uint8_t , N > mask ( <nl> + const std : : array < uint8_t , N > & a , <nl> + const std : : array < uint8_t , N > & b ) { <nl> + static_assert ( N > 0 , " Can ' t mask an empty ByteArray " ) ; <nl> + std : : size_t asize = a . size ( ) ; <nl> + std : : array < uint8_t , N > ba { { 0 } } ; <nl> + for ( std : : size_t i = 0 ; i < asize ; i + + ) { <nl> + ba [ i ] = a [ i ] & b [ i ] ; <nl> + } <nl> + return ba ; <nl> + } <nl> + <nl> + template < std : : size_t N > <nl> + static std : : pair < std : : array < uint8_t , N > , uint8_t > longestCommonPrefix ( <nl> + const std : : array < uint8_t , N > & one , <nl> + uint8_t oneMask , <nl> + const std : : array < uint8_t , N > & two , <nl> + uint8_t twoMask ) { <nl> + static constexpr auto kBitCount = N * 8 ; <nl> + static constexpr std : : array < uint8_t , 8 > kMasks { { <nl> + 0x80 , / / / 1 <nl> + 0xc0 , / / / 2 <nl> + 0xe0 , / / / 3 <nl> + 0xf0 , / / / 4 <nl> + 0xf8 , / / / 5 <nl> + 0xfc , / / / 6 <nl> + 0xfe , / / / 7 <nl> + 0xff / / / 8 <nl> + } } ; <nl> + if ( oneMask > kBitCount | | twoMask > kBitCount ) { <nl> + throw std : : invalid_argument ( folly : : to < std : : string > ( <nl> + " Invalid mask " <nl> + " length : " , <nl> + oneMask > twoMask ? oneMask : twoMask , <nl> + " . Mask length must be < = " , <nl> + kBitCount ) ) ; <nl> + } <nl> + <nl> + auto mask = std : : min ( oneMask , twoMask ) ; <nl> + uint8_t byteIndex = 0 ; <nl> + std : : array < uint8_t , N > ba { { 0 } } ; <nl> + / / Compare a byte at a time . Note - I measured compared this with <nl> + / / going multiple bytes at a time ( 8 , 4 , 2 and 1 ) . It turns out <nl> + / / to be 20 - 25 % slower for 4 and 16 byte arrays . <nl> + while ( byteIndex * 8 < mask & & one [ byteIndex ] = = two [ byteIndex ] ) { <nl> + ba [ byteIndex ] = one [ byteIndex ] ; <nl> + + + byteIndex ; <nl> + } <nl> + auto bitIndex = std : : min ( mask , ( uint8_t ) ( byteIndex * 8 ) ) ; <nl> + / / Compute the bit up to which the two byte arrays match in the <nl> + / / unmatched byte . <nl> + / / Here the check is bitIndex < mask since the 0th mask entry in <nl> + / / kMasks array holds the mask for masking the MSb in this byte . <nl> + / / We could instead make it hold so that no 0th entry masks no <nl> + / / bits but thats a useless iteration . <nl> + while ( bitIndex < mask & & ( ( one [ bitIndex / 8 ] & kMasks [ bitIndex % 8 ] ) = = <nl> + ( two [ bitIndex / 8 ] & kMasks [ bitIndex % 8 ] ) ) ) { <nl> + ba [ bitIndex / 8 ] = one [ bitIndex / 8 ] & kMasks [ bitIndex % 8 ] ; <nl> + + + bitIndex ; <nl> + } <nl> + return { ba , bitIndex } ; <nl> + } <nl> + <nl> + / / create an in_addr from an uint8_t * <nl> + static inline in_addr mkAddress4 ( const uint8_t * src ) { <nl> + union { <nl> + in_addr addr ; <nl> + uint8_t bytes [ 4 ] ; <nl> + } addr ; <nl> + std : : memset ( & addr , 0 , 4 ) ; <nl> + std : : memcpy ( addr . bytes , src , 4 ) ; <nl> + return addr . addr ; <nl> + } <nl> + <nl> + / / create an in6_addr from an uint8_t * <nl> + static inline in6_addr mkAddress6 ( const uint8_t * src ) { <nl> + in6_addr addr ; <nl> + std : : memset ( & addr , 0 , 16 ) ; <nl> + std : : memcpy ( addr . s6_addr , src , 16 ) ; <nl> + return addr ; <nl> + } <nl> + <nl> + / / convert an uint8_t * to its hex value <nl> + static std : : string toHex ( const uint8_t * src , std : : size_t len ) { <nl> + static const char * const lut = " 0123456789abcdef " ; <nl> + std : : string out ( len * 2 , 0 ) ; <nl> + for ( std : : size_t i = 0 ; i < len ; i + + ) { <nl> + const unsigned char c = src [ i ] ; <nl> + out [ i * 2 + 0 ] = lut [ c > > 4 ] ; <nl> + out [ i + 2 + 1 ] = lut [ c & 15 ] ; <nl> + } <nl> + return out ; <nl> + } <nl> + <nl> + private : <nl> + Bytes ( ) = delete ; <nl> + ~ Bytes ( ) = delete ; <nl> + } ; <nl> + <nl> + / / <nl> + / / Write a maximum amount of base - converted character digits , of a <nl> + / / given base , from an unsigned integral type into a byte buffer of <nl> + / / sufficient size . <nl> + / / <nl> + / / This function does not append null terminators . <nl> + / / <nl> + / / Output buffer size must be guaranteed by caller ( indirectly <nl> + / / controlled by DigitCount template parameter ) . <nl> + / / <nl> + / / Having these parameters at compile time allows compiler to <nl> + / / precompute several of the values , use smaller instructions , and <nl> + / / better optimize surrounding code . <nl> + / / <nl> + / / IntegralType : <nl> + / / - Something like uint8_t , uint16_t , etc <nl> + / / <nl> + / / DigitCount is the maximum number of digits to be printed <nl> + / / - This is tied to IntegralType and Base . For example : <nl> + / / - uint8_t in base 10 will print at most 3 digits ( " 255 " ) <nl> + / / - uint16_t in base 16 will print at most 4 hex digits ( " FFFF " ) <nl> + / / <nl> + / / Base is the desired output base of the string <nl> + / / - Base 10 will print [ 0 - 9 ] , base 16 will print [ 0 - 9a - f ] <nl> + / / <nl> + / / PrintAllDigits : <nl> + / / - Whether or not leading zeros should be printed <nl> + / / <nl> + template < <nl> + class IntegralType , <nl> + IntegralType DigitCount , <nl> + IntegralType Base = 10 , <nl> + bool PrintAllDigits = false , <nl> + class = typename std : : enable_if < <nl> + std : : is_integral < IntegralType > : : value & & <nl> + std : : is_unsigned < IntegralType > : : value , <nl> + bool > : : type > <nl> + inline void writeIntegerString ( IntegralType val , char * * buffer ) { <nl> + char * buf = * buffer ; <nl> + <nl> + if ( ! PrintAllDigits & & val = = 0 ) { <nl> + * ( buf + + ) = ' 0 ' ; <nl> + * buffer = buf ; <nl> + return ; <nl> + } <nl> + <nl> + IntegralType powerToPrint = 1 ; <nl> + for ( int i = 1 ; i < DigitCount ; + + i ) { <nl> + powerToPrint * = Base ; <nl> + } <nl> + <nl> + bool found = PrintAllDigits ; <nl> + while ( powerToPrint ) { <nl> + if ( found | | powerToPrint < = val ) { <nl> + IntegralType value = val / powerToPrint ; <nl> + if ( Base = = 10 | | value < 10 ) { <nl> + value + = ' 0 ' ; <nl> + } else { <nl> + value + = ( ' a ' - 10 ) ; <nl> + } <nl> + * ( buf + + ) = value ; <nl> + val % = powerToPrint ; <nl> + found = true ; <nl> + } <nl> + <nl> + powerToPrint / = Base ; <nl> + } <nl> + <nl> + * buffer = buf ; <nl> + } <nl> + <nl> + inline std : : string fastIpv4ToString ( const in_addr & inAddr ) { <nl> + const uint8_t * octets = reinterpret_cast < const uint8_t * > ( & inAddr . s_addr ) ; <nl> + char str [ sizeof ( " 255 . 255 . 255 . 255 " ) ] ; <nl> + char * buf = str ; <nl> + <nl> + writeIntegerString < uint8_t , 3 > ( octets [ 0 ] , & buf ) ; <nl> + * ( buf + + ) = ' . ' ; <nl> + writeIntegerString < uint8_t , 3 > ( octets [ 1 ] , & buf ) ; <nl> + * ( buf + + ) = ' . ' ; <nl> + writeIntegerString < uint8_t , 3 > ( octets [ 2 ] , & buf ) ; <nl> + * ( buf + + ) = ' . ' ; <nl> + writeIntegerString < uint8_t , 3 > ( octets [ 3 ] , & buf ) ; <nl> + <nl> + return std : : string ( str , buf - str ) ; <nl> + } <nl> + <nl> + inline std : : string fastIpv6ToString ( const in6_addr & in6Addr ) { <nl> + # ifdef _MSC_VER <nl> + const uint16_t * bytes = reinterpret_cast < const uint16_t * > ( & in6Addr . u . Word ) ; <nl> + # else <nl> + const uint16_t * bytes = reinterpret_cast < const uint16_t * > ( & in6Addr . s6_addr16 ) ; <nl> + # endif <nl> + char str [ sizeof ( " 2001 : 0db8 : 0000 : 0000 : 0000 : ff00 : 0042 : 8329 " ) ] ; <nl> + char * buf = str ; <nl> + <nl> + for ( int i = 0 ; i < 8 ; + + i ) { <nl> + writeIntegerString < <nl> + uint16_t , <nl> + 4 , / / at most 4 hex digits per ushort <nl> + 16 , / / base 16 ( hex ) <nl> + true > ( htons ( bytes [ i ] ) , & buf ) ; <nl> + <nl> + if ( i ! = 7 ) { <nl> + * ( buf + + ) = ' : ' ; <nl> + } <nl> + } <nl> + <nl> + return std : : string ( str , buf - str ) ; <nl> + } <nl> + } <nl> + } <nl> mmm a / folly / io / async / AsyncServerSocket . cpp <nl> ppp b / folly / io / async / AsyncServerSocket . cpp <nl> <nl> <nl> # include < folly / FileUtil . h > <nl> # include < folly / SocketAddress . h > <nl> + # include < folly / String . h > <nl> # include < folly / detail / SocketFastOpen . h > <nl> # include < folly / io / async / EventBase . h > <nl> # include < folly / io / async / NotificationQueue . h > <nl> mmm a / folly / io / async / test / SocketClient . cpp <nl> ppp b / folly / io / async / test / SocketClient . cpp <nl> <nl> * / <nl> # include < folly / io / async / test / BlockingSocket . h > <nl> <nl> + # include < iostream > <nl> + <nl> # include < folly / ExceptionWrapper . h > <nl> # include < gflags / gflags . h > <nl> <nl> mmm a / folly / test / IPAddressTest . cpp <nl> ppp b / folly / test / IPAddressTest . cpp <nl> <nl> <nl> # include < folly / Bits . h > <nl> # include < folly / Format . h > <nl> - # include < folly / String . h > <nl> # include < folly / MacAddress . h > <nl> + # include < folly / String . h > <nl> + # include < folly / detail / IPAddressSource . h > <nl> <nl> using namespace folly ; <nl> using namespace std ; <nl> mmm a / folly / test / MacAddressTest . cpp <nl> ppp b / folly / test / MacAddressTest . cpp <nl> <nl> <nl> # include < gtest / gtest . h > <nl> <nl> + # include < folly / Conv . h > <nl> # include < folly / IPAddressV6 . h > <nl> # include < folly / MacAddress . h > <nl> <nl> mmm a / folly / test / SocketAddressTest . cpp <nl> ppp b / folly / test / SocketAddressTest . cpp <nl> <nl> # include < gtest / gtest . h > <nl> # include < iostream > <nl> # include < sstream > <nl> + # include < system_error > <nl> + <nl> # include < folly / test / SocketAddressTestHelper . h > <nl> <nl> using namespace boost ; <nl>
|
Move IPAddress definitions to source files
|
facebook/folly
|
c8f4d603e448cdd2749f2850ef70952932962fa1
|
2016-07-09T09:53:41Z
|
mmm a / db / dur . cpp <nl> ppp b / db / dur . cpp <nl> namespace mongo { <nl> ( 2 ) todo should we do this using N threads ? would be quite easy <nl> see Hackenberg paper table 5 and 6 . 2 threads might be a good balance . <nl> <nl> + ( 3 ) with enough work , we could do this outside the read lock . it ' s a bit tricky though . <nl> + - we couldn ' t do it from the private views then as they may be changing . would have to then <nl> + be from the journal alignedbuffer . <nl> + - we need to be careful the file isn ' t unmapped on us - - perhaps a mutex or something <nl> + with MongoMMF on closes or something to coordinate that . <nl> + <nl> locking : in read lock when called <nl> * / <nl> static void WRITETODATAFILES ( ) { <nl>
|
comment
|
mongodb/mongo
|
b55418440ae733de956c3b96aa34a68de5246186
|
2010-12-14T23:06:59Z
|
mmm a / dbms / src / Client / Client . cpp <nl> ppp b / dbms / src / Client / Client . cpp <nl> class Client : public Poco : : Util : : Application <nl> ( " port " , boost : : program_options : : value < int > ( ) - > default_value ( 9000 ) , " server port " ) <nl> ( " user , u " , boost : : program_options : : value < std : : string > ( ) , " user " ) <nl> ( " password " , boost : : program_options : : value < std : : string > ( ) , " password " ) <nl> - ( " query , q " , boost : : program_options : : value < std : : string > ( ) , " query " ) <nl> + ( " query , q , e " , boost : : program_options : : value < std : : string > ( ) , " query " ) <nl> ( " database , d " , boost : : program_options : : value < std : : string > ( ) , " database " ) <nl> ( " multiline , m " , " multiline " ) <nl> ( " multiquery , n " , " multiquery " ) <nl>
|
dbms : Client : fixed error in command line options [ # METR - 2944 ] .
|
ClickHouse/ClickHouse
|
ca4717e69abb9925724518ea3c85a12e54ad4749
|
2014-05-14T17:35:51Z
|
mmm a / include / v8 . h <nl> ppp b / include / v8 . h <nl> class V8_EXPORT Object : public Value { <nl> * / <nl> bool IsCallable ( ) ; <nl> <nl> + / * * <nl> + * True if this object is a constructor . <nl> + * / <nl> + bool IsConstructor ( ) ; <nl> + <nl> / * * <nl> * Call an Object as a function if a callback is set by the <nl> * ObjectTemplate : : SetCallAsFunctionHandler method . <nl> mmm a / src / api . cc <nl> ppp b / src / api . cc <nl> bool v8 : : Object : : IsCallable ( ) { <nl> return self - > IsCallable ( ) ; <nl> } <nl> <nl> + bool v8 : : Object : : IsConstructor ( ) { <nl> + auto self = Utils : : OpenHandle ( this ) ; <nl> + return self - > IsConstructor ( ) ; <nl> + } <nl> <nl> MaybeLocal < Value > Object : : CallAsFunction ( Local < Context > context , <nl> Local < Value > recv , int argc , <nl> mmm a / test / cctest / test - api . cc <nl> ppp b / test / cctest / test - api . cc <nl> THREADED_TEST ( FunctionRemovePrototype ) { <nl> Local < v8 : : FunctionTemplate > t1 = v8 : : FunctionTemplate : : New ( isolate ) ; <nl> t1 - > RemovePrototype ( ) ; <nl> Local < v8 : : Function > fun = t1 - > GetFunction ( context . local ( ) ) . ToLocalChecked ( ) ; <nl> + CHECK ( ! fun - > IsConstructor ( ) ) ; <nl> CHECK ( context - > Global ( ) - > Set ( context . local ( ) , v8_str ( " fun " ) , fun ) . FromJust ( ) ) ; <nl> CHECK ( ! CompileRun ( " ' prototype ' in fun " ) <nl> - > BooleanValue ( context . local ( ) ) <nl>
|
Expose IsConstructor to the C + + API
|
v8/v8
|
acbbd59f29306a679e9e85b8ccfaa4eaaf969a6d
|
2016-05-09T13:24:21Z
|
mmm a / Unreal / Plugins / AirSim / Source / AirBlueprintLib . cpp <nl> ppp b / Unreal / Plugins / AirSim / Source / AirBlueprintLib . cpp <nl> <nl> # include " Kismet / KismetStringLibrary . h " <nl> # include " MessageDialog . h " <nl> # include " Engine / LocalPlayer . h " <nl> + # include " Slate / SceneViewport . h " <nl> # include " Engine / Engine . h " <nl> <nl> / * <nl> parameters - > camel_case <nl> <nl> <nl> bool UAirBlueprintLib : : log_messages_hidden = false ; <nl> + uint32_t UAirBlueprintLib : : FlushOnDrawCount = 0 ; <nl> msr : : airlib : : AirSimSettings : : SegmentationSettings : : MeshNamingMethodType UAirBlueprintLib : : mesh_naming_method = <nl> msr : : airlib : : AirSimSettings : : SegmentationSettings : : MeshNamingMethodType : : OwnerName ; <nl> <nl> void UAirBlueprintLib : : enableWorldRendering ( AActor * context , bool enable ) <nl> } <nl> } <nl> <nl> + void UAirBlueprintLib : : enableViewportRendering ( AActor * context , bool enable ) <nl> + { <nl> + / / Enable / disable primary viewport rendering flag <nl> + auto * viewport = context - > GetWorld ( ) - > GetGameViewport ( ) ; <nl> + if ( ! viewport ) <nl> + return ; <nl> + <nl> + if ( ! enable ) { <nl> + / / This disables rendering of the main viewport in the same way as the <nl> + / / console command " show rendering " would do . <nl> + viewport - > EngineShowFlags . SetRendering ( false ) ; <nl> + <nl> + / / When getting an image through the API , the image is produced after the render <nl> + / / thread has finished rendering the current and the subsequent frame . This means <nl> + / / that the frame rate for obtaining images through the API is only half as high as <nl> + / / it could be , since only every other image is actually captured . We work around <nl> + / / this by telling the viewport to flush the rendering queue at the end of each <nl> + / / drawn frame so that it executes our render request at that point already . <nl> + / / Do this only if the main viewport is not being rendered anyway in case there are <nl> + / / any adverse performance effects during main rendering . <nl> + / / HACK : FViewPort doesn ' t expose this field so we are doing dirty work around by maintaining count by ourselves <nl> + if ( FlushOnDrawCount = = 0 ) <nl> + viewport - > GetGameViewport ( ) - > IncrementFlushOnDraw ( ) ; <nl> + } <nl> + else { <nl> + viewport - > EngineShowFlags . SetRendering ( true ) ; <nl> + <nl> + / / HACK : FViewPort doesn ' t expose this field so we are doing dirty work around by maintaining count by ourselves <nl> + if ( FlushOnDrawCount > 0 ) <nl> + viewport - > GetGameViewport ( ) - > DecrementFlushOnDraw ( ) ; <nl> + } <nl> + } <nl> + <nl> + void UAirBlueprintLib : : OnBeginPlay ( ) <nl> + { <nl> + FlushOnDrawCount = 0 ; <nl> + } <nl> + <nl> + void UAirBlueprintLib : : OnEndPlay ( ) <nl> + { <nl> + / / nothing to do for now <nl> + } <nl> + <nl> void UAirBlueprintLib : : LogMessage ( const FString & prefix , const FString & suffix , LogDebugLevel level , float persist_sec ) <nl> { <nl> if ( log_messages_hidden ) <nl> mmm a / Unreal / Plugins / AirSim / Source / AirBlueprintLib . h <nl> ppp b / Unreal / Plugins / AirSim / Source / AirBlueprintLib . h <nl> class UAirBlueprintLib : public UBlueprintFunctionLibrary <nl> GENERATED_BODY ( ) <nl> <nl> public : <nl> + static void OnBeginPlay ( ) ; <nl> + static void OnEndPlay ( ) ; <nl> static void LogMessageString ( const std : : string & prefix , const std : : string & suffix , LogDebugLevel level , float persist_sec = 60 ) ; <nl> UFUNCTION ( BlueprintCallable , Category = " Utils " ) <nl> static void LogMessage ( const FString & prefix , const FString & suffix , LogDebugLevel level , float persist_sec = 60 ) ; <nl> class UAirBlueprintLib : public UBlueprintFunctionLibrary <nl> } <nl> <nl> static void enableWorldRendering ( AActor * context , bool enable ) ; <nl> + static void enableViewportRendering ( AActor * context , bool enable ) ; <nl> <nl> private : <nl> template < typename T > <nl> class UAirBlueprintLib : public UBlueprintFunctionLibrary <nl> <nl> private : <nl> static bool log_messages_hidden ; <nl> + / / FViewPort doesn ' t expose this field so we are doing dirty work around by maintaining count by ourselves <nl> + static uint32_t FlushOnDrawCount ; <nl> static msr : : airlib : : AirSimSettings : : SegmentationSettings : : MeshNamingMethodType mesh_naming_method ; <nl> } ; <nl> <nl> mmm a / Unreal / Plugins / AirSim / Source / CameraDirector . cpp <nl> ppp b / Unreal / Plugins / AirSim / Source / CameraDirector . cpp <nl> <nl> # include " CameraDirector . h " <nl> # include " GameFramework / PlayerController . h " <nl> - # include " Runtime / Engine / Public / Slate / SceneViewport . h " <nl> # include " AirBlueprintLib . h " <nl> <nl> ACameraDirector : : ACameraDirector ( ) <nl> void ACameraDirector : : attachSpringArm ( bool attach ) <nl> <nl> void ACameraDirector : : setMode ( ECameraDirectorMode mode ) <nl> { <nl> - / / if prev mode was spring arm but new mode isn ' t then detach spring arm <nl> - if ( mode_ = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_SPRINGARM_CHASE & & <nl> - mode ! = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_SPRINGARM_CHASE ) <nl> - { <nl> - attachSpringArm ( false ) ; <nl> - } <nl> + { / / first remove any settings done by previous mode <nl> + <nl> + / / detach spring arm <nl> + if ( mode_ = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_SPRINGARM_CHASE & & <nl> + mode ! = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_SPRINGARM_CHASE ) <nl> + { <nl> + attachSpringArm ( false ) ; <nl> + } <nl> <nl> - / / Enable / disable primary viewport rendering flag <nl> - if ( mode_ ! = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY & & <nl> - mode = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY ) <nl> - { <nl> - / / This disables rendering of the main viewport in the same way as the <nl> - / / console command " show rendering " would do . <nl> - GetWorld ( ) - > GetGameViewport ( ) - > EngineShowFlags . SetRendering ( false ) ; <nl> - <nl> - / / When getting an image through the API , the image is produced after the render <nl> - / / thread has finished rendering the current and the subsequent frame . This means <nl> - / / that the frame rate for obtaining images through the API is only half as high as <nl> - / / it could be , since only every other image is actually captured . We work around <nl> - / / this by telling the viewport to flush the rendering queue at the end of each <nl> - / / drawn frame so that it executes our render request at that point already . <nl> - / / Do this only if the main viewport is not being rendered anyway in case there are <nl> - / / any adverse performance effects during main rendering . <nl> - GetWorld ( ) - > GetGameViewport ( ) - > GetGameViewport ( ) - > IncrementFlushOnDraw ( ) ; <nl> - } <nl> - else if ( mode_ = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY & & <nl> - mode ! = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY ) <nl> - { <nl> / / Re - enable rendering <nl> - GetWorld ( ) - > GetGameViewport ( ) - > EngineShowFlags . SetRendering ( true ) ; <nl> - GetWorld ( ) - > GetGameViewport ( ) - > GetGameViewport ( ) - > DecrementFlushOnDraw ( ) ; <nl> + if ( mode_ = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY & & <nl> + mode ! = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY ) <nl> + { <nl> + UAirBlueprintLib : : enableViewportRendering ( this , true ) ; <nl> + } <nl> + <nl> + / / Remove any existing key bindings for manual mode <nl> + if ( mode ! = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_MANUAL ) { <nl> + if ( external_camera_ ! = nullptr <nl> + & & manual_pose_controller_ - > getActor ( ) = = external_camera_ ) { <nl> + <nl> + manual_pose_controller_ - > enableBindings ( false ) ; <nl> + } <nl> + / / else someone else is bound to manual pose controller , leave it alone <nl> + } <nl> } <nl> + <nl> + { / / perform any settings to enter in to this mode <nl> + <nl> + switch ( mode ) { <nl> + case ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_MANUAL : <nl> + / / if new mode is manual mode then add key bindings <nl> + manual_pose_controller_ - > enableBindings ( true ) ; break ; <nl> + case ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_SPRINGARM_CHASE : <nl> + / / if we switched to spring arm mode then attach to spring arm ( detachment was done earlier in method ) <nl> + attachSpringArm ( true ) ; break ; <nl> + case ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_NODISPLAY : <nl> + UAirBlueprintLib : : enableViewportRendering ( this , false ) ; break ; <nl> + default : <nl> + / / other modes don ' t need special setup <nl> + break ; <nl> + } <nl> <nl> - mode_ = mode ; <nl> + } <nl> <nl> - / / if new mode is manual mode then add key bindings <nl> - if ( mode_ = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_MANUAL ) <nl> - manual_pose_controller_ - > enableBindings ( true ) ; <nl> - / / else remove any existing key bindings for manual mode <nl> - else if ( external_camera_ ! = nullptr & & manual_pose_controller_ - > getActor ( ) = = external_camera_ ) <nl> - manual_pose_controller_ - > enableBindings ( false ) ; <nl> - / / else someone else is bound to manual pose controller , leave it alone <nl> - <nl> - / / if we switched to spring arm mode then attach to spring arm ( detachment was done earlier in method ) <nl> - if ( mode_ = = ECameraDirectorMode : : CAMERA_DIRECTOR_MODE_SPRINGARM_CHASE ) <nl> - attachSpringArm ( true ) ; <nl> + / / make switch official <nl> + mode_ = mode ; <nl> } <nl> <nl> void ACameraDirector : : setupInputBindings ( ) <nl> mmm a / Unreal / Plugins / AirSim / Source / PIPCamera . cpp <nl> ppp b / Unreal / Plugins / AirSim / Source / PIPCamera . cpp <nl> void APIPCamera : : setImageTypeSettings ( int image_type , const APIPCamera : : CaptureS <nl> <nl> setNoiseMaterial ( image_type , camera_ , camera_ - > PostProcessSettings , noise_setting ) ; <nl> } <nl> - <nl> - <nl> - <nl> } <nl> <nl> void APIPCamera : : updateCaptureComponentSetting ( USceneCaptureComponent2D * capture , UTextureRenderTarget2D * render_target , <nl> mmm a / Unreal / Plugins / AirSim / Source / SimHUD / SimHUD . cpp <nl> ppp b / Unreal / Plugins / AirSim / Source / SimHUD / SimHUD . cpp <nl> void ASimHUD : : BeginPlay ( ) <nl> Super : : BeginPlay ( ) ; <nl> <nl> try { <nl> + UAirBlueprintLib : : OnBeginPlay ( ) ; <nl> initializeSettings ( ) ; <nl> setUnrealEngineSettings ( ) ; <nl> createSimMode ( ) ; <nl> void ASimHUD : : EndPlay ( const EEndPlayReason : : Type EndPlayReason ) <nl> simmode_ = nullptr ; <nl> } <nl> <nl> + UAirBlueprintLib : : OnEndPlay ( ) ; <nl> + <nl> Super : : EndPlay ( EndPlayReason ) ; <nl> } <nl> <nl>
|
Minor refactoring for PR https : / / github . com / Microsoft / AirSim / pull / 850
|
microsoft/AirSim
|
890ee12459492bc4bdea36241bcd4c2a653c5f61
|
2018-03-02T16:03:47Z
|
mmm a / test / rql_test / connections / connection . js <nl> ppp b / test / rql_test / connections / connection . js <nl> describe ( ' Javascript connection API ' , function ( ) { <nl> it ( " empty run " , function ( done ) { <nl> assert . throws ( function ( ) { r . expr ( 1 ) . run ( ) ; } , <nl> checkError ( " RqlDriverError " , <nl> - " First argument to ` run ` must be an open connection or { connection : < connection > , useOutdated : < bool > , noreply : < bool > , timeFormat : < string > } . " ) ) ; <nl> + " First argument to ` run ` must be an open connection or { connection : < connection > , useOutdated : < bool > , noreply : < bool > , timeFormat : < string > , profile : < bool > } . " ) ) ; <nl> done ( ) ; <nl> } ) ; <nl> } ) ; <nl> mmm a / test / rql_test / connections / connection . py <nl> ppp b / test / rql_test / connections / connection . py <nl> def runTest ( self ) : <nl> if cursor . end_flag : <nl> self . assertEqual ( len ( cursor . responses [ 0 ] . response ) , batch_size ) <nl> else : <nl> - assertLess ( len ( cursor . responses [ 0 ] . response ) , batch_size ) <nl> + self . assertLess ( len ( cursor . responses [ 0 ] . response ) , batch_size ) <nl> <nl> itr = iter ( cursor ) <nl> for i in xrange ( 0 , batch_size - 1 ) : <nl>
|
fixing broken client connection tests
|
rethinkdb/rethinkdb
|
bf81167dce07cacf2ceb8aaee5b00990ca61540c
|
2013-11-08T06:33:02Z
|
mmm a / Telegram / Resources / uwp / AppX / AppxManifest . xml <nl> ppp b / Telegram / Resources / uwp / AppX / AppxManifest . xml <nl> <nl> < Identity Name = " TelegramMessengerLLP . TelegramDesktop " <nl> ProcessorArchitecture = " ARCHITECTURE " <nl> Publisher = " CN = 536BC709 - 8EE1 - 4478 - AF22 - F0F0F26FF64A " <nl> - Version = " 1 . 4 . 3 . 0 " / > <nl> + Version = " 1 . 4 . 4 . 0 " / > <nl> < Properties > <nl> < DisplayName > Telegram Desktop < / DisplayName > <nl> < PublisherDisplayName > Telegram Messenger LLP < / PublisherDisplayName > <nl> mmm a / Telegram / Resources / winrc / Telegram . rc <nl> ppp b / Telegram / Resources / winrc / Telegram . rc <nl> IDI_ICON1 ICON " . . \ \ art \ \ icon256 . ico " <nl> / / <nl> <nl> VS_VERSION_INFO VERSIONINFO <nl> - FILEVERSION 1 , 4 , 3 , 0 <nl> - PRODUCTVERSION 1 , 4 , 3 , 0 <nl> + FILEVERSION 1 , 4 , 4 , 0 <nl> + PRODUCTVERSION 1 , 4 , 4 , 0 <nl> FILEFLAGSMASK 0x3fL <nl> # ifdef _DEBUG <nl> FILEFLAGS 0x1L <nl> BEGIN <nl> BEGIN <nl> VALUE " CompanyName " , " Telegram Messenger LLP " <nl> VALUE " FileDescription " , " Telegram Desktop " <nl> - VALUE " FileVersion " , " 1 . 4 . 3 . 0 " <nl> + VALUE " FileVersion " , " 1 . 4 . 4 . 0 " <nl> VALUE " LegalCopyright " , " Copyright ( C ) 2014 - 2018 " <nl> VALUE " ProductName " , " Telegram Desktop " <nl> - VALUE " ProductVersion " , " 1 . 4 . 3 . 0 " <nl> + VALUE " ProductVersion " , " 1 . 4 . 4 . 0 " <nl> END <nl> END <nl> BLOCK " VarFileInfo " <nl> mmm a / Telegram / Resources / winrc / Updater . rc <nl> ppp b / Telegram / Resources / winrc / Updater . rc <nl> LANGUAGE LANG_ENGLISH , SUBLANG_ENGLISH_US <nl> / / <nl> <nl> VS_VERSION_INFO VERSIONINFO <nl> - FILEVERSION 1 , 4 , 3 , 0 <nl> - PRODUCTVERSION 1 , 4 , 3 , 0 <nl> + FILEVERSION 1 , 4 , 4 , 0 <nl> + PRODUCTVERSION 1 , 4 , 4 , 0 <nl> FILEFLAGSMASK 0x3fL <nl> # ifdef _DEBUG <nl> FILEFLAGS 0x1L <nl> BEGIN <nl> BEGIN <nl> VALUE " CompanyName " , " Telegram Messenger LLP " <nl> VALUE " FileDescription " , " Telegram Desktop Updater " <nl> - VALUE " FileVersion " , " 1 . 4 . 3 . 0 " <nl> + VALUE " FileVersion " , " 1 . 4 . 4 . 0 " <nl> VALUE " LegalCopyright " , " Copyright ( C ) 2014 - 2018 " <nl> VALUE " ProductName " , " Telegram Desktop " <nl> - VALUE " ProductVersion " , " 1 . 4 . 3 . 0 " <nl> + VALUE " ProductVersion " , " 1 . 4 . 4 . 0 " <nl> END <nl> END <nl> BLOCK " VarFileInfo " <nl> mmm a / Telegram / SourceFiles / core / changelogs . cpp <nl> ppp b / Telegram / SourceFiles / core / changelogs . cpp <nl> std : : map < int , const char * > BetaLogs ( ) { <nl> return { <nl> { <nl> 1002024 , <nl> - " \ xE2 \ x80 \ x94 Add links with custom text from context menu " <nl> + " - Add links with custom text from context menu " <nl> " or by Ctrl / Cmd + K keyboard shortcut . " <nl> } , <nl> { <nl> 1002025 , <nl> - " \ xE2 \ x80 \ x94 Apply markdown formatting ( ` ` ` , ` , * * , __ ) " <nl> + " - Apply markdown formatting ( ` ` ` , ` , * * , __ ) " <nl> " only when sending the message . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 Display connection quality bars in calls . \ n " <nl> + " - Display connection quality bars in calls . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 Telegram Desktop can update itself through MTProto . \ n " <nl> + " - Telegram Desktop can update itself through MTProto . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 Bug fixes and other minor improvements . " <nl> + " - Bug fixes and other minor improvements . " <nl> } , <nl> { <nl> 1003011 , <nl> - " \ xE2 \ x80 \ x94 Added a new night theme . \ n " <nl> + " - Added a new night theme . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 You can now assign custom themes " <nl> + " - You can now assign custom themes " <nl> " as night and day themes to quickly switch between them . " <nl> } , <nl> { <nl> 1003015 , <nl> - " \ xE2 \ x80 \ x94 Improved local caching " <nl> + " - Improved local caching " <nl> " for images and GIF animations . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 Control how much disk space is used by the cache " <nl> + " - Control how much disk space is used by the cache " <nl> " and for how long the cached files are stored . " <nl> } , <nl> { <nl> 1003017 , <nl> - " \ xE2 \ x80 \ x94 Fully redisigned Settings section . \ n " <nl> + " - Fully redisigned Settings section . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 New theme selector in Chat Settings . \ n " <nl> - " \ xE2 \ x80 \ x94 New settings : Peer - to - Peer settings for calls , " <nl> + " - New theme selector in Chat Settings . \ n " <nl> + " - New settings : Peer - to - Peer settings for calls , " <nl> " disable animations for low performance computers . \ n " <nl> <nl> - " \ xE2 \ x80 \ x94 Various other improvements . " <nl> + " - Various other improvements . " <nl> + } , <nl> + { <nl> + 1004004 , <nl> + " - Interface scaling for large screens , up to 300 % " <nl> + " ( up to 150 % for macOS retina screens ) . \ n " <nl> + <nl> + " - Updated emoji . " <nl> } , <nl> } ; <nl> } <nl> mmm a / Telegram / SourceFiles / core / version . h <nl> ppp b / Telegram / SourceFiles / core / version . h <nl> For license and copyright information please follow this link : <nl> <nl> # define ALPHA_VERSION_MACRO ( 0ULL ) <nl> <nl> - constexpr int AppVersion = 1004003 ; <nl> - constexpr str_const AppVersionStr = " 1 . 4 . 3 " ; <nl> - constexpr bool AppBetaVersion = false ; <nl> + constexpr int AppVersion = 1004004 ; <nl> + constexpr str_const AppVersionStr = " 1 . 4 . 4 " ; <nl> + constexpr bool AppBetaVersion = true ; <nl> constexpr uint64 AppAlphaVersion = ALPHA_VERSION_MACRO ; <nl> mmm a / Telegram / build / version <nl> ppp b / Telegram / build / version <nl> <nl> - AppVersion 1004003 <nl> + AppVersion 1004004 <nl> AppVersionStrMajor 1 . 4 <nl> - AppVersionStrSmall 1 . 4 . 3 <nl> - AppVersionStr 1 . 4 . 3 <nl> - BetaChannel 0 <nl> + AppVersionStrSmall 1 . 4 . 4 <nl> + AppVersionStr 1 . 4 . 4 <nl> + BetaChannel 1 <nl> AlphaVersion 0 <nl> mmm a / changelog . txt <nl> ppp b / changelog . txt <nl> <nl> + 1 . 4 . 4 beta ( 16 . 10 . 18 ) <nl> + <nl> + - Interface scaling for large screens , up to 300 % ( up to 150 % for macOS retina screens ) . <nl> + - Updated emoji . <nl> + <nl> 1 . 4 . 3 ( 13 . 10 . 18 ) <nl> <nl> - Bug fixes and other minor improvements . <nl>
|
Beta version 1 . 4 . 4 .
|
telegramdesktop/tdesktop
|
500ecb464c0373cb7cbd70ce17f2b8702b2e609d
|
2018-10-16T20:23:29Z
|
mmm a / src / library_gl . js <nl> ppp b / src / library_gl . js <nl> var LibraryGL = { <nl> assert ( id < this . counter , " Invalid id " + id + " for the hashtable " + name ) ; <nl> # endif <nl> delete this . table [ id ] ; <nl> - } <nl> + } , <nl> + lookup : function ( v ) { <nl> + for ( var i = 1 ; i < this . counter ; i + + ) <nl> + if ( this . table [ i ] = = v ) <nl> + return i ; <nl> + return 0 ; <nl> + } , <nl> } ; <nl> } <nl> return this . _hashtables [ name ] ; <nl> var LibraryGL = { <nl> } <nl> } , <nl> <nl> + glGenIntegerv__deps : [ ' $ GL ' ] , <nl> glGetIntegerv : function ( name_ , p ) { <nl> var result = Module . ctx . getParameter ( name_ ) ; <nl> switch ( typeof ( result ) ) { <nl> var LibraryGL = { <nl> <nl> glDeleteTextures : function ( n , textures ) { <nl> for ( var i = 0 ; i < n ; i + + ) { <nl> - var id = { { { makeGetValue ( ' textures ' , ' i ' , ' i32 ' ) } } } ; <nl> + var id = { { { makeGetValue ( ' textures ' , ' i * 4 ' , ' i32 ' ) } } } ; <nl> Module . ctx . deleteTexture ( GL . hashtable ( " texture " ) . get ( id ) ) ; <nl> GL . hashtable ( " texture " ) . remove ( id ) ; <nl> } <nl> var LibraryGL = { <nl> <nl> glDeleteBuffers : function ( n , buffers ) { <nl> for ( var i = 0 ; i < n ; i + + ) { <nl> - var id = { { { makeGetValue ( ' buffers ' , ' i ' , ' i32 ' ) } } } ; <nl> + var id = { { { makeGetValue ( ' buffers ' , ' i * 4 ' , ' i32 ' ) } } } ; <nl> Module . ctx . deleteBuffer ( GL . hashtable ( " buffer " ) . get ( id ) ) ; <nl> GL . hashtable ( " buffer " ) . remove ( id ) ; <nl> } <nl> var LibraryGL = { <nl> return Module . ctx . isRenderbuffer ( fb ) ; <nl> } , <nl> <nl> - glBindAttribLocation_deps : [ ' $ GL ' ] , <nl> + glGetUniformLocation_deps : [ ' $ GL ' ] , <nl> glGetUniformLocation : function ( program , name ) { <nl> name = Pointer_stringify ( name ) ; <nl> return GL . hashtable ( " uniform " ) . add ( <nl> var LibraryGL = { <nl> return GL . hashtable ( " shader " ) . add ( shader ) ; <nl> } , <nl> <nl> + glDeleteShader_deps : [ ' $ GL ' ] , <nl> glDeleteShader : function ( shader ) { <nl> Module . ctx . deleteShader ( GL . hashtable ( " shader " ) . get ( shader ) ) ; <nl> } , <nl> var LibraryGL = { <nl> glShaderSource : function ( shader , count , string , length ) { <nl> var source = " " ; <nl> for ( var i = 0 ; i < count ; + + i ) { <nl> - var frag = string [ i ] ; <nl> + var frag ; <nl> if ( length ) { <nl> - var len = { { { makeGetValue ( ' length ' , ' i ' , ' i32 ' ) } } } ; <nl> + var len = { { { makeGetValue ( ' length ' , ' i * 4 ' , ' i32 ' ) } } } ; <nl> if ( len < 0 ) { <nl> - frag = Pointer_stringify ( { { { makeGetValue ( ' string ' , ' i ' , ' i32 ' ) } } } ) ; <nl> + frag = Pointer_stringify ( { { { makeGetValue ( ' string ' , ' i * 4 ' , ' i32 ' ) } } } ) ; <nl> } else { <nl> - frag = Pointer_stringify ( { { { makeGetValue ( ' string ' , ' i ' , ' i32 ' ) } } } , len ) ; <nl> + frag = Pointer_stringify ( { { { makeGetValue ( ' string ' , ' i * 4 ' , ' i32 ' ) } } } , len ) ; <nl> } <nl> } else { <nl> - frag = Pointer_stringify ( { { { makeGetValue ( ' string ' , ' i ' , ' i32 ' ) } } } ) ; <nl> - } <nl> - if ( source . length ) { <nl> - source + = " \ n " ; <nl> + frag = Pointer_stringify ( { { { makeGetValue ( ' string ' , ' i * 4 ' , ' i32 ' ) } } } ) ; <nl> } <nl> source + = frag ; <nl> } <nl> var LibraryGL = { <nl> return GL . hashtable ( " program " ) . add ( Module . ctx . createProgram ( ) ) ; <nl> } , <nl> <nl> + glDeleteProgram_deps : [ ' $ GL ' ] , <nl> glDeleteProgram : function ( program ) { <nl> Module . ctx . deleteProgram ( GL . hashtable ( " program " ) . get ( program ) ) ; <nl> } , <nl> var LibraryGL = { <nl> var LibraryGLUT = { <nl> $ GLUT : { <nl> initTime : null , <nl> - idleFunc : null , <nl> + displayFunc : null , <nl> keyboardFunc : null , <nl> keyboardUpFunc : null , <nl> specialFunc : null , <nl> specialUpFunc : null , <nl> reshapeFunc : null , <nl> + motionFunc : null , <nl> passiveMotionFunc : null , <nl> mouseFunc : null , <nl> lastX : 0 , <nl> lastY : 0 , <nl> + buttons : 0 , <nl> + modifiers : 0 , <nl> + <nl> + saveModifiers : function ( event ) { <nl> + GLUT . modifiers = 0 ; <nl> + if ( event [ ' shiftKey ' ] ) <nl> + GLUT . modifiers + = 1 ; / * GLUT_ACTIVE_SHIFT * / <nl> + if ( event [ ' ctrlKey ' ] ) <nl> + GLUT . modifiers + = 2 ; / * GLUT_ACTIVE_CTRL * / <nl> + if ( event [ ' altKey ' ] ) <nl> + GLUT . modifiers + = 4 ; / * GLUT_ACTIVE_ALT * / <nl> + } , <nl> <nl> onMousemove : function ( event ) { <nl> GLUT . lastX = event [ ' clientX ' ] ; <nl> GLUT . lastY = event [ ' clientY ' ] ; <nl> - if ( GLUT . passiveMotionFunc ) { <nl> + if ( GLUT . buttons = = 0 & & GLUT . passiveMotionFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> FUNCTION_TABLE [ GLUT . passiveMotionFunc ] ( GLUT . lastX , GLUT . lastY ) ; <nl> - } <nl> + } else if ( GLUT . buttons ! = 0 & & GLUT . motionFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> + FUNCTION_TABLE [ GLUT . motionFunc ] ( GLUT . lastX , GLUT . lastY ) ; <nl> + } <nl> } , <nl> <nl> getSpecialKey : function ( keycode ) { <nl> var LibraryGLUT = { <nl> return key ; <nl> } , <nl> <nl> + getASCIIKey : function ( keycode ) { <nl> + / / TODO apply modifiers , etc <nl> + return keycode ; <nl> + } , <nl> + <nl> onKeydown : function ( event ) { <nl> if ( GLUT . specialFunc | | GLUT . keyboardFunc ) { <nl> var key = GLUT . getSpecialKey ( event [ ' keyCode ' ] ) ; <nl> if ( key ! = = null ) { <nl> - if ( GLUT . specialFunc ) FUNCTION_TABLE [ GLUT . specialFunc ] ( key , GLUT . lastX , GLUT . lastY ) ; <nl> + if ( GLUT . specialFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> + FUNCTION_TABLE [ GLUT . specialFunc ] ( key , GLUT . lastX , GLUT . lastY ) ; <nl> + } <nl> } <nl> - else if ( GLUT . keyboardFunc ) { <nl> - FUNCTION_TABLE [ GLUT . keyboardFunc ] ( event [ ' keyCode ' ] , GLUT . lastX , GLUT . lastY ) ; <nl> + else <nl> + { <nl> + key = GLUT . getASCIIKey ( event [ ' keyCode ' ] ) ; <nl> + if ( key ! = = null & & GLUT . keyboardFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> + FUNCTION_TABLE [ GLUT . keyboardFunc ] ( event [ ' keyCode ' ] , GLUT . lastX , GLUT . lastY ) ; <nl> + } <nl> } <nl> } <nl> } , <nl> - <nl> + <nl> onKeyup : function ( event ) { <nl> if ( GLUT . specialUpFunc | | GLUT . keyboardUpFunc ) { <nl> var key = GLUT . getSpecialKey ( event [ ' keyCode ' ] ) ; <nl> if ( key ! = = null ) { <nl> - if ( GLUT . specialFunc ) FUNCTION_TABLE [ GLUT . specialUpFunc ] ( key , GLUT . lastX , GLUT . lastY ) ; <nl> + if ( GLUT . specialUpFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> + FUNCTION_TABLE [ GLUT . specialUpFunc ] ( key , GLUT . lastX , GLUT . lastY ) ; <nl> + } <nl> } <nl> - else if ( GLUT . keyboardUpFunc ) { <nl> - FUNCTION_TABLE [ GLUT . keyboardUpFunc ] ( event [ ' keyCode ' ] , GLUT . lastX , GLUT . lastY ) ; <nl> + else <nl> + { <nl> + key = GLUT . getASCIIKey ( event [ ' keyCode ' ] ) ; <nl> + if ( key ! = = null & & GLUT . keyboardUpFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> + FUNCTION_TABLE [ GLUT . keyboardUpFunc ] ( event [ ' keyCode ' ] , GLUT . lastX , GLUT . lastY ) ; <nl> + } <nl> } <nl> } <nl> } , <nl> - <nl> + <nl> onMouseButtonDown : function ( event ) { <nl> GLUT . lastX = event [ ' clientX ' ] ; <nl> GLUT . lastY = event [ ' clientY ' ] ; <nl> - <nl> + GLUT . buttons | = ( 1 < < event [ ' button ' ] ) ; <nl> + <nl> if ( GLUT . mouseFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> FUNCTION_TABLE [ GLUT . mouseFunc ] ( event [ ' button ' ] , 0 / * GLUT_DOWN * / , GLUT . lastX , GLUT . lastY ) ; <nl> } <nl> } , <nl> - <nl> + <nl> onMouseButtonUp : function ( event ) { <nl> GLUT . lastX = event [ ' clientX ' ] ; <nl> GLUT . lastY = event [ ' clientY ' ] ; <nl> + GLUT . buttons & = ~ ( 1 < < event [ ' button ' ] ) ; <nl> <nl> if ( GLUT . mouseFunc ) { <nl> + event . preventDefault ( ) ; <nl> + GLUT . saveModifiers ( event ) ; <nl> FUNCTION_TABLE [ GLUT . mouseFunc ] ( event [ ' button ' ] , 1 / * GLUT_UP * / , GLUT . lastX , GLUT . lastY ) ; <nl> } <nl> } , <nl> } , <nl> <nl> + glutGetModifiers : function ( ) { return GLUT . modifiers ; } , <nl> + <nl> glutInit__deps : [ ' $ GLUT ' ] , <nl> glutInit : function ( argcp , argv ) { <nl> / / Ignore arguments <nl> var LibraryGLUT = { <nl> } <nl> } , <nl> <nl> - glutDisplayFunc : function ( func ) { <nl> - var RAF = window [ ' setTimeout ' ] ; <nl> - if ( window [ ' requestAnimationFrame ' ] ) { <nl> - RAF = window [ ' requestAnimationFrame ' ] ; <nl> - } else if ( window [ ' mozRequestAnimationFrame ' ] ) { <nl> - RAF = window [ ' mozRequestAnimationFrame ' ] ; <nl> - } else if ( window [ ' webkitRequestAnimationFrame ' ] ) { <nl> - RAF = window [ ' webkitRequestAnimationFrame ' ] ; <nl> - } else if ( window [ ' msRequestAnimationFrame ' ] ) { <nl> - RAF = window [ ' msRequestAnimationFrame ' ] ; <nl> - } <nl> - RAF . apply ( window , [ function ( ) { <nl> - if ( GLUT . reshapeFunc ) { <nl> - FUNCTION_TABLE [ GLUT . reshapeFunc ] ( Module [ ' canvas ' ] . width , <nl> - Module [ ' canvas ' ] . height ) ; <nl> - } <nl> - if ( GLUT . idleFunc ) { <nl> - FUNCTION_TABLE [ GLUT . idleFunc ] ( ) ; <nl> - } <nl> - FUNCTION_TABLE [ func ] ( ) ; <nl> - _glutDisplayFunc ( func ) ; <nl> - } ] ) ; <nl> + glutIdleFunc : function ( func ) { <nl> + window . setTimeout ( FUNCTION_TABLE [ func ] , 0 ) ; <nl> } , <nl> <nl> - glutIdleFunc : function ( func ) { <nl> - GLUT . idleFunc = func ; <nl> + glutTimerFunc : function ( msec , func , value ) { <nl> + window . setTimeout ( function ( ) { FUNCTION_TABLE [ func ] ( value ) ; } , msec ) ; <nl> + } , <nl> + <nl> + glutDisplayFunc : function ( func ) { <nl> + GLUT . displayFunc = func ; <nl> } , <nl> <nl> glutKeyboardFunc : function ( func ) { <nl> var LibraryGLUT = { <nl> GLUT . reshapeFunc = func ; <nl> } , <nl> <nl> + glutMotionFunc : function ( func ) { <nl> + GLUT . motionFunc = func ; <nl> + } , <nl> + <nl> glutPassiveMotionFunc : function ( func ) { <nl> GLUT . passiveMotionFunc = func ; <nl> } , <nl> - <nl> + <nl> glutMouseFunc : function ( func ) { <nl> GLUT . mouseFunc = func ; <nl> } , <nl> var LibraryGLUT = { <nl> } , <nl> <nl> glutInitDisplayMode : function ( mode ) { } , <nl> - glutMainLoop : function ( ) { } , <nl> glutSwapBuffers : function ( ) { } , <nl> - glutPostRedisplay : function ( ) { } , <nl> + <nl> + glutPostRedisplay : function ( ) { <nl> + if ( GLUT . displayFunc ) { <nl> + var RAF = window [ ' setTimeout ' ] ; <nl> + if ( window [ ' requestAnimationFrame ' ] ) { <nl> + RAF = window [ ' requestAnimationFrame ' ] ; <nl> + } else if ( window [ ' mozRequestAnimationFrame ' ] ) { <nl> + RAF = window [ ' mozRequestAnimationFrame ' ] ; <nl> + } else if ( window [ ' webkitRequestAnimationFrame ' ] ) { <nl> + RAF = window [ ' webkitRequestAnimationFrame ' ] ; <nl> + } else if ( window [ ' msRequestAnimationFrame ' ] ) { <nl> + RAF = window [ ' msRequestAnimationFrame ' ] ; <nl> + } <nl> + RAF . apply ( window , [ FUNCTION_TABLE [ GLUT . displayFunc ] ] ) ; <nl> + } <nl> + } , <nl> + <nl> + glutMainLoop__deps : [ ' $ GLUT ' ] , <nl> + glutMainLoop : function ( ) { <nl> + if ( GLUT . reshapeFunc ) { <nl> + FUNCTION_TABLE [ GLUT . reshapeFunc ] ( Module [ ' canvas ' ] . width , <nl> + Module [ ' canvas ' ] . height ) ; <nl> + } <nl> + _glutPostRedisplay ( ) ; <nl> + throw " Entering GLUT mainloop " ; <nl> + } , <nl> + <nl> } ; <nl> <nl> var LibraryXlib = { <nl> mmm a / system / include / libc / sys / types . h <nl> ppp b / system / include / libc / sys / types . h <nl> typedef unsigned long vm_size_t ; <nl> # define __BIT_TYPES_DEFINED__ <nl> <nl> typedef signed char int8_t ; <nl> - typedef unsigned char u_int8_t ; <nl> typedef short int16_t ; <nl> - typedef unsigned short u_int16_t ; <nl> typedef int int32_t ; <nl> - typedef unsigned int u_int32_t ; <nl> typedef long long int64_t ; <nl> - typedef unsigned long long u_int64_t ; <nl> typedef int32_t register_t ; <nl> # endif / * __MS_types__ * / <nl> <nl>
|
Merge pull request from ehsan / behdad
|
emscripten-core/emscripten
|
87fc6b71372181f69718652dbc2a0a3cc3b3351c
|
2012-04-02T23:38:33Z
|
mmm a / docs / SIL . rst <nl> ppp b / docs / SIL . rst <nl> except : <nl> - the callee value must have a ` ` yield_once ` ` coroutine type , <nl> <nl> - control returns to this function not when the coroutine performs a <nl> - ` ` return ` ` , but when it performs a ` ` yield ` , and <nl> + ` ` return ` ` , but when it performs a ` ` yield ` ` , and <nl> <nl> - the instruction results are derived from the yields of the coroutine <nl> instead of its normal results . <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
f22a90c4bc97b577c6b1a5d3a25b28dff9686614
|
2017-11-13T16:49:19Z
|
mmm a / test / SILPasses / earlycodemotion . sil <nl> ppp b / test / SILPasses / earlycodemotion . sil <nl> bb0 ( % 0 : $ * T , % 1 : $ * T , % 2 : $ B ) : <nl> return % 4 : $ ( ) / / id : % 5 <nl> } <nl> <nl> + / / Make sure retain instruction is sunk across copy_addr inst , as copy_addr <nl> + / / dest is initialized . <nl> + / / <nl> + / / CHECK - LABEL : retain_not_blocked_by_copyaddr_notake_init <nl> + / / CHECK : bb0 <nl> + / / CHECK - NEXT : copy_addr <nl> + / / CHECK - NEXT : tuple <nl> + / / CHECK - NEXT : retain_value <nl> + sil hidden @ retain_not_blocked_by_copyaddr_notake_init : $ @ convention ( thin ) < T > ( @ out T , @ in T , B ) - > ( ) { <nl> + bb0 ( % 0 : $ * T , % 1 : $ * T , % 2 : $ B ) : <nl> + retain_value % 2 : $ B <nl> + copy_addr % 1 to [ initialization ] % 0 : $ * T / / id : % 3 <nl> + % 4 = tuple ( ) / / user : % 5 <nl> + return % 4 : $ ( ) / / id : % 5 <nl> + } <nl>
|
Add another test case for more conservative memory behavior for CopyAddrInst . rdar : / / 23081349
|
apple/swift
|
fa30486d88c7df81909ab3046c723241abff3e45
|
2015-10-14T21:58:38Z
|
mmm a / src / host / exe / sources <nl> ppp b / src / host / exe / sources <nl> UMTYPE = windows <nl> UMENTRY = wwinmain <nl> TARGET_DESTINATION = retail <nl> <nl> + # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + # Build System Settings <nl> + # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> + <nl> + CETCOMPAT = 1 <nl> + <nl> # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> # Sources , Headers , and Libraries <nl> # mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl>
|
Merged PR 4641914 : [ Git2Git ] Git Train : Merge of building / rs_onecore_dep_uxp / 200504 - 1008 into official / rs_onecore_dep_uxp Retrieved from https : / / microsoft . visualstudio . com os OS official / rs_onecore_dep_uxp bbdf04608ba96c3f8ee06cf100428cde01f3df79
|
microsoft/terminal
|
8e67bb2d4f131a4c3964fdb03acc5feadc977f5b
|
2020-05-05T22:47:08Z
|
mmm a / build - aux / m4 / bitcoin_qt . m4 <nl> ppp b / build - aux / m4 / bitcoin_qt . m4 <nl> AC_DEFUN ( [ BITCOIN_QT_CONFIGURE ] , [ <nl> ] , [ <nl> bitcoin_enable_qt = no <nl> ] ) <nl> - AC_MSG_RESULT ( [ $ bitcoin_enable_qt ( Qt5 ) ] ) <nl> + if test x $ bitcoin_enable_qt = xyes ; then <nl> + AC_MSG_RESULT ( [ $ bitcoin_enable_qt ( $ QT_LIB_PREFIX ) ] ) <nl> + else <nl> + AC_MSG_RESULT ( [ $ bitcoin_enable_qt ] ) <nl> + fi <nl> <nl> AC_SUBST ( QT_PIE_FLAGS ) <nl> AC_SUBST ( QT_INCLUDES ) <nl>
|
Merge : build : Qt version appears only if GUI is being built
|
bitcoin/bitcoin
|
52acd245734a2b85e9eff578f4b2c5bba1e23c30
|
2019-10-01T10:11:47Z
|
old mode 100755 <nl> new mode 100644 <nl> mmm a / trunk / src / app / srs_app_http . cpp <nl> ppp b / trunk / src / app / srs_app_http . cpp <nl> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . <nl> <nl> # include < stdlib . h > <nl> <nl> + using namespace std ; <nl> + <nl> # include < srs_kernel_error . hpp > <nl> # include < srs_kernel_log . hpp > <nl> # include < srs_app_socket . hpp > <nl> <nl> # define SRS_DEFAULT_HTTP_PORT 80 <nl> <nl> + # define SRS_HTTP_HEADER_BUFFER 1024 <nl> + <nl> SrsHttpMessage : : SrsHttpMessage ( ) <nl> { <nl> - body = new SrsBuffer ( ) ; <nl> - state = SrsHttpParseStateInit ; <nl> + _body = new SrsBuffer ( ) ; <nl> + _state = SrsHttpParseStateInit ; <nl> } <nl> <nl> SrsHttpMessage : : ~ SrsHttpMessage ( ) <nl> { <nl> - srs_freep ( body ) ; <nl> + srs_freep ( _body ) ; <nl> } <nl> <nl> void SrsHttpMessage : : reset ( ) <nl> { <nl> - state = SrsHttpParseStateInit ; <nl> - body - > clear ( ) ; <nl> - url = " " ; <nl> + _state = SrsHttpParseStateInit ; <nl> + _body - > clear ( ) ; <nl> + _url = " " ; <nl> } <nl> <nl> bool SrsHttpMessage : : is_complete ( ) <nl> { <nl> - return state = = SrsHttpParseStateComplete ; <nl> + return _state = = SrsHttpParseStateComplete ; <nl> + } <nl> + <nl> + u_int8_t SrsHttpMessage : : method ( ) <nl> + { <nl> + return ( u_int8_t ) _header . method ; <nl> + } <nl> + <nl> + string SrsHttpMessage : : url ( ) <nl> + { <nl> + return _url ; <nl> + } <nl> + <nl> + string SrsHttpMessage : : body ( ) <nl> + { <nl> + std : : string b ; <nl> + <nl> + if ( _body & & ! _body - > empty ( ) ) { <nl> + b . append ( _body - > bytes ( ) , _body - > size ( ) ) ; <nl> + } <nl> + <nl> + return b ; <nl> + } <nl> + <nl> + int64_t SrsHttpMessage : : body_size ( ) <nl> + { <nl> + return ( int64_t ) _body - > size ( ) ; <nl> + } <nl> + <nl> + int64_t SrsHttpMessage : : content_length ( ) <nl> + { <nl> + return _header . content_length ; <nl> + } <nl> + <nl> + void SrsHttpMessage : : set_url ( std : : string url ) <nl> + { <nl> + _url = url ; <nl> + } <nl> + <nl> + void SrsHttpMessage : : set_state ( SrsHttpParseState state ) <nl> + { <nl> + _state = state ; <nl> + } <nl> + <nl> + void SrsHttpMessage : : set_header ( http_parser * header ) <nl> + { <nl> + memcpy ( & _header , header , sizeof ( http_parser ) ) ; <nl> + } <nl> + <nl> + void SrsHttpMessage : : append_body ( const char * body , int length ) <nl> + { <nl> + _body - > append ( body , length ) ; <nl> } <nl> <nl> SrsHttpParser : : SrsHttpParser ( ) <nl> { <nl> + msg = NULL ; <nl> } <nl> <nl> SrsHttpParser : : ~ SrsHttpParser ( ) <nl> { <nl> + srs_freep ( msg ) ; <nl> + } <nl> + <nl> + int SrsHttpParser : : initialize ( enum http_parser_type type ) <nl> + { <nl> + int ret = ERROR_SUCCESS ; <nl> + <nl> + memset ( & settings , 0 , sizeof ( settings ) ) ; <nl> + settings . on_message_begin = on_message_begin ; <nl> + settings . on_url = on_url ; <nl> + settings . on_header_field = on_header_field ; <nl> + settings . on_header_value = on_header_value ; <nl> + settings . on_headers_complete = on_headers_complete ; <nl> + settings . on_body = on_body ; <nl> + settings . on_message_complete = on_message_complete ; <nl> + <nl> + http_parser_init ( & parser , type ) ; <nl> + / / callback object ptr . <nl> + parser . data = ( void * ) this ; <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + int SrsHttpParser : : parse_message ( SrsSocket * skt , SrsHttpMessage * * ppmsg ) <nl> + { <nl> + * ppmsg = NULL ; <nl> + <nl> + int ret = ERROR_SUCCESS ; <nl> + <nl> + / / the msg must be always NULL <nl> + srs_assert ( msg = = NULL ) ; <nl> + msg = new SrsHttpMessage ( ) ; <nl> + <nl> + / / reset response header . <nl> + msg - > reset ( ) ; <nl> + <nl> + / / do parse <nl> + if ( ( ret = parse_message_imp ( skt ) ) ! = ERROR_SUCCESS ) { <nl> + if ( ! srs_is_client_gracefully_close ( ret ) ) { <nl> + srs_error ( " parse http msg failed . ret = % d " , ret ) ; <nl> + } <nl> + srs_freep ( msg ) ; <nl> + return ret ; <nl> + } <nl> + <nl> + / / parse ok , return the msg . <nl> + * ppmsg = msg ; <nl> + msg = NULL ; <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + int SrsHttpParser : : parse_message_imp ( SrsSocket * skt ) <nl> + { <nl> + int ret = ERROR_SUCCESS ; <nl> + <nl> + / / the msg should never be NULL <nl> + srs_assert ( msg ! = NULL ) ; <nl> + <nl> + / / parser header . <nl> + char buf [ SRS_HTTP_HEADER_BUFFER ] ; <nl> + for ( ; ; ) { <nl> + ssize_t nread ; <nl> + if ( ( ret = skt - > read ( buf , ( size_t ) sizeof ( buf ) , & nread ) ) ! = ERROR_SUCCESS ) { <nl> + if ( ! srs_is_client_gracefully_close ( ret ) ) { <nl> + srs_error ( " read body from server failed . ret = % d " , ret ) ; <nl> + } <nl> + return ret ; <nl> + } <nl> + <nl> + ssize_t nparsed = http_parser_execute ( & parser , & settings , buf , nread ) ; <nl> + srs_info ( " read_size = % d , nparsed = % d " , ( int ) nread , ( int ) nparsed ) ; <nl> + <nl> + / / check header size . <nl> + if ( msg - > is_complete ( ) ) { <nl> + srs_trace ( " http request parsed , method = % d , url = % s , content - length = % " PRId64 " " , <nl> + msg - > method ( ) , msg - > url ( ) . c_str ( ) , msg - > content_length ( ) ) ; <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + if ( nparsed ! = nread ) { <nl> + ret = ERROR_HTTP_PARSE_HEADER ; <nl> + srs_error ( " parse response error , parsed ( % d ) ! = read ( % d ) , ret = % d " , ( int ) nparsed , ( int ) nread , ret ) ; <nl> + return ret ; <nl> + } <nl> + } <nl> + <nl> + return ret ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_message_begin ( http_parser * parser ) <nl> + { <nl> + SrsHttpParser * obj = ( SrsHttpParser * ) parser - > data ; <nl> + obj - > msg - > set_state ( SrsHttpParseStateStart ) ; <nl> + <nl> + srs_info ( " * * * MESSAGE BEGIN * * * " ) ; <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_headers_complete ( http_parser * parser ) <nl> + { <nl> + SrsHttpParser * obj = ( SrsHttpParser * ) parser - > data ; <nl> + obj - > msg - > set_header ( parser ) ; <nl> + <nl> + srs_info ( " * * * HEADERS COMPLETE * * * " ) ; <nl> + <nl> + / / see http_parser . c : 1570 , return 1 to skip body . <nl> + return 0 ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_message_complete ( http_parser * parser ) <nl> + { <nl> + SrsHttpParser * obj = ( SrsHttpParser * ) parser - > data ; <nl> + / / save the parser when header parse completed . <nl> + obj - > msg - > set_state ( SrsHttpParseStateComplete ) ; <nl> + <nl> + srs_info ( " * * * MESSAGE COMPLETE * * * \ n " ) ; <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_url ( http_parser * parser , const char * at , size_t length ) <nl> + { <nl> + SrsHttpParser * obj = ( SrsHttpParser * ) parser - > data ; <nl> + <nl> + if ( length > 0 ) { <nl> + std : : string url ; <nl> + <nl> + url . append ( at , ( int ) length ) ; <nl> + <nl> + obj - > msg - > set_url ( url ) ; <nl> + } <nl> + <nl> + srs_info ( " Method : % d , Url : % . * s " , parser - > method , ( int ) length , at ) ; <nl> + <nl> + return 0 ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_header_field ( http_parser * / * parser * / , const char * at , size_t length ) <nl> + { <nl> + srs_info ( " Header field : % . * s " , ( int ) length , at ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_header_value ( http_parser * / * parser * / , const char * at , size_t length ) <nl> + { <nl> + srs_info ( " Header value : % . * s " , ( int ) length , at ) ; <nl> + return 0 ; <nl> + } <nl> + <nl> + int SrsHttpParser : : on_body ( http_parser * parser , const char * at , size_t length ) <nl> + { <nl> + SrsHttpParser * obj = ( SrsHttpParser * ) parser - > data ; <nl> + <nl> + if ( length > 0 ) { <nl> + srs_assert ( obj ) ; <nl> + srs_assert ( obj - > msg ) ; <nl> + <nl> + obj - > msg - > append_body ( at , ( int ) length ) ; <nl> + } <nl> + <nl> + srs_info ( " Body : % . * s " , ( int ) length , at ) ; <nl> + <nl> + return 0 ; <nl> } <nl> <nl> SrsHttpUri : : SrsHttpUri ( ) <nl> mmm a / trunk / src / app / srs_app_http . hpp <nl> ppp b / trunk / src / app / srs_app_http . hpp <nl> enum SrsHttpParseState { <nl> * / <nl> class SrsHttpMessage <nl> { <nl> - public : <nl> - std : : string url ; <nl> - http_parser header ; <nl> - SrsBuffer * body ; <nl> - SrsHttpParseState state ; <nl> + private : <nl> + / * * <nl> + * parsed url . <nl> + * / <nl> + std : : string _url ; <nl> + / * * <nl> + * parsed http header . <nl> + * / <nl> + http_parser _header ; <nl> + / * * <nl> + * body object , in bytes . <nl> + * @ remark , user can get body in string by get_body ( ) . <nl> + * / <nl> + SrsBuffer * _body ; <nl> + / * * <nl> + * parser state <nl> + * @ remark , user can use is_complete ( ) to determine the state . <nl> + * / <nl> + SrsHttpParseState _state ; <nl> <nl> + public : <nl> SrsHttpMessage ( ) ; <nl> virtual ~ SrsHttpMessage ( ) ; <nl> <nl> + public : <nl> virtual void reset ( ) ; <nl> + public : <nl> virtual bool is_complete ( ) ; <nl> + virtual u_int8_t method ( ) ; <nl> + virtual std : : string url ( ) ; <nl> + virtual std : : string body ( ) ; <nl> + virtual int64_t body_size ( ) ; <nl> + virtual int64_t content_length ( ) ; <nl> + virtual void set_url ( std : : string url ) ; <nl> + virtual void set_state ( SrsHttpParseState state ) ; <nl> + virtual void set_header ( http_parser * header ) ; <nl> + virtual void append_body ( const char * body , int length ) ; <nl> } ; <nl> <nl> / * * <nl> class SrsHttpMessage <nl> * / <nl> class SrsHttpParser <nl> { <nl> + private : <nl> + http_parser_settings settings ; <nl> + http_parser parser ; <nl> + SrsHttpMessage * msg ; <nl> public : <nl> SrsHttpParser ( ) ; <nl> virtual ~ SrsHttpParser ( ) ; <nl> public : <nl> - / / virtual int parse_requst ( SrsHttpMessage * * ppreq ) ; <nl> + / * * <nl> + * initialize the http parser with specified type , <nl> + * one parser can only parse request or response messages . <nl> + * / <nl> + virtual int initialize ( enum http_parser_type type ) ; <nl> + / * * <nl> + * always parse a http message , <nl> + * that is , the * ppmsg always NOT - NULL when return success . <nl> + * or error and * ppmsg must be NULL . <nl> + * @ remark , if success , * ppmsg always NOT - NULL , * ppmsg always is_complete ( ) . <nl> + * / <nl> + virtual int parse_message ( SrsSocket * skt , SrsHttpMessage * * ppmsg ) ; <nl> + private : <nl> + / * * <nl> + * parse the HTTP message to member field : msg . <nl> + * / <nl> + virtual int parse_message_imp ( SrsSocket * skt ) ; <nl> + private : <nl> + static int on_message_begin ( http_parser * parser ) ; <nl> + static int on_headers_complete ( http_parser * parser ) ; <nl> + static int on_message_complete ( http_parser * parser ) ; <nl> + static int on_url ( http_parser * parser , const char * at , size_t length ) ; <nl> + static int on_header_field ( http_parser * parser , const char * at , size_t length ) ; <nl> + static int on_header_value ( http_parser * parser , const char * at , size_t length ) ; <nl> + static int on_body ( http_parser * parser , const char * at , size_t length ) ; <nl> } ; <nl> <nl> / * * <nl> mmm a / trunk / src / app / srs_app_http_conn . cpp <nl> ppp b / trunk / src / app / srs_app_http_conn . cpp <nl> using namespace std ; <nl> # include < srs_app_socket . hpp > <nl> # include < srs_app_http . hpp > <nl> # include < srs_kernel_buffer . hpp > <nl> + # include < srs_core_autofree . hpp > <nl> <nl> # define SRS_HTTP_HEADER_BUFFER 1024 <nl> <nl> SrsHttpConn : : SrsHttpConn ( SrsServer * srs_server , st_netfd_t client_stfd ) <nl> : SrsConnection ( srs_server , client_stfd ) <nl> { <nl> - req = new SrsHttpMessage ( ) ; <nl> + parser = new SrsHttpParser ( ) ; <nl> } <nl> <nl> SrsHttpConn : : ~ SrsHttpConn ( ) <nl> { <nl> - srs_freep ( req ) ; <nl> + srs_freep ( parser ) ; <nl> } <nl> <nl> int SrsHttpConn : : do_cycle ( ) <nl> int SrsHttpConn : : do_cycle ( ) <nl> return ret ; <nl> } <nl> srs_trace ( " http get peer ip success . ip = % s " , ip ) ; <nl> - <nl> - / / setup http parser <nl> - http_parser_settings settings ; <nl> - <nl> - memset ( & settings , 0 , sizeof ( settings ) ) ; <nl> - settings . on_message_begin = on_message_begin ; <nl> - settings . on_url = on_url ; <nl> - settings . on_header_field = on_header_field ; <nl> - settings . on_header_value = on_header_value ; <nl> - settings . on_headers_complete = on_headers_complete ; <nl> - settings . on_body = on_body ; <nl> - settings . on_message_complete = on_message_complete ; <nl> <nl> - http_parser parser ; <nl> - http_parser_init ( & parser , HTTP_REQUEST ) ; <nl> - / / callback object ptr . <nl> - parser . data = ( void * ) this ; <nl> + / / initialize parser <nl> + if ( ( ret = parser - > initialize ( HTTP_REQUEST ) ) ! = ERROR_SUCCESS ) { <nl> + srs_error ( " initialize http parser failed . ret = % d " , ret ) ; <nl> + return ret ; <nl> + } <nl> <nl> / / underlayer socket <nl> SrsSocket skt ( stfd ) ; <nl> <nl> + / / process http messages . <nl> for ( ; ; ) { <nl> - if ( ( ret = parse_request ( & skt , & parser , & settings ) ) ! = ERROR_SUCCESS ) { <nl> - if ( ! srs_is_client_gracefully_close ( ret ) ) { <nl> - srs_error ( " http client cycle failed . ret = % d " , ret ) ; <nl> - } <nl> - return ret ; <nl> - } <nl> - } <nl> + SrsHttpMessage * req = NULL ; <nl> <nl> - return ret ; <nl> - } <nl> - <nl> - int SrsHttpConn : : parse_request ( SrsSocket * skt , http_parser * parser , http_parser_settings * settings ) <nl> - { <nl> - int ret = ERROR_SUCCESS ; <nl> - <nl> - / / reset response header . <nl> - req - > reset ( ) ; <nl> - <nl> - / / parser header . <nl> - char buf [ SRS_HTTP_HEADER_BUFFER ] ; <nl> - for ( ; ; ) { <nl> - ssize_t nread ; <nl> - if ( ( ret = skt - > read ( buf , ( size_t ) sizeof ( buf ) , & nread ) ) ! = ERROR_SUCCESS ) { <nl> - if ( ! srs_is_client_gracefully_close ( ret ) ) { <nl> - srs_error ( " read body from server failed . ret = % d " , ret ) ; <nl> - } <nl> + / / get a http message <nl> + if ( ( ret = parser - > parse_message ( & skt , & req ) ) ! = ERROR_SUCCESS ) { <nl> return ret ; <nl> } <nl> - <nl> - ssize_t nparsed = http_parser_execute ( parser , settings , buf , nread ) ; <nl> - srs_info ( " read_size = % d , nparsed = % d " , ( int ) nread , ( int ) nparsed ) ; <nl> <nl> - / / check header size . <nl> - if ( req - > is_complete ( ) ) { <nl> - srs_trace ( " http request parsed , method = % d , url = % s , content - length = % " PRId64 " " , <nl> - req - > header . method , req - > url . c_str ( ) , req - > header . content_length ) ; <nl> - <nl> - return process_request ( skt ) ; <nl> - } <nl> + / / if SUCCESS , always NOT - NULL and completed message . <nl> + srs_assert ( req ) ; <nl> + srs_assert ( req - > is_complete ( ) ) ; <nl> + <nl> + / / always free it in this scope . <nl> + SrsAutoFree ( SrsHttpMessage , req , false ) ; <nl> <nl> - if ( nparsed ! = nread ) { <nl> - ret = ERROR_HTTP_PARSE_HEADER ; <nl> - srs_error ( " parse response error , parsed ( % d ) ! = read ( % d ) , ret = % d " , ( int ) nparsed , ( int ) nread , ret ) ; <nl> + / / ok , handle http request . <nl> + if ( ( ret = process_request ( & skt , req ) ) ! = ERROR_SUCCESS ) { <nl> return ret ; <nl> } <nl> } <nl> - <nl> + <nl> return ret ; <nl> } <nl> <nl> - int SrsHttpConn : : process_request ( SrsSocket * skt ) <nl> + int SrsHttpConn : : process_request ( SrsSocket * skt , SrsHttpMessage * req ) <nl> { <nl> int ret = ERROR_SUCCESS ; <nl> <nl> - if ( req - > header . method = = HTTP_OPTIONS ) { <nl> + if ( req - > method ( ) = = HTTP_OPTIONS ) { <nl> char data [ ] = " HTTP / 1 . 1 200 OK " __CRLF <nl> " Content - Length : 0 " __CRLF <nl> " Server : SRS / " RTMP_SIG_SRS_VERSION " " __CRLF <nl> int SrsHttpConn : : process_request ( SrsSocket * skt ) <nl> <nl> std : : stringstream ss ; <nl> ss < < " HTTP / 1 . 1 200 OK " < < __CRLF <nl> - < < " Content - Length : " < < tilte . length ( ) + req - > body - > size ( ) < < __CRLF <nl> + < < " Content - Length : " < < tilte . length ( ) + req - > body_size ( ) < < __CRLF <nl> < < " Server : SRS / " RTMP_SIG_SRS_VERSION " " < < __CRLF <nl> < < " Allow : DELETE , GET , HEAD , OPTIONS , POST , PUT " < < __CRLF <nl> < < " Access - Control - Allow - Origin : * " < < __CRLF <nl> < < " Access - Control - Allow - Methods : GET , POST , HEAD , PUT , DELETE " < < __CRLF <nl> < < " Access - Control - Allow - Headers : Cache - Control , X - Proxy - Authorization , X - Requested - With , Content - Type " < < __CRLF <nl> < < " Content - Type : text / html ; charset = utf - 8 " < < __CRLFCRLF <nl> - < < tilte < < ( req - > body - > empty ( ) ? " " : req - > body - > bytes ( ) ) <nl> + < < tilte < < req - > body ( ) . c_str ( ) <nl> < < " " ; <nl> return skt - > write ( ss . str ( ) . c_str ( ) , ss . str ( ) . length ( ) , NULL ) ; <nl> } <nl> int SrsHttpConn : : process_request ( SrsSocket * skt ) <nl> return ret ; <nl> } <nl> <nl> - int SrsHttpConn : : on_message_begin ( http_parser * parser ) <nl> - { <nl> - SrsHttpConn * obj = ( SrsHttpConn * ) parser - > data ; <nl> - obj - > req - > state = SrsHttpParseStateStart ; <nl> - <nl> - srs_info ( " * * * MESSAGE BEGIN * * * " ) ; <nl> - <nl> - return 0 ; <nl> - } <nl> - <nl> - int SrsHttpConn : : on_headers_complete ( http_parser * parser ) <nl> - { <nl> - SrsHttpConn * obj = ( SrsHttpConn * ) parser - > data ; <nl> - memcpy ( & obj - > req - > header , parser , sizeof ( http_parser ) ) ; <nl> - <nl> - srs_info ( " * * * HEADERS COMPLETE * * * " ) ; <nl> - <nl> - / / see http_parser . c : 1570 , return 1 to skip body . <nl> - return 0 ; <nl> - } <nl> - <nl> - int SrsHttpConn : : on_message_complete ( http_parser * parser ) <nl> - { <nl> - SrsHttpConn * obj = ( SrsHttpConn * ) parser - > data ; <nl> - / / save the parser when header parse completed . <nl> - obj - > req - > state = SrsHttpParseStateComplete ; <nl> - <nl> - srs_info ( " * * * MESSAGE COMPLETE * * * \ n " ) ; <nl> - <nl> - return 0 ; <nl> - } <nl> - <nl> - int SrsHttpConn : : on_url ( http_parser * parser , const char * at , size_t length ) <nl> - { <nl> - SrsHttpConn * obj = ( SrsHttpConn * ) parser - > data ; <nl> - <nl> - if ( length > 0 ) { <nl> - obj - > req - > url . append ( at , ( int ) length ) ; <nl> - } <nl> - <nl> - srs_info ( " Method : % d , Url : % . * s " , parser - > method , ( int ) length , at ) ; <nl> - <nl> - return 0 ; <nl> - } <nl> - <nl> - int SrsHttpConn : : on_header_field ( http_parser * / * parser * / , const char * at , size_t length ) <nl> - { <nl> - srs_info ( " Header field : % . * s " , ( int ) length , at ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - int SrsHttpConn : : on_header_value ( http_parser * / * parser * / , const char * at , size_t length ) <nl> - { <nl> - srs_info ( " Header value : % . * s " , ( int ) length , at ) ; <nl> - return 0 ; <nl> - } <nl> - <nl> - int SrsHttpConn : : on_body ( http_parser * parser , const char * at , size_t length ) <nl> - { <nl> - SrsHttpConn * obj = ( SrsHttpConn * ) parser - > data ; <nl> - <nl> - if ( length > 0 ) { <nl> - obj - > req - > body - > append ( at , ( int ) length ) ; <nl> - } <nl> - <nl> - srs_info ( " Body : % . * s " , ( int ) length , at ) ; <nl> - <nl> - return 0 ; <nl> - } <nl> - <nl> # endif <nl> mmm a / trunk / src / app / srs_app_http_conn . hpp <nl> ppp b / trunk / src / app / srs_app_http_conn . hpp <nl> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . <nl> # include < http_parser . h > <nl> <nl> class SrsSocket ; <nl> + class SrsHttpParser ; <nl> class SrsHttpMessage ; <nl> <nl> class SrsHttpConn : public SrsConnection <nl> { <nl> private : <nl> - SrsHttpMessage * req ; <nl> + SrsHttpParser * parser ; <nl> public : <nl> SrsHttpConn ( SrsServer * srs_server , st_netfd_t client_stfd ) ; <nl> virtual ~ SrsHttpConn ( ) ; <nl> protected : <nl> virtual int do_cycle ( ) ; <nl> private : <nl> - virtual int parse_request ( SrsSocket * skt , http_parser * parser , http_parser_settings * settings ) ; <nl> - virtual int process_request ( SrsSocket * skt ) ; <nl> - private : <nl> - static int on_message_begin ( http_parser * parser ) ; <nl> - static int on_headers_complete ( http_parser * parser ) ; <nl> - static int on_message_complete ( http_parser * parser ) ; <nl> - static int on_url ( http_parser * parser , const char * at , size_t length ) ; <nl> - static int on_header_field ( http_parser * parser , const char * at , size_t length ) ; <nl> - static int on_header_value ( http_parser * parser , const char * at , size_t length ) ; <nl> - static int on_body ( http_parser * parser , const char * at , size_t length ) ; <nl> + virtual int process_request ( SrsSocket * skt , SrsHttpMessage * req ) ; <nl> } ; <nl> <nl> # endif <nl> mmm a / trunk / src / app / srs_app_http_hooks . cpp <nl> ppp b / trunk / src / app / srs_app_http_hooks . cpp <nl> SrsHttpClient : : SrsHttpClient ( ) <nl> { <nl> connected = false ; <nl> stfd = NULL ; <nl> + parser = NULL ; <nl> } <nl> <nl> SrsHttpClient : : ~ SrsHttpClient ( ) <nl> { <nl> disconnect ( ) ; <nl> + srs_freep ( parser ) ; <nl> } <nl> <nl> int SrsHttpClient : : post ( SrsHttpUri * uri , std : : string req , std : : string & res ) <nl> { <nl> + res = " " ; <nl> + <nl> int ret = ERROR_SUCCESS ; <nl> <nl> + if ( ! parser ) { <nl> + parser = new SrsHttpParser ( ) ; <nl> + <nl> + if ( ( ret = parser - > initialize ( HTTP_RESPONSE ) ) ! = ERROR_SUCCESS ) { <nl> + srs_error ( " initialize parser failed . ret = % d " , ret ) ; <nl> + return ret ; <nl> + } <nl> + } <nl> + <nl> if ( ( ret = connect ( uri ) ) ! = ERROR_SUCCESS ) { <nl> srs_error ( " http connect server failed . ret = % d " , ret ) ; <nl> return ret ; <nl> int SrsHttpClient : : post ( SrsHttpUri * uri , std : : string req , std : : string & res ) <nl> SrsSocket skt ( stfd ) ; <nl> <nl> std : : string data = ss . str ( ) ; <nl> - ssize_t nwrite ; <nl> - if ( ( ret = skt . write ( data . c_str ( ) , data . length ( ) , & nwrite ) ) ! = ERROR_SUCCESS ) { <nl> + if ( ( ret = skt . write ( data . c_str ( ) , data . length ( ) , NULL ) ) ! = ERROR_SUCCESS ) { <nl> / / disconnect when error . <nl> disconnect ( ) ; <nl> <nl> int SrsHttpClient : : post ( SrsHttpUri * uri , std : : string req , std : : string & res ) <nl> return ret ; <nl> } <nl> <nl> - if ( ( ret = parse_response ( uri , & skt , & res ) ) ! = ERROR_SUCCESS ) { <nl> + SrsHttpMessage * msg = NULL ; <nl> + if ( ( ret = parser - > parse_message ( & skt , & msg ) ) ! = ERROR_SUCCESS ) { <nl> srs_error ( " parse http post response failed . ret = % d " , ret ) ; <nl> return ret ; <nl> } <nl> + <nl> + srs_assert ( msg ) ; <nl> + srs_assert ( msg - > is_complete ( ) ) ; <nl> + <nl> + / / get response body . <nl> + if ( msg - > body_size ( ) > 0 ) { <nl> + res = msg - > body ( ) ; <nl> + } <nl> srs_info ( " parse http post response success . " ) ; <nl> <nl> return ret ; <nl> int SrsHttpClient : : connect ( SrsHttpUri * uri ) <nl> return ret ; <nl> } <nl> <nl> - int SrsHttpClient : : parse_response ( SrsHttpUri * uri , SrsSocket * skt , std : : string * response ) <nl> - { <nl> - int ret = ERROR_SUCCESS ; <nl> - <nl> - int body_received = 0 ; <nl> - if ( ( ret = parse_response_header ( skt , response , body_received ) ) ! = ERROR_SUCCESS ) { <nl> - srs_error ( " parse response header failed . ret = % d " , ret ) ; <nl> - return ret ; <nl> - } <nl> - <nl> - if ( ( ret = parse_response_body ( uri , skt , response , body_received ) ) ! = ERROR_SUCCESS ) { <nl> - srs_error ( " parse response body failed . ret = % d " , ret ) ; <nl> - return ret ; <nl> - } <nl> - <nl> - srs_info ( " url % s download , body size = % " PRId64 , uri - > get_url ( ) , http_header . content_length ) ; <nl> - <nl> - return ret ; <nl> - } <nl> - <nl> - int SrsHttpClient : : parse_response_header ( SrsSocket * skt , std : : string * response , int & body_received ) <nl> - { <nl> - int ret = ERROR_SUCCESS ; <nl> - <nl> - http_parser_settings settings ; <nl> - <nl> - memset ( & settings , 0 , sizeof ( settings ) ) ; <nl> - settings . on_headers_complete = on_headers_complete ; <nl> - <nl> - http_parser parser ; <nl> - http_parser_init ( & parser , HTTP_RESPONSE ) ; <nl> - / / callback object ptr . <nl> - parser . data = ( void * ) this ; <nl> - <nl> - / / reset response header . <nl> - memset ( & http_header , 0 , sizeof ( http_header ) ) ; <nl> - <nl> - / / parser header . <nl> - char buf [ SRS_HTTP_HEADER_BUFFER ] ; <nl> - for ( ; ; ) { <nl> - ssize_t nread ; <nl> - if ( ( ret = skt - > read ( buf , ( size_t ) sizeof ( buf ) , & nread ) ) ! = ERROR_SUCCESS ) { <nl> - srs_error ( " read body from server failed . ret = % d " , ret ) ; <nl> - return ret ; <nl> - } <nl> - <nl> - ssize_t nparsed = http_parser_execute ( & parser , & settings , buf , nread ) ; <nl> - srs_info ( " read_size = % d , nparsed = % d " , ( int ) nread , ( int ) nparsed ) ; <nl> - <nl> - / / check header size . <nl> - if ( http_header . nread ! = 0 ) { <nl> - body_received = nread - nparsed ; <nl> - <nl> - srs_info ( " http header parsed , size = % d , content - length = % " PRId64 " , body - received = % d " , <nl> - http_header . nread , http_header . content_length , body_received ) ; <nl> - <nl> - if ( response ! = NULL & & body_received > 0 ) { <nl> - response - > append ( buf + nparsed , body_received ) ; <nl> - } <nl> - <nl> - return ret ; <nl> - } <nl> - <nl> - if ( nparsed ! = nread ) { <nl> - ret = ERROR_HTTP_PARSE_HEADER ; <nl> - srs_error ( " parse response error , parsed ( % d ) ! = read ( % d ) , ret = % d " , ( int ) nparsed , ( int ) nread , ret ) ; <nl> - return ret ; <nl> - } <nl> - } <nl> - <nl> - return ret ; <nl> - } <nl> - <nl> - int SrsHttpClient : : parse_response_body ( SrsHttpUri * uri , SrsSocket * skt , std : : string * response , int body_received ) <nl> - { <nl> - int ret = ERROR_SUCCESS ; <nl> - <nl> - srs_assert ( uri ! = NULL ) ; <nl> - <nl> - uint64_t body_left = http_header . content_length - body_received ; <nl> - <nl> - if ( body_left < = 0 ) { <nl> - return ret ; <nl> - } <nl> - <nl> - if ( response ! = NULL ) { <nl> - char buf [ SRS_HTTP_BODY_BUFFER ] ; <nl> - <nl> - return parse_response_body_data ( <nl> - uri , skt , response , ( size_t ) body_left , <nl> - ( const void * ) buf , ( size_t ) SRS_HTTP_BODY_BUFFER <nl> - ) ; <nl> - } else { <nl> - / / if ignore response , use shared fast memory . <nl> - static char buf [ SRS_HTTP_BODY_BUFFER ] ; <nl> - <nl> - return parse_response_body_data ( <nl> - uri , skt , response , ( size_t ) body_left , <nl> - ( const void * ) buf , ( size_t ) SRS_HTTP_BODY_BUFFER <nl> - ) ; <nl> - } <nl> - <nl> - return ret ; <nl> - } <nl> - <nl> - int SrsHttpClient : : parse_response_body_data ( SrsHttpUri * uri , SrsSocket * skt , std : : string * response , size_t body_left , const void * buf , size_t size ) <nl> - { <nl> - int ret = ERROR_SUCCESS ; <nl> - <nl> - srs_assert ( uri ! = NULL ) ; <nl> - <nl> - while ( body_left > 0 ) { <nl> - ssize_t nread ; <nl> - int size_to_read = srs_min ( size , body_left ) ; <nl> - if ( ( ret = skt - > read ( buf , size_to_read , & nread ) ) ! = ERROR_SUCCESS ) { <nl> - srs_error ( " read header from server failed . ret = % d " , ret ) ; <nl> - return ret ; <nl> - } <nl> - <nl> - if ( response ! = NULL & & nread > 0 ) { <nl> - response - > append ( ( char * ) buf , nread ) ; <nl> - } <nl> - <nl> - body_left - = nread ; <nl> - srs_info ( " read url ( % s ) content partial % " PRId64 " / % " PRId64 " " , <nl> - uri - > get_url ( ) , http_header . content_length - body_left , http_header . content_length ) ; <nl> - } <nl> - <nl> - return ret ; <nl> - } <nl> - <nl> - int SrsHttpClient : : on_headers_complete ( http_parser * parser ) <nl> - { <nl> - SrsHttpClient * obj = ( SrsHttpClient * ) parser - > data ; <nl> - obj - > complete_header ( parser ) ; <nl> - <nl> - / / see http_parser . c : 1570 , return 1 to skip body . <nl> - return 1 ; <nl> - } <nl> - <nl> - void SrsHttpClient : : complete_header ( http_parser * parser ) <nl> - { <nl> - / / save the parser status when header parse completed . <nl> - memcpy ( & http_header , parser , sizeof ( http_header ) ) ; <nl> - } <nl> - <nl> SrsHttpHooks : : SrsHttpHooks ( ) <nl> { <nl> } <nl> mmm a / trunk / src / app / srs_app_http_hooks . hpp <nl> ppp b / trunk / src / app / srs_app_http_hooks . hpp <nl> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE . <nl> class SrsHttpUri ; <nl> class SrsSocket ; <nl> class SrsRequest ; <nl> + class SrsHttpParser ; <nl> <nl> # include < srs_app_st . hpp > <nl> <nl> class SrsHttpClient <nl> private : <nl> bool connected ; <nl> st_netfd_t stfd ; <nl> - private : <nl> - http_parser http_header ; <nl> + SrsHttpParser * parser ; <nl> public : <nl> SrsHttpClient ( ) ; <nl> virtual ~ SrsHttpClient ( ) ; <nl> class SrsHttpClient <nl> private : <nl> virtual void disconnect ( ) ; <nl> virtual int connect ( SrsHttpUri * uri ) ; <nl> - private : <nl> - virtual int parse_response ( SrsHttpUri * uri , SrsSocket * skt , std : : string * response ) ; <nl> - virtual int parse_response_header ( SrsSocket * skt , std : : string * response , int & body_received ) ; <nl> - virtual int parse_response_body ( SrsHttpUri * uri , SrsSocket * skt , std : : string * response , int body_received ) ; <nl> - virtual int parse_response_body_data ( SrsHttpUri * uri , SrsSocket * skt , std : : string * response , size_t body_left , const void * buf , size_t size ) ; <nl> - private : <nl> - static int on_headers_complete ( http_parser * parser ) ; <nl> - virtual void complete_header ( http_parser * parser ) ; <nl> } ; <nl> <nl> / * * <nl>
|
refine http framework , use http message
|
ossrs/srs
|
ec6d696565a20c39e72f27956ddb1e1b76fd505d
|
2014-04-02T04:03:49Z
|
mmm a / stdlib / public / core / Integers . swift . gyb <nl> ppp b / stdlib / public / core / Integers . swift . gyb <nl> def assignmentOperatorComment ( operator , fixedWidth ) : <nl> / / / less than zero , the minimum representable ` UInt8 ` value : <nl> / / / <nl> / / / var x : UInt8 = 21 <nl> - / / / x - 50 <nl> + / / / x - 50 <nl> / / / / / Overflow error <nl> / / / <nl> / / / - Note : Overflow checking is not performed in ` - Ounchecked ` builds . <nl> def assignmentOperatorComment ( operator , fixedWidth ) : <nl> / / / - rhs : The value to subtract from ` lhs ` . <nl> " " " , <nl> ' * ' : " " " \ <nl> - / / / Multiplies two values and stores the result in the left - hand - side <nl> + / / / Multiplies two values and stores the result in the left - hand - side <nl> / / / variable . <nl> / / / <nl> " " " + ( " " " \ <nl> def assignmentOperatorComment ( operator , fixedWidth ) : <nl> / / / the maximum representable ` Int8 ` value : <nl> / / / <nl> / / / var x : Int8 = 21 <nl> - / / / x * 21 <nl> + / / / x * 21 <nl> / / / / / Overflow error <nl> / / / <nl> / / / - Note : Overflow checking is not performed in ` - Ounchecked ` builds . <nl> def assignmentOperatorComment ( operator , fixedWidth ) : <nl> / / / y % = - 5 <nl> / / / / / y = = 2 <nl> / / / <nl> - / / / var z = - 22 <nl> + / / / var z = - 22 <nl> / / / z % = - 5 <nl> / / / / / z = = - 2 <nl> / / / <nl> $ { assignmentOperatorComment ( x . nonMaskingOperator , False ) } <nl> static func $ { x . nonMaskingOperator } = < RHS : BinaryInteger > ( <nl> _ lhs : inout Self , _ rhs : RHS ) <nl> % end <nl> - <nl> + <nl> / / / Returns the quotient and remainder of this value divided by the given <nl> / / / value . <nl> / / / <nl> extension BinaryInteger { <nl> self = 0 <nl> } <nl> <nl> - / / / Creates an integer from the given floating - point value , if it can be <nl> - / / / represented exactly . <nl> - / / / <nl> - / / / If the value passed as ` source ` is not representable exactly , the result <nl> - / / / is ` nil ` . In the following example , the constant ` x ` is successfully <nl> - / / / created from a value of ` 21 . 0 ` , while the attempt to initialize the <nl> - / / / constant ` y ` from ` 21 . 5 ` fails : <nl> - / / / <nl> - / / / let x = Int ( exactly : 21 . 0 ) <nl> - / / / / / x = = Optional ( 21 ) <nl> - / / / let y = Int ( exactly : 21 . 5 ) <nl> - / / / / / y = = nil <nl> - / / / <nl> - / / / - Parameter source : A floating - point value to convert to an integer . <nl> - public init ? < T : BinaryFloatingPoint > ( exactly source : T ) { <nl> - / / FIXME ( integers ) : implement <nl> - fatalError ( ) <nl> - } <nl> - <nl> @ _transparent <nl> public func signum ( ) - > Self { <nl> return ( self > ( 0 as Self ) ? 1 : 0 ) - ( self < ( 0 as Self ) ? 1 : 0 ) <nl> extension FixedWidthInteger { <nl> self = value . byteSwapped <nl> # endif <nl> } <nl> - <nl> + <nl> public init ( bigEndian value : Self ) { <nl> # if _endian ( big ) <nl> self = value <nl> extension FixedWidthInteger { <nl> self = value . byteSwapped <nl> # endif <nl> } <nl> - <nl> + <nl> public var littleEndian : Self { <nl> # if _endian ( little ) <nl> return self <nl> extension FixedWidthInteger { <nl> return byteSwapped <nl> # endif <nl> } <nl> - <nl> + <nl> public var bigEndian : Self { <nl> # if _endian ( big ) <nl> return self <nl> extension FixedWidthInteger { <nl> return byteSwapped <nl> # endif <nl> } <nl> - <nl> + <nl> % for x in maskingShifts : <nl> - <nl> + <nl> / / Homogeneous masking shift <nl> $ { operatorComment ( x . operator , False ) } <nl> @ _semantics ( " optimize . sil . specialize . generic . partial . never " ) <nl> $ { operatorComment ( x . nonMaskingOperator , True ) } <nl> } <nl> <nl> extension FixedWidthInteger { <nl> + @ _semantics ( " optimize . sil . specialize . generic . partial . never " ) <nl> + public / / @ testable <nl> + static func _convert < Source : BinaryFloatingPoint > ( <nl> + from source : Source <nl> + ) - > ( value : Self ? , exact : Bool ) { <nl> + guard _fastPath ( ! source . isZero ) else { return ( 0 , true ) } <nl> + guard _fastPath ( source . isFinite ) else { return ( nil , false ) } <nl> + guard Self . isSigned | | source > 0 else { return ( nil , false ) } <nl> + let exponent = source . exponent <nl> + if _slowPath ( Self . bitWidth < = exponent ) { return ( nil , false ) } <nl> + let minBitWidth = source . significandWidth <nl> + let isExact = ( minBitWidth < = exponent ) <nl> + let bitPattern = source . significandBitPattern <nl> + / / ` RawSignificand . bitWidth ` is not available if ` RawSignificand ` does not <nl> + / / conform to ` FixedWidthInteger ` ; we can compute this value as follows if <nl> + / / ` source ` is finite : <nl> + let bitWidth = minBitWidth & + bitPattern . trailingZeroBitCount <nl> + let shift = exponent - Source . Exponent ( bitWidth ) <nl> + / / Use ` Self . Magnitude ` to prevent sign extension if ` shift < 0 ` . <nl> + let shiftedBitPattern = Self . Magnitude . bitWidth > bitWidth <nl> + ? Self . Magnitude ( truncatingIfNeeded : bitPattern ) < < shift <nl> + : Self . Magnitude ( truncatingIfNeeded : bitPattern < < shift ) <nl> + if _slowPath ( Self . isSigned & & Self . bitWidth & - 1 = = exponent ) { <nl> + return source < 0 & & shiftedBitPattern = = 0 <nl> + ? ( Self . min , isExact ) <nl> + : ( nil , false ) <nl> + } <nl> + let magnitude = ( ( 1 as Self . Magnitude ) < < exponent ) | shiftedBitPattern <nl> + return ( <nl> + Self . isSigned & & source < 0 ? 0 & - Self ( magnitude ) : Self ( magnitude ) , <nl> + isExact ) <nl> + } <nl> + <nl> + / / / Creates an integer from the given floating - point value , rounding toward <nl> + / / / zero . Any fractional part of the value passed as ` source ` is removed . <nl> + / / / <nl> + / / / let x = Int ( 21 . 5 ) <nl> + / / / / / x = = 21 <nl> + / / / let y = Int ( - 21 . 5 ) <nl> + / / / / / y = = - 21 <nl> + / / / <nl> + / / / If ` source ` is outside the bounds of this type after rounding toward <nl> + / / / zero , a runtime error may occur . <nl> + / / / <nl> + / / / let z = UInt ( - 21 . 5 ) <nl> + / / / / / Error : . . . the result would be less than UInt . min <nl> + / / / <nl> + / / / - Parameter source : A floating - point value to convert to an integer . <nl> + / / / ` source ` must be representable in this type after rounding toward <nl> + / / / zero . <nl> + @ _semantics ( " optimize . sil . specialize . generic . partial . never " ) <nl> + @ inline ( __always ) <nl> + public init < T : BinaryFloatingPoint > ( _ source : T ) { <nl> + guard let value = Self . _convert ( from : source ) . value else { <nl> + fatalError ( " " " <nl> + \ ( T . self ) value cannot be converted to \ ( Self . self ) because it is \ <nl> + infinite or NaN , or because the result would be greater than \ <nl> + \ ( Self . self ) . max or less than \ ( Self . self ) . min <nl> + " " " ) <nl> + } <nl> + self = value <nl> + } <nl> + <nl> + / / / Creates an integer from the given floating - point value , if it can be <nl> + / / / represented exactly . <nl> + / / / <nl> + / / / If the value passed as ` source ` is not representable exactly , the result <nl> + / / / is ` nil ` . In the following example , the constant ` x ` is successfully <nl> + / / / created from a value of ` 21 . 0 ` , while the attempt to initialize the <nl> + / / / constant ` y ` from ` 21 . 5 ` fails : <nl> + / / / <nl> + / / / let x = Int ( exactly : 21 . 0 ) <nl> + / / / / / x = = Optional ( 21 ) <nl> + / / / let y = Int ( exactly : 21 . 5 ) <nl> + / / / / / y = = nil <nl> + / / / <nl> + / / / - Parameter source : A floating - point value to convert to an integer . <nl> + @ _semantics ( " optimize . sil . specialize . generic . partial . never " ) <nl> + @ inline ( __always ) <nl> + public init ? < T : BinaryFloatingPoint > ( exactly source : T ) { <nl> + let ( temporary , exact ) = Self . _convert ( from : source ) <nl> + guard exact , let value = temporary else { <nl> + return nil <nl> + } <nl> + self = value <nl> + } <nl> + <nl> / / / Creates a new instance with the representable value that ' s closest to the <nl> / / / given integer . <nl> / / / <nl> extension FixedWidthInteger { <nl> / / / <nl> / / / - Parameter source : An integer to convert to this type . <nl> @ _semantics ( " optimize . sil . specialize . generic . partial . never " ) <nl> - public init < Other : BinaryInteger > ( clamping source : Other ) { <nl> + public init < Other : BinaryInteger > ( clamping source : Other ) { <nl> if _slowPath ( source < Self . min ) { <nl> self = Self . min <nl> } <nl> $ { assignmentOperatorComment ( x . operator , True ) } <nl> } <nl> % # end of concrete type : $ { Self } <nl> <nl> - extension $ { Self } { <nl> - / / / Creates an integer from the given floating - point value , rounding toward <nl> - / / / zero . <nl> - / / / <nl> - / / / Any fractional part of the value passed as ` source ` is removed , rounding <nl> - / / / the value toward zero . <nl> - / / / <nl> - / / / let x = Int ( 21 . 5 ) <nl> - / / / / / x = = 21 <nl> - / / / let y = Int ( - 21 . 5 ) <nl> - / / / / / y = = - 21 <nl> - / / / <nl> - / / / If ` source ` is outside the bounds of this type after rounding toward <nl> - / / / zero , a runtime error may occur . <nl> - / / / <nl> - / / / let z = UInt ( - 21 . 5 ) <nl> - / / / / / Error : . . . the result would be less than UInt . min <nl> - / / / <nl> - / / / - Parameter source : A floating - point value to convert to an integer . <nl> - / / / ` source ` must be representable in this type after rounding toward <nl> - / / / zero . <nl> - / / FIXME ( integers ) : implement me in a less terrible way <nl> - public init < T : BinaryFloatingPoint > ( _ source : T ) { <nl> - % for ( FloatType , FloatBits ) in [ <nl> - % ( ' Float ' , 32 ) , ( ' Double ' , 64 ) , ( ' Float80 ' , 80 ) ] : <nl> - % if FloatType = = ' Float80 ' : <nl> - # if ! os ( Windows ) & & ( arch ( i386 ) | | arch ( x86_64 ) ) <nl> - % end <nl> - if source is $ { FloatType } { <nl> - self . init ( source as ! $ { FloatType } ) <nl> - return <nl> - } <nl> - % if FloatType = = ' Float80 ' : <nl> - # endif <nl> - % end <nl> - % end <nl> - _preconditionFailure ( " Conversion is not supported " ) <nl> - } <nl> - } <nl> - <nl> - <nl> extension $ { Self } : Hashable { <nl> / / / The integer ' s hash value . <nl> / / / <nl> mmm a / test / stdlib / integer_conversions . swift <nl> ppp b / test / stdlib / integer_conversions . swift <nl> print ( tentwenty ) <nl> / / CHECK : 4294967295 <nl> / / CHECK : 15 <nl> / / CHECK : 1020 <nl> + <nl> + <nl> + / / Test generic conversions from floating point <nl> + <nl> + print ( Int8 . _convert ( from : - 128 ) ) <nl> + print ( Int8 . _convert ( from : 128 ) ) <nl> + print ( Int8 . _convert ( from : - 127 ) ) <nl> + print ( Int8 . _convert ( from : 127 ) ) <nl> + <nl> + / / CHECK : ( value : Optional ( - 128 ) , exact : true ) <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + / / CHECK : ( value : Optional ( - 127 ) , exact : true ) <nl> + / / CHECK : ( value : Optional ( 127 ) , exact : true ) <nl> + <nl> + print ( Int8 . _convert ( from : - 129 ) ) <nl> + print ( Int8 . _convert ( from : - 128 . 999 ) ) <nl> + print ( Int8 . _convert ( from : - 128 . 001 ) ) <nl> + print ( Int8 . _convert ( from : - 127 . 999 ) ) <nl> + print ( Int8 . _convert ( from : - 127 . 001 ) ) <nl> + print ( Int8 . _convert ( from : 127 . 001 ) ) <nl> + print ( Int8 . _convert ( from : 127 . 999 ) ) <nl> + <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + / / CHECK : ( value : Optional ( - 128 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( - 128 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( - 127 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( - 127 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( 127 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( 127 ) , exact : false ) <nl> + <nl> + print ( Int8 . _convert ( from : 0 ) ) <nl> + print ( Int8 . _convert ( from : - 0 . 0 ) ) <nl> + print ( Int8 . _convert ( from : 0 . 001 ) ) <nl> + print ( Int8 . _convert ( from : - 0 . 001 ) ) <nl> + <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : true ) <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : true ) <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : false ) <nl> + <nl> + print ( Int8 . _convert ( from : Double . leastNonzeroMagnitude ) ) <nl> + print ( Int8 . _convert ( from : - Double . leastNonzeroMagnitude ) ) <nl> + print ( Int8 . _convert ( from : Double . leastNormalMagnitude ) ) <nl> + print ( Int8 . _convert ( from : - Double . leastNormalMagnitude ) ) <nl> + <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : false ) <nl> + / / CHECK : ( value : Optional ( 0 ) , exact : false ) <nl> + <nl> + print ( UInt8 . _convert ( from : - 1 ) ) <nl> + print ( UInt8 . _convert ( from : 255 ) ) <nl> + print ( UInt8 . _convert ( from : 256 ) ) <nl> + print ( UInt8 . _convert ( from : Double . infinity ) ) <nl> + print ( UInt8 . _convert ( from : - Double . infinity ) ) <nl> + print ( UInt8 . _convert ( from : Double . nan ) ) <nl> + <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + / / CHECK : ( value : Optional ( 255 ) , exact : true ) <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + <nl> + let f = Float ( Int64 . min ) <nl> + let ff = Int64 . _convert ( from : f ) <nl> + let fff = Int64 ( f ) <nl> + print ( fff = = ff . value ! ) <nl> + / / CHECK : true <nl> + <nl> + let g = f . nextUp <nl> + let gg = Int64 . _convert ( from : g ) <nl> + let ggg = Int64 ( g ) <nl> + print ( ggg = = gg . value ! ) <nl> + / / CHECK : true <nl> + <nl> + let h = Float ( Int64 . max ) <nl> + let hh = Int64 . _convert ( from : h ) <nl> + print ( hh ) <nl> + / / CHECK : ( value : nil , exact : false ) <nl> + <nl> + let i = h . nextDown <nl> + let ii = Int64 . _convert ( from : i ) <nl> + let iii = Int64 ( i ) <nl> + print ( iii = = ii . value ! ) <nl> + / / CHECK : true <nl>
|
Merge pull request from xwu / integer - conversion
|
apple/swift
|
5037e071717c63b188d787e3dd029203b2b770a0
|
2017-08-23T16:53:22Z
|
mmm a / aten / src / ATen / native / EmbeddingBag . cpp <nl> ppp b / aten / src / ATen / native / EmbeddingBag . cpp <nl> static Tensor apply_bag_size ( const Tensor & offsets , const Tensor & indices , <nl> / / Avoid dividing by 0 for empty bags . <nl> / / Instead we want empty bags to return all 0s <nl> auto bag_size_ = at : : max ( bag_size , at : : ones_like ( bag_size ) ) <nl> - . toType ( output . type ( ) ) <nl> + . to ( output . options ( ) ) <nl> . unsqueeze ( 1 ) <nl> . expand_as ( output ) ; <nl> output / = bag_size_ ; <nl> static Tensor apply_bag_size_backward ( const Tensor & offsets , <nl> auto bag_size_ = indices . size ( 0 ) ; <nl> output / = bag_size_ ; <nl> } else { <nl> - auto inv_bag_size_ = ( 1 / bag_size . toType ( output . type ( ) ) ) <nl> + auto inv_bag_size_ = ( 1 / bag_size . to ( output . options ( ) ) ) <nl> . unsqueeze ( 1 ) <nl> . index_select ( 0 , offset2bag ) ; <nl> output * = inv_bag_size_ ; <nl> template < typename scalar_t > <nl> std : : tuple < Tensor , Tensor , Tensor , Tensor > embedding_bag_cpu_max ( <nl> const Tensor & weight , const Tensor & indices , const Tensor & offset2bag , const Tensor & output , const Tensor & bag_size , const Tensor & offsets ) { <nl> <nl> - auto max_indices = at : : zeros ( { offsets . size ( 0 ) , weight . size ( 1 ) } , indices . type ( ) ) ; <nl> + auto max_indices = at : : zeros ( { offsets . size ( 0 ) , weight . size ( 1 ) } , indices . options ( ) ) ; <nl> <nl> int64_t numel = indices . numel ( ) ; <nl> int64_t dims = weight . size ( 1 ) ; <nl> _embedding_bag_cpu ( const Tensor & weight , const Tensor & indices , <nl> auto weight_arg = TensorArg ( weight , " weight " , 1 ) ; <nl> checkScalarTypes ( " embedding_bag " , weight_arg , { kFloat , kDouble } ) ; <nl> <nl> - auto bag_size = at : : zeros ( offsets . sizes ( ) , indices . type ( ) ) ; <nl> + auto bag_size = at : : zeros ( offsets . sizes ( ) , indices . options ( ) ) ; <nl> make_bag_size ( offsets , indices , mode , bag_size ) ; <nl> <nl> / / If the last entries are empty , that the last offsets are irrelevant as they <nl> _embedding_bag_cpu ( const Tensor & weight , const Tensor & indices , <nl> auto output = at : : zeros ( { offsets . size ( 0 ) , weight . size ( 1 ) } , weight . options ( ) ) ; <nl> <nl> if ( mode = = MODE_MEAN | | mode = = MODE_SUM ) { <nl> - if ( weight . type ( ) . scalarType ( ) = = kFloat ) { <nl> + if ( weight . scalar_type ( ) = = kFloat ) { <nl> index_select_add < float > ( indices , offset2bag , weight , output ) ; <nl> - } else if ( weight . type ( ) . scalarType ( ) = = kDouble ) { <nl> + } else if ( weight . scalar_type ( ) = = kDouble ) { <nl> index_select_add < double > ( indices , offset2bag , weight , output ) ; <nl> } <nl> auto ret = apply_bag_size ( offsets , indices , mode , output , bag_size ) ; <nl> Tensor _embedding_bag_dense_backward_cpu ( const Tensor & grad_ , const Tensor & indi <nl> } <nl> <nl> auto index_grad_weight = <nl> - at : : zeros ( { num_weights , grad . size ( 1 ) } , grad . type ( ) ) . contiguous ( ) ; <nl> + at : : zeros ( { num_weights , grad . size ( 1 ) } , grad . options ( ) ) . contiguous ( ) ; <nl> <nl> std : : vector < int64_t > counts_uniq ; <nl> counts_uniq . reserve ( num_weights ) ; <nl> Tensor _embedding_bag_dense_backward_cpu ( const Tensor & grad_ , const Tensor & indi <nl> } <nl> } <nl> int64_t ddim = grad . size ( 1 ) ; <nl> - if ( grad . type ( ) . scalarType ( ) = = kFloat ) { <nl> + if ( grad . scalar_type ( ) = = kFloat ) { <nl> auto igwd = index_grad_weight . data < float > ( ) ; <nl> auto gd = grad . data < float > ( ) ; <nl> THBlas_axpy < float > ( ddim , ( float ) scale , gd + ddim * source , 1 , <nl> igwd + ddim * index , 1 ) ; <nl> - } else if ( grad . type ( ) . scalarType ( ) = = kDouble ) { <nl> + } else if ( grad . scalar_type ( ) = = kDouble ) { <nl> auto igwd = index_grad_weight . data < double > ( ) ; <nl> auto gd = grad . data < double > ( ) ; <nl> THBlas_axpy < double > ( ddim , ( double ) scale , gd + ddim * source , 1 , <nl>
|
Expunge uses of type ( ) from EmbeddingBag . ( )
|
pytorch/pytorch
|
7879c979b56a0df6cfad21ff231f9241c065b380
|
2018-11-30T00:04:12Z
|
mmm a / libraries / chain / controller . cpp <nl> ppp b / libraries / chain / controller . cpp <nl> struct controller_impl { <nl> } <nl> <nl> <nl> + <nl> / * * <nl> * This method will backup all tranasctions in the current pending block , <nl> * undo the pending block , call f ( ) , and then push the pending transactions <nl> struct controller_impl { <nl> } ) ; <nl> } <nl> <nl> + transaction_trace_ptr push_transaction ( const transaction_metadata_ptr & trx ) { <nl> + return db . with_write_lock ( [ & ] ( ) { <nl> + return apply_transaction ( trx ) ; <nl> + } ) ; <nl> + } <nl> + <nl> + void record_transaction ( const transaction_metadata_ptr & trx ) { <nl> + try { <nl> + _db . create < transaction_object > ( [ & ] ( transaction_object & transaction ) { <nl> + transaction . trx_id = trx - > id ; <nl> + transaction . expiration = trx - > trx . expiration ; <nl> + } ) ; <nl> + } catch ( . . . ) { <nl> + EOS_ASSERT ( false , transaction_exception , <nl> + " duplicate transaction $ { id } " , <nl> + ( " id " , trx . id ( ) ) ) ; <nl> + } <nl> + } <nl> + <nl> + void start_transaction ( const transaction_metadata_ptr & trx ) { <nl> + record_transaction ( trx ) ; <nl> + } <nl> + <nl> + transaction_trace_ptr apply_transaction ( const transaction_metadata_ptr & trx , bool implicit = false ) { <nl> + auto trx_session = db . start_undo_session ( ) ; <nl> + / / TODO : notify pre transaction <nl> + <nl> + start_transaction ( trx ) ; <nl> + <nl> + <nl> + for ( const auto & act : trx - > trx . context_free_actions ) { <nl> + apply_action ( act , . . . ) ; <nl> + / * <nl> + apply_context context ( self , db , act , trx ) ; <nl> + context . context_free = true ; <nl> + context . exec ( ) ; <nl> + receipt . kcpu_usage + = context . kcpu_usage <nl> + * / <nl> + <nl> + } <nl> + <nl> + for ( const auto & act : trx - > trx . actions ) { <nl> + auto act_session = db . start_undo_session ( ) ; <nl> + / / TODO : notify pre action <nl> + <nl> + / * <nl> + apply_context context ( self , db , act , trx ) ; <nl> + context . exec ( ) ; <nl> + receipt . kcpu_usage + = context . kcpu_usage <nl> + * / <nl> + <nl> + / / TODO : notify post action <nl> + act_session . squash ( ) ; <nl> + } <nl> + <nl> + finalize_transaction ( ) ; <nl> + <nl> + / / TODO : notify post transaction <nl> + trx_session . squash ( ) ; <nl> + <nl> + push_transaction_receipt ( trx , type ) ; <nl> + } <nl> + <nl> + <nl> + <nl> + <nl> + <nl> <nl> block_state_ptr push_block_impl ( const signed_block_ptr & b ) { <nl> # if 0 <nl> struct controller_impl { <nl> } / / / validate_net_usage <nl> * / <nl> <nl> + <nl> + <nl> + transaction_trace_ptr apply_transaction ( const transaction_metadata_ptr & trx ) { <nl> + auto trx_trace = std : : make_shared < transaction_trace > ( ) ; <nl> + trx_trace - > action_traces . reserve ( trx - > trx . actions . size ( ) ) ; <nl> + trx_trace - > action_receipts . reserve ( trx - > trx . actions . size ( ) ) ; <nl> + <nl> + for ( const auto & act : trx - > trx . actions ) { <nl> + / / trx_trace - > action_receipts . emplace_back ( apply_action ( act <nl> + } <nl> + return trx_trace ; <nl> + } <nl> + <nl> + <nl> void finalize_block ( const block_trace & trace ) <nl> { try { <nl> <nl> void controller : : start_block ( block_timestamp_type when ) { <nl> FC_ASSERT ( ! my - > pending ) ; <nl> <nl> my - > pending = my - > db . start_undo_session ( true ) ; <nl> - <nl> my - > pending - > _pending_block_state = std : : make_shared < block_state > ( * my - > head , when ) ; <nl> + <nl> + auto t = my - > get_on_block_transaction ( ) ; <nl> + / / apply_transaction ( <nl> + / / idump ( ( t ) ) ; <nl> } <nl> <nl> void controller : : finalize_block ( ) { <nl> auto p = my - > pending - > _pending_block_state ; <nl> <nl> - / / / set trx mroot and act mroot <nl> - my - > pending - > _pending_block_state - > id = my - > pending - > _pending_block_state - > header . id ( ) ; <nl> + / / / set trx mroot and act mroot on pending . header and pending . block ( which also has copy of header ) <nl> + / / my - > pending - > _pending_block_state - > id = my - > pending - > _pending_block_state - > header . id ( ) ; <nl> } <nl> <nl> void controller : : sign_block ( std : : function < signature_type ( const digest_type & ) > signer_callback ) { <nl> void controller : : push_block ( const signed_block_ptr & b ) { <nl> } <nl> <nl> transaction_trace_ptr controller : : push_transaction ( const transaction_metadata_ptr & trx ) { <nl> - <nl> + return my - > push_transaction ( ) ; <nl> } <nl> <nl> transaction_trace_ptr controller : : push_transaction ( ) { <nl> mmm a / libraries / chain / include / eosio / chain / block_state . hpp <nl> ppp b / libraries / chain / include / eosio / chain / block_state . hpp <nl> namespace eosio { namespace chain { <nl> struct action_receipt { <nl> account_name receiver ; <nl> action act ; <nl> - uint32_t block_sequence ; <nl> - uint32_t sender_sequence ; <nl> - fc : : sha256 transaction_id_type ; / / / the trx that started this action <nl> - uint16_t trx_action_dispatch_seq ; / / / < the relative order for implied trx <nl> - uint16_t trx_action_creator_seq ; / / / < the dispatch seq of the action that created this dispatch <nl> - uint16_t trx_action_dispatch_count ; / / / < the total number of actions dispatched by transaction when this action was dispatched <nl> + uint32_t block_sequence ; / / / block num <nl> + uint32_t sender_sequence ; <nl> + transaction_id_type trx_id ; / / / the trx that started this action <nl> + uint16_t trx_action_dispatch_seq ; / / / < the relative order for implied trx <nl> / / / TODO : add code / scope / rw sequence numbers <nl> } ; <nl> <nl> namespace eosio { namespace chain { <nl> typedef std : : shared_ptr < transaction_trace > transaction_trace_ptr ; <nl> <nl> struct block_trace { <nl> - fc : : microseconds ellapsed ; <nl> - uint64_t cpu_usage ; <nl> - vector < transaction_trace > trx_traces ; <nl> + fc : : microseconds ellapsed ; <nl> + uint64_t cpu_usage ; <nl> + vector < transaction_trace_ptr > trx_traces ; <nl> } ; <nl> typedef std : : shared_ptr < block_trace > block_trace_ptr ; <nl> <nl> mmm a / libraries / chain / main . cpp <nl> ppp b / libraries / chain / main . cpp <nl> int main ( int argc , char * * argv ) { <nl> controller c ( { } ) ; <nl> controller c2 ( { . shared_memory_dir = " c2dir " , . block_log_dir = " c2dir " } ) ; <nl> <nl> - c . start_block ( ) ; <nl> - c . finalize_block ( ) ; <nl> - c . sign_block ( [ ] ( digest_type d ) { <nl> - auto priv = fc : : variant ( " 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 " ) . as < private_key_type > ( ) ; <nl> - return priv . sign ( d ) ; <nl> - } ) ; <nl> - c . commit_block ( ) ; <nl> - <nl> - c2 . push_block ( c . head_block_state ( ) - > block ) ; <nl> - <nl> - <nl> for ( uint32_t i = 0 ; i < 4 ; + + i ) { <nl> - ilog ( " = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ n " ) ; <nl> c . start_block ( ) ; <nl> c . finalize_block ( ) ; <nl> c . sign_block ( [ ] ( digest_type d ) { <nl> for ( uint32_t i = 0 ; i < 4 ; + + i ) { <nl> return priv . sign ( d ) ; <nl> } ) ; <nl> c . commit_block ( ) ; <nl> + <nl> c2 . push_block ( c . head_block_state ( ) - > block ) ; <nl> - idump ( ( c . head_block_num ( ) ) ( c2 . head_block_state ( ) - > dpos_last_irreversible_blocknum ) ) ; <nl> - idump ( ( c2 . head_block_num ( ) ) ( c2 . head_block_state ( ) - > dpos_last_irreversible_blocknum ) ) ; <nl> + idump ( ( c . head_block_state ( ) - > header ) ) ; <nl> + idump ( ( c2 . head_block_state ( ) - > header ) ) ; <nl> } <nl> <nl> <nl>
|
progress
|
EOSIO/eos
|
1bbe9db7abcad6feac9de6bedb9fa26d4dfa1e2e
|
2018-04-13T22:28:52Z
|
mmm a / appendix / dump_hid_value / main . cpp <nl> ppp b / appendix / dump_hid_value / main . cpp <nl> <nl> # include " boost_defs . hpp " <nl> <nl> # include " human_interface_device . hpp " <nl> - # include " human_interface_device_observer . hpp " <nl> # include " iokit_utility . hpp " <nl> # include " logger . hpp " <nl> # include < CoreFoundation / CoreFoundation . h > <nl> class dump_hid_value final { <nl> <nl> krbn : : iokit_utility : : log_matching_device ( device ) ; <nl> <nl> - auto observer = std : : make_shared < krbn : : human_interface_device_observer > ( device ) ; <nl> - observer - > hid_value_arrived . connect ( [ & ] ( auto & human_interface_device_observer , <nl> - auto & hid_value ) { <nl> - print_hid_value ( human_interface_device_observer , hid_value ) ; <nl> - } ) ; <nl> - hid_observers_ [ device ] = observer ; <nl> + hids_ [ device ] = std : : make_unique < krbn : : human_interface_device > ( device ) ; <nl> + auto & dev = hids_ [ device ] ; <nl> + dev - > set_value_callback ( boost : : bind ( & dump_hid_value : : value_callback , this , _1 , _2 ) ) ; <nl> + dev - > observe ( ) ; <nl> } <nl> <nl> static void static_device_removal_callback ( void * _Nullable context , IOReturn result , void * _Nullable sender , IOHIDDeviceRef _Nonnull device ) { <nl> class dump_hid_value final { <nl> <nl> krbn : : iokit_utility : : log_removal_device ( device ) ; <nl> <nl> - auto it = hid_observers_ . find ( device ) ; <nl> - if ( it ! = hid_observers_ . end ( ) ) { <nl> - hid_observers_ . erase ( it ) ; <nl> - } <nl> - } <nl> - <nl> - void print_hid_value ( const krbn : : human_interface_device_observer & human_interface_device_observer , <nl> - const krbn : : hid_value & hid_value ) const { <nl> - if ( auto key_code = krbn : : types : : make_key_code ( hid_value ) ) { <nl> - if ( auto key_code_name = krbn : : types : : make_key_code_name ( * key_code ) ) { <nl> - std : : cout < < * key_code_name ; <nl> - } else { <nl> - std : : cout < < " key_code : " < < * key_code ; <nl> - } <nl> - <nl> - if ( hid_value . get_integer_value ( ) ) { <nl> - std : : cout < < " key_down " ; <nl> - } else { <nl> - std : : cout < < " key_up " ; <nl> - } <nl> - <nl> - std : : cout < < std : : endl ; <nl> - std : : cout < < " is_grabbable : " < < human_interface_device_observer . is_grabbable ( false ) < < std : : endl ; <nl> - return ; <nl> - } <nl> - <nl> - if ( auto consumer_key_code = krbn : : types : : make_consumer_key_code ( hid_value ) ) { <nl> - if ( auto consumer_key_code_name = krbn : : types : : make_consumer_key_code_name ( * consumer_key_code ) ) { <nl> - std : : cout < < * consumer_key_code_name ; <nl> - } else { <nl> - std : : cout < < " consumer_key_code : " < < * consumer_key_code ; <nl> - } <nl> - <nl> - if ( hid_value . get_integer_value ( ) ) { <nl> - std : : cout < < " key_down " ; <nl> - } else { <nl> - std : : cout < < " key_up " ; <nl> + auto it = hids_ . find ( device ) ; <nl> + if ( it ! = hids_ . end ( ) ) { <nl> + auto & dev = it - > second ; <nl> + if ( dev ) { <nl> + hids_ . erase ( it ) ; <nl> } <nl> - <nl> - std : : cout < < std : : endl ; <nl> - std : : cout < < " is_grabbable : " < < human_interface_device_observer . is_grabbable ( false ) < < std : : endl ; <nl> - return ; <nl> } <nl> + } <nl> <nl> - if ( auto pointing_button = krbn : : types : : make_pointing_button ( hid_value ) ) { <nl> - if ( auto pointing_button_name = krbn : : types : : make_pointing_button_name ( * pointing_button ) ) { <nl> - std : : cout < < * pointing_button_name ; <nl> - } else { <nl> - std : : cout < < " pointing_button : " < < * pointing_button ; <nl> - } <nl> - <nl> - if ( hid_value . get_integer_value ( ) ) { <nl> - std : : cout < < " key_down " ; <nl> - } else { <nl> - std : : cout < < " key_up " ; <nl> + void value_callback ( krbn : : human_interface_device & device , <nl> + krbn : : event_queue & event_queue ) { <nl> + for ( const auto & queued_event : event_queue . get_events ( ) ) { <nl> + switch ( queued_event . get_event ( ) . get_type ( ) ) { <nl> + case krbn : : event_queue : : queued_event : : event : : type : : none : <nl> + std : : cout < < " none " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : key_code : <nl> + if ( auto key_code = queued_event . get_event ( ) . get_key_code ( ) ) { <nl> + std : : cout < < " Key : " < < std : : dec < < static_cast < uint32_t > ( * key_code ) < < " " <nl> + < < queued_event . get_event_type ( ) <nl> + < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : consumer_key_code : <nl> + if ( auto consumer_key_code = queued_event . get_event ( ) . get_consumer_key_code ( ) ) { <nl> + std : : cout < < " ConsumerKey : " < < std : : dec < < static_cast < uint32_t > ( * consumer_key_code ) < < " " <nl> + < < queued_event . get_event_type ( ) <nl> + < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : pointing_button : <nl> + if ( auto pointing_button = queued_event . get_event ( ) . get_pointing_button ( ) ) { <nl> + std : : cout < < " Button : " < < std : : dec < < static_cast < uint32_t > ( * pointing_button ) < < " " <nl> + < < queued_event . get_event_type ( ) <nl> + < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : pointing_motion : <nl> + if ( auto pointing_motion = queued_event . get_event ( ) . get_pointing_motion ( ) ) { <nl> + std : : cout < < " pointing_motion : " < < pointing_motion - > to_json ( ) < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : shell_command : <nl> + std : : cout < < " shell_command " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : select_input_source : <nl> + std : : cout < < " select_input_source " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : set_variable : <nl> + std : : cout < < " set_variable " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : mouse_key : <nl> + std : : cout < < " mouse_key " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : stop_keyboard_repeat : <nl> + std : : cout < < " stop_keyboard_repeat " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : device_keys_and_pointing_buttons_are_released : <nl> + std : : cout < < " device_keys_and_pointing_buttons_are_released for " < < device . get_name_for_log ( ) < < " ( " < < device . get_device_id ( ) < < " ) " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : device_ungrabbed : <nl> + std : : cout < < " device_ungrabbed for " < < device . get_name_for_log ( ) < < " ( " < < device . get_device_id ( ) < < " ) " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : caps_lock_state_changed : <nl> + if ( auto integer_value = queued_event . get_event ( ) . get_integer_value ( ) ) { <nl> + std : : cout < < " caps_lock_state_changed " < < * integer_value < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : event_from_ignored_device : <nl> + std : : cout < < " event_from_ignored_device from " < < device . get_name_for_log ( ) < < " ( " < < device . get_device_id ( ) < < " ) " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : pointing_device_event_from_event_tap : <nl> + std : : cout < < " pointing_device_event_from_event_tap from " < < device . get_name_for_log ( ) < < " ( " < < device . get_device_id ( ) < < " ) " < < std : : endl ; <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : frontmost_application_changed : <nl> + if ( auto frontmost_application = queued_event . get_event ( ) . get_frontmost_application ( ) ) { <nl> + std : : cout < < " frontmost_application_changed " <nl> + < < frontmost_application - > get_bundle_identifier ( ) < < " " <nl> + < < frontmost_application - > get_file_path ( ) < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : input_source_changed : <nl> + if ( auto input_source_identifiers = queued_event . get_event ( ) . get_input_source_identifiers ( ) ) { <nl> + std : : cout < < " input_source_changed " < < input_source_identifiers < < std : : endl ; <nl> + } <nl> + break ; <nl> + <nl> + case krbn : : event_queue : : queued_event : : event : : type : : keyboard_type_changed : <nl> + if ( auto keyboard_type = queued_event . get_event ( ) . get_keyboard_type ( ) ) { <nl> + std : : cout < < " keyboard_type_changed " < < keyboard_type < < std : : endl ; <nl> + } <nl> + break ; <nl> } <nl> - <nl> - std : : cout < < std : : endl ; <nl> - std : : cout < < " is_grabbable : " < < human_interface_device_observer . is_grabbable ( false ) < < std : : endl ; <nl> - return ; <nl> - } <nl> - <nl> - if ( hid_value . conforms_to ( krbn : : hid_usage_page : : generic_desktop , krbn : : hid_usage : : gd_x ) ) { <nl> - std : : cout < < " pointing_motion x : " < < hid_value . get_integer_value ( ) < < std : : endl ; <nl> - return ; <nl> - } <nl> - if ( hid_value . conforms_to ( krbn : : hid_usage_page : : generic_desktop , krbn : : hid_usage : : gd_y ) ) { <nl> - std : : cout < < " pointing_motion y : " < < hid_value . get_integer_value ( ) < < std : : endl ; <nl> - return ; <nl> - } <nl> - if ( hid_value . conforms_to ( krbn : : hid_usage_page : : generic_desktop , krbn : : hid_usage : : gd_wheel ) ) { <nl> - std : : cout < < " pointing_motion vertical_wheel : " < < hid_value . get_integer_value ( ) < < std : : endl ; <nl> - return ; <nl> - } <nl> - if ( hid_value . conforms_to ( krbn : : hid_usage_page : : consumer , krbn : : hid_usage : : csmr_acpan ) ) { <nl> - std : : cout < < " pointing_motion horizontal_wheel : " < < hid_value . get_integer_value ( ) < < std : : endl ; <nl> - return ; <nl> - } <nl> - <nl> - if ( hid_value . conforms_to ( krbn : : hid_usage_page : : keyboard_or_keypad , krbn : : hid_usage ( 0x1 ) ) | | <nl> - hid_value . conforms_to ( krbn : : hid_usage_page : : keyboard_or_keypad , krbn : : hid_usage ( 0x2 ) ) | | <nl> - hid_value . conforms_to ( krbn : : hid_usage_page : : keyboard_or_keypad , krbn : : hid_usage ( 0x3 ) ) | | <nl> - hid_value . conforms_to ( krbn : : hid_usage_page : : keyboard_or_keypad , krbn : : hid_usage ( 0xffffffff ) ) | | <nl> - hid_value . conforms_to ( krbn : : hid_usage_page : : consumer , krbn : : hid_usage ( 0xffffffff ) ) | | <nl> - hid_value . conforms_to ( krbn : : hid_usage_page : : apple_vendor_keyboard , krbn : : hid_usage ( 0xffffffff ) ) | | <nl> - hid_value . conforms_to ( krbn : : hid_usage_page : : apple_vendor_top_case , krbn : : hid_usage ( 0xffffffff ) ) ) { <nl> - return ; <nl> } <nl> <nl> - std : : cout < < " hid_value : " < < hid_value . to_json ( ) < < std : : endl ; <nl> + event_queue . clear_events ( ) ; <nl> } <nl> <nl> IOHIDManagerRef _Nullable manager_ ; <nl> - std : : unordered_map < IOHIDDeviceRef , std : : shared_ptr < krbn : : human_interface_device_observer > > hid_observers_ ; <nl> + std : : unordered_map < IOHIDDeviceRef , std : : unique_ptr < krbn : : human_interface_device > > hids_ ; <nl> + krbn : : event_queue event_queue_ ; <nl> } ; <nl> } / / namespace <nl> <nl> deleted file mode 100644 <nl> index f99c8a16f . . 000000000 <nl> mmm a / src / share / human_interface_device_observer . hpp <nl> ppp / dev / null <nl> <nl> - # pragma once <nl> - <nl> - # include " boost_defs . hpp " <nl> - <nl> - # include " human_interface_device . hpp " <nl> - # include < boost / signals2 . hpp > <nl> - <nl> - namespace krbn { <nl> - class human_interface_device_observer final { <nl> - public : <nl> - boost : : signals2 : : signal < void ( const human_interface_device_observer & , <nl> - const hid_value & ) > <nl> - hid_value_arrived ; <nl> - <nl> - human_interface_device_observer ( const human_interface_device_observer & ) = delete ; <nl> - <nl> - human_interface_device_observer ( IOHIDDeviceRef _Nonnull device ) : human_interface_device_ ( device ) { <nl> - human_interface_device_ . hid_values_arrived . connect ( [ & ] ( auto & human_interface_device , <nl> - auto & hid_values ) { <nl> - hid_values_arrived_callback ( human_interface_device , <nl> - hid_values ) ; <nl> - } ) ; <nl> - <nl> - gcd_utility : : dispatch_sync_in_main_queue ( ^ { <nl> - auto r = human_interface_device_ . open ( ) ; <nl> - if ( r ! = kIOReturnSuccess ) { <nl> - logger : : get_logger ( ) . error ( " IOHIDDeviceOpen error : { 0 } ( { 1 } ) { 2 } " , <nl> - iokit_utility : : get_error_name ( r ) , <nl> - r , <nl> - human_interface_device_ . get_name_for_log ( ) ) ; <nl> - <nl> - } else { <nl> - human_interface_device_ . queue_start ( ) ; <nl> - human_interface_device_ . schedule ( ) ; <nl> - } <nl> - } ) ; <nl> - } <nl> - <nl> - ~ human_interface_device_observer ( void ) { <nl> - gcd_utility : : dispatch_sync_in_main_queue ( ^ { <nl> - human_interface_device_ . unschedule ( ) ; <nl> - human_interface_device_ . queue_stop ( ) ; <nl> - human_interface_device_ . close ( ) ; <nl> - <nl> - hid_values_arrived_connection . disconnect ( ) ; <nl> - } ) ; <nl> - } <nl> - <nl> - void reset_is_grabbable_log_reducer ( void ) { <nl> - is_grabbable_log_reducer_ . reset ( ) ; <nl> - } <nl> - <nl> - human_interface_device : : grabbable_state is_grabbable ( bool verbose = true ) const { <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Ungrabbable while key repeating <nl> - <nl> - if ( keyboard_repeat_detector_ . is_repeating ( ) ) { <nl> - if ( verbose ) { <nl> - is_grabbable_log_reducer_ . warn ( fmt : : format ( " We cannot grab { 0 } while a key is repeating . " , human_interface_device_ . get_name_for_log ( ) ) ) ; <nl> - } <nl> - return human_interface_device : : grabbable_state : : ungrabbable_temporarily ; <nl> - } <nl> - <nl> - / / Ungrabbable while modifier keys are pressed <nl> - / / <nl> - / / We have to check the modifier keys state to avoid pressed physical modifiers affects in mouse events . <nl> - / / ( See DEVELOPMENT . md > Modifier flags handling in kernel ) <nl> - <nl> - if ( ! pressed_modifier_flags_ . empty ( ) ) { <nl> - if ( verbose ) { <nl> - std : : stringstream ss ; <nl> - ss < < " We cannot grab " < < human_interface_device_ . get_name_for_log ( ) < < " while any modifier flags are pressed . ( " ; <nl> - for ( const auto & m : pressed_modifier_flags_ ) { <nl> - ss < < m < < " " ; <nl> - } <nl> - ss < < " ) " ; <nl> - is_grabbable_log_reducer_ . warn ( ss . str ( ) ) ; <nl> - } <nl> - return human_interface_device : : grabbable_state : : ungrabbable_temporarily ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - / / Ungrabbable while pointing button is pressed . <nl> - <nl> - if ( ! pressed_pointing_buttons_ . empty ( ) ) { <nl> - / / We should not grab the device while a button is pressed since we cannot release the button . <nl> - / / ( To release the button , we have to send a hid report to the device . But we cannot do it . ) <nl> - <nl> - if ( verbose ) { <nl> - is_grabbable_log_reducer_ . warn ( fmt : : format ( " We cannot grab { 0 } while mouse buttons are pressed . " , human_interface_device_ . get_name_for_log ( ) ) ) ; <nl> - } <nl> - return human_interface_device : : grabbable_state : : ungrabbable_temporarily ; <nl> - } <nl> - <nl> - / / mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm - <nl> - <nl> - return human_interface_device : : grabbable_state : : grabbable ; <nl> - } <nl> - <nl> - private : <nl> - void hid_values_arrived_callback ( human_interface_device & device , <nl> - const std : : vector < hid_value > & hid_values ) { <nl> - for ( const auto & hv : hid_values ) { <nl> - if ( auto key_code = types : : make_key_code ( hv ) ) { <nl> - / / Update keyboard_repeat_detector_ <nl> - <nl> - keyboard_repeat_detector_ . set ( hv ) ; <nl> - <nl> - / / Update pressed_modifier_flags_ <nl> - <nl> - if ( auto m = types : : make_modifier_flag ( * key_code ) ) { <nl> - if ( hv . get_integer_value ( ) ) { <nl> - pressed_modifier_flags_ . insert ( * m ) ; <nl> - } else { <nl> - pressed_modifier_flags_ . erase ( * m ) ; <nl> - } <nl> - } <nl> - } <nl> - <nl> - if ( auto consumer_key_code = types : : make_consumer_key_code ( hv ) ) { <nl> - / / Update keyboard_repeat_detector_ <nl> - <nl> - keyboard_repeat_detector_ . set ( hv ) ; <nl> - } <nl> - <nl> - if ( auto pointing_button = types : : make_pointing_button ( hv ) ) { <nl> - / / Update pressed_pointing_buttons_ <nl> - <nl> - if ( hv . get_integer_value ( ) ) { <nl> - pressed_pointing_buttons_ . insert ( * pointing_button ) ; <nl> - } else { <nl> - pressed_pointing_buttons_ . erase ( * pointing_button ) ; <nl> - } <nl> - } <nl> - <nl> - hid_value_arrived ( * this , hv ) ; <nl> - } <nl> - } <nl> - <nl> - human_interface_device human_interface_device_ ; <nl> - <nl> - boost : : signals2 : : connection hid_values_arrived_connection ; <nl> - <nl> - keyboard_repeat_detector keyboard_repeat_detector_ ; <nl> - std : : unordered_set < modifier_flag > pressed_modifier_flags_ ; <nl> - std : : unordered_set < pointing_button > pressed_pointing_buttons_ ; <nl> - <nl> - mutable spdlog_utility : : log_reducer is_grabbable_log_reducer_ ; <nl> - } ; <nl> - } / / namespace krbn <nl>
|
Revert " add human_interface_device_observer "
|
pqrs-org/Karabiner-Elements
|
19717c383801c287840282011645f91c0ead7bde
|
2018-04-07T08:54:42Z
|
mmm a / emscripten . py <nl> ppp b / emscripten . py <nl> def make_table ( sig , raw ) : <nl> Counter . i + = 1 <nl> bad = ' b ' + str ( i ) <nl> params = ' , ' . join ( [ ' p % d ' % p for p in range ( len ( sig ) - 1 ) ] ) <nl> - coercions = ' ; ' . join ( [ ' p % d = % sp % d % s ' % ( p , ' + ' if sig [ p + 1 ] = = ' d ' else ' ' , p , ' ' if sig [ p + 1 ] = = ' d ' else ' | 0 ' ) for p in range ( len ( sig ) - 1 ) ] ) + ' ; ' <nl> - ret = ' ' if sig [ 0 ] = = ' v ' else ( ' return % s0 ' % ( ' + ' if sig [ 0 ] = = ' d ' else ' ' ) ) <nl> + coercions = ' ; ' . join ( [ ' p % d = % sp % d % s ' % ( p , ' + ' if sig [ p + 1 ] = = ' f ' else ' ' , p , ' ' if sig [ p + 1 ] = = ' f ' else ' | 0 ' ) for p in range ( len ( sig ) - 1 ) ] ) + ' ; ' <nl> + ret = ' ' if sig [ 0 ] = = ' v ' else ( ' return % s0 ' % ( ' + ' if sig [ 0 ] = = ' f ' else ' ' ) ) <nl> return ( ' function % s ( % s ) { % s abort ( % d ) ; % s } ; ' % ( bad , params , coercions , i , ret ) , raw . replace ( ' [ 0 , ' , ' [ ' + bad + ' , ' ) . replace ( ' , 0 , ' , ' , ' + bad + ' , ' ) . replace ( ' , 0 , ' , ' , ' + bad + ' , ' ) . replace ( ' , 0 ] ' , ' , ' + bad + ' ] ' ) . replace ( ' , 0 ] ' , ' , ' + bad + ' ] ' ) ) <nl> infos = [ make_table ( sig , raw ) for sig , raw in last_forwarded_json [ ' Functions ' ] [ ' tables ' ] . iteritems ( ) ] <nl> function_tables_defs = ' \ n ' . join ( [ info [ 0 ] for info in infos ] + [ info [ 1 ] for info in infos ] ) <nl>
|
fix function table dummy element coercions
|
emscripten-core/emscripten
|
c9625dea12ca07fee75a3934f741c9a54d1d2113
|
2013-01-18T19:56:22Z
|
mmm a / hphp / hack / src / typing / typing_union . ml <nl> ppp b / hphp / hack / src / typing / typing_union . ml <nl> let ty_opt_equiv env tyopt1 tyopt2 ~ are_ty_param = <nl> let env , ty = ty_equiv env ty1 ty2 ~ are_ty_param in env , Some ty <nl> | _ , _ - > raise Not_equiv <nl> <nl> - let ty_lists_equiv env tyl1 tyl2 ~ are_ty_param = <nl> - try List . map2_env env tyl1 tyl2 ~ f : ( ty_equiv ~ are_ty_param ) <nl> - with Not_equiv | Invalid_argument _ - > raise Not_equiv <nl> - <nl> ( * Performs the union of two types . <nl> * The union is the least upper bound of the subtyping relation . <nl> * <nl> and union_ env ty1 ty2 r = <nl> with Not_equiv - > raise Dont_unify <nl> end <nl> | ( _ , Ttuple tyl1 ) , ( _ , Ttuple tyl2 ) - > <nl> - let env , tyl = <nl> - try ty_lists_equiv env tyl1 tyl2 ~ are_ty_param : false <nl> - with Not_equiv - > raise Dont_unify in <nl> - env , ( r , Ttuple tyl ) <nl> + if List . length tyl1 = List . length tyl2 <nl> + then <nl> + let env , tyl = List . map2_env env tyl1 tyl2 ~ f : union in <nl> + env , ( r , Ttuple tyl ) <nl> + else <nl> + raise Dont_unify <nl> | ( r1 , Tshape ( fk1 , fdm1 ) ) , ( r2 , Tshape ( fk2 , fdm2 ) ) - > <nl> let env , ty = union_shapes env ( fk1 , fdm1 , r1 ) ( fk2 , fdm2 , r2 ) in <nl> env , ( r , ty ) <nl> mmm a / hphp / hack / test / typecheck / union / tuples . php . exp <nl> ppp b / hphp / hack / test / typecheck / union / tuples . php . exp <nl> <nl> File " tuples . php " , line 23 , characters 3 - 13 : <nl> ( ^ ( int ) , ^ ( string ) , ^ ( bool ) ) <nl> File " tuples . php " , line 31 , characters 3 - 13 : <nl> - ( ( ^ ( int ) , ^ ( int ) , ^ ( bool ) ) | ( ^ ( mixed ) , ^ ( string ) , ^ ( bool ) ) ) <nl> + ( ^ ( mixed ) , ^ ( string | int ) , ^ ( bool ) ) <nl> File " tuples . php " , line 39 , characters 3 - 13 : <nl> ( ( ^ ( int ) , ^ ( int ) , ^ ( bool ) , ^ ( bool ) ) | ( ^ ( mixed ) , ^ ( string ) , ^ ( bool ) ) ) <nl> File " tuples . php " , line 47 , characters 3 - 13 : <nl> ( int , A ) <nl> File " tuples . php " , line 55 , characters 3 - 13 : <nl> - ( ( int , A ) | ( string , ( A , bool ) ) ) <nl> + ( ( int | string ) , ( A | ( A , bool ) ) ) <nl> File " tuples . php " , line 62 , characters 3 - 13 : <nl> ( ( int , A ) | ( float , int , bool ) ) <nl> File " tuples . php " , line 69 , characters 3 - 13 : <nl> ( ( string , ( A , bool ) ) | ( float , int , bool ) ) <nl> File " tuples . php " , line 76 , characters 3 - 13 : <nl> - ( ( ^ ( int ) , ^ ( A as A ) ) | ( int , A ) ) <nl> + ( ^ ( int ) , ^ ( A ) ) <nl> File " tuples . php " , line 40 , characters 36 - 37 : <nl> Invalid argument ( Typing [ 4110 ] ) <nl> File " tuples . php " , line 81 , characters 43 - 65 : <nl>
|
Approximate union of tuples by a tuple of unions
|
facebook/hhvm
|
f285284f2a47808bf8812d76b125e4ba39f28b91
|
2018-09-18T09:44:27Z
|
mmm a / arangod / Aql / SortBlock . cpp <nl> ppp b / arangod / Aql / SortBlock . cpp <nl> class OurLessThan { <nl> _sortRegisters ( sortRegisters ) { <nl> } <nl> <nl> - bool operator ( ) ( std : : pair < size_t , size_t > const & a , <nl> - std : : pair < size_t , size_t > const & b ) const { <nl> + bool operator ( ) ( std : : pair < uint32_t , uint32_t > const & a , <nl> + std : : pair < uint32_t , uint32_t > const & b ) const { <nl> for ( auto const & reg : _sortRegisters ) { <nl> auto const & lhs = _buffer [ a . first ] - > getValueReference ( a . second , std : : get < 0 > ( reg ) ) ; <nl> auto const & rhs = _buffer [ b . first ] - > getValueReference ( b . second , std : : get < 0 > ( reg ) ) ; <nl> void SortBlock : : doSorting ( ) { <nl> } <nl> <nl> / / coords [ i ] [ j ] is the < j > th row of the < i > th block <nl> - std : : vector < std : : pair < size_t , size_t > > coords ; <nl> + std : : vector < std : : pair < uint32_t , uint32_t > > coords ; <nl> coords . reserve ( sum ) ; <nl> <nl> / / install the coords <nl> - size_t count = 0 ; <nl> + / / we are intentionally using uint32_t here to save memory and <nl> + / / have better cache utilization <nl> + uint32_t count = 0 ; <nl> <nl> for ( auto const & block : _buffer ) { <nl> - for ( size_t i = 0 ; i < block - > size ( ) ; i + + ) { <nl> + uint32_t const n = static_cast < uint32_t > ( block - > size ( ) ) ; <nl> + <nl> + for ( uint32_t i = 0 ; i < n ; i + + ) { <nl> coords . emplace_back ( std : : make_pair ( count , i ) ) ; <nl> } <nl> - count + + ; <nl> + + + count ; <nl> } <nl> <nl> / / comparison function <nl>
|
reduce memory usage by using smaller types for offsets / indexes ( )
|
arangodb/arangodb
|
778a223e7e3583acc81ffc2a60e62810551ed85c
|
2018-01-24T20:30:24Z
|
mmm a / include / swift / AST / ASTMangler . h <nl> ppp b / include / swift / AST / ASTMangler . h <nl> class ASTMangler : public Mangler { <nl> ModuleDecl * Module ) ; <nl> <nl> std : : string mangleTypeForDebugger ( Type decl , const DeclContext * DC ) ; <nl> - <nl> + <nl> + std : : string mangleDeclType ( const ValueDecl * decl ) ; <nl> + <nl> std : : string mangleObjCRuntimeName ( const NominalTypeDecl * Nominal ) ; <nl> <nl> std : : string mangleTypeAsUSR ( Type type ) { <nl> mmm a / lib / AST / ASTMangler . cpp <nl> ppp b / lib / AST / ASTMangler . cpp <nl> std : : string ASTMangler : : mangleTypeForDebugger ( Type Ty , const DeclContext * DC ) { <nl> return finalize ( ) ; <nl> } <nl> <nl> + std : : string ASTMangler : : mangleDeclType ( const ValueDecl * decl ) { <nl> + DWARFMangling = true ; <nl> + beginMangling ( ) ; <nl> + <nl> + appendDeclType ( decl ) ; <nl> + appendOperator ( " D " ) ; <nl> + return finalize ( ) ; <nl> + } <nl> + <nl> static bool isPrivate ( const NominalTypeDecl * Nominal ) { <nl> return Nominal - > hasAccessibility ( ) & & <nl> Nominal - > getFormalAccess ( ) < = Accessibility : : FilePrivate ; <nl> mmm a / lib / AST / USRGeneration . cpp <nl> ppp b / lib / AST / USRGeneration . cpp <nl> bool ide : : printTypeUSR ( Type Ty , raw_ostream & OS ) { <nl> } <nl> <nl> bool ide : : printDeclTypeUSR ( const ValueDecl * D , raw_ostream & OS ) { <nl> - using namespace Mangle ; <nl> - Mangler Mangler ( true ) ; <nl> - Mangler . mangleDeclTypeForDebugger ( D ) ; <nl> - Mangler . finalize ( OS ) ; <nl> + NewMangling : : ASTMangler Mangler ; <nl> + std : : string MangledName = Mangler . mangleDeclType ( D ) ; <nl> + OS < < MangledName ; <nl> return false ; <nl> } <nl> <nl> mmm a / test / SourceKit / CursorInfo / cursor_info . swift <nl> ppp b / test / SourceKit / CursorInfo / cursor_info . swift <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK2 - NEXT : + <nl> / / CHECK2 - NEXT : s : s1poiS2i_SitF <nl> / / CHECK2 - NEXT : ( Int , Int ) - > Int { { $ } } <nl> - / / CHECK2 - NEXT : _TtFTSiSi_Si <nl> + / / CHECK2 - NEXT : _T0S2i_SitcD <nl> / / CHECK2 - NEXT : Swift { { $ } } <nl> / / CHECK2 - NEXT : < Group > Math / Integers < / Group > <nl> / / CHECK2 - NEXT : SYSTEM <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK3 - NEXT : x { { $ } } <nl> / / CHECK3 - NEXT : s : 11cursor_info3gooySiF1xL_Siv { { $ } } <nl> / / CHECK3 - NEXT : Int { { $ } } <nl> - / / CHECK3 - NEXT : _TtSi <nl> + / / CHECK3 - NEXT : _T0SiD <nl> / / CHECK3 - NEXT : < Declaration > let x : < Type usr = " s : Si " > Int < / Type > < / Declaration > <nl> / / CHECK3 - NEXT : < decl . var . parameter > < syntaxtype . keyword > let < / syntaxtype . keyword > < decl . var . parameter . name > x < / decl . var . parameter . name > : < decl . var . parameter . type > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > <nl> <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK4 - NEXT : fooIntVar { { $ } } <nl> / / CHECK4 - NEXT : c : @ fooIntVar { { $ } } <nl> / / CHECK4 - NEXT : Int32 { { $ } } <nl> - / / CHECK4 - NEXT : _TtVs5Int32 <nl> + / / CHECK4 - NEXT : _T0s5Int32VD <nl> / / CHECK4 - NEXT : Foo { { $ } } <nl> / / CHECK4 - NEXT : < Declaration > var fooIntVar : < Type usr = " s : s5Int32V " > Int32 < / Type > < / Declaration > <nl> / / CHECK4 - NEXT : < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > fooIntVar < / decl . name > : < decl . var . type > < ref . struct usr = " s : s5Int32V " > Int32 < / ref . struct > < / decl . var . type > < / decl . var . global > <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK6 - NEXT : fooSwiftFunc <nl> / / CHECK6 - NEXT : s : 14FooSwiftModule03fooB4FuncSiyF <nl> / / CHECK6 - NEXT : ( ) - > Int <nl> - / / CHECK6 - NEXT : _TtFT_Si <nl> + / / CHECK6 - NEXT : _T0SiycD <nl> / / CHECK6 - NEXT : FooSwiftModule <nl> / / CHECK6 - NEXT : < Declaration > func fooSwiftFunc ( ) - & gt ; < Type usr = " s : Si " > Int < / Type > < / Declaration > <nl> / / CHECK6 - NEXT : < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > fooSwiftFunc < / decl . name > ( ) - & gt ; < decl . function . returntype > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . function . returntype > < / decl . function . free > <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK7 - NEXT : S1 <nl> / / CHECK7 - NEXT : s : 11cursor_info2S1V <nl> / / CHECK7 - NEXT : S1 . Type <nl> - / / CHECK7 - NEXT : _Tt <nl> + / / CHECK7 - NEXT : _T0 <nl> / / CHECK7 - NEXT : < Declaration > struct S1 < / Declaration > <nl> / / CHECK7 - NEXT : < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > S1 < / decl . name > < / decl . struct > <nl> / / CHECK7 - NEXT : < Class file = " { { [ ^ " ] + } } cursor_info . swift " line = " 13 " column = " 8 " > < Name > S1 < / Name > < USR > s : 11cursor_info2S1V < / USR > < Declaration > struct S1 < / Declaration > < Abstract > < Para > Aaa . S1 . Bbb . < / Para > < / Abstract > < / Class > <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK8 - NEXT : init <nl> / / CHECK8 - NEXT : s : 11cursor_info2CCCACSi1x_tcfc <nl> / / CHECK8 - NEXT : ( CC . Type ) - > ( Int ) - > CC <nl> - / / CHECK8 - NEXT : _TtFT1xSi_C11cursor_info2CC <nl> + / / CHECK8 - NEXT : _T011cursor_info2CCCSi1x_tcD <nl> / / CHECK8 - NEXT : < Container > _T011cursor_info2CCCD < / Container > <nl> / / CHECK8 - NEXT : < Declaration > convenience init ( x : < Type usr = " s : Si " > Int < / Type > ) < / Declaration > <nl> / / CHECK8 - NEXT : < decl . function . constructor > < syntaxtype . keyword > convenience < / syntaxtype . keyword > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > x < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK29 - NEXT : deinit <nl> / / CHECK29 - NEXT : s : 11cursor_info2C3Cfd <nl> / / CHECK29 - NEXT : ( C3 ) - > ( ) <nl> - / / CHECK29 - NEXT : _TtFT_T_ <nl> + / / CHECK29 - NEXT : _T0yycD <nl> / / CHECK29 - NEXT : < Declaration > deinit < / Declaration > <nl> / / CHECK29 - NEXT : < decl . function . destructor > < syntaxtype . keyword > deinit < / syntaxtype . keyword > < / decl . function . destructor > <nl> <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK30 - NEXT : init ( x : ) <nl> / / CHECK30 - NEXT : s : 11cursor_info2C3CSQyACGSi1x_tcfc <nl> / / CHECK30 - NEXT : ( C3 . Type ) - > ( Int ) - > C3 ! <nl> - / / CHECK30 - NEXT : _TtFT1xSi_GSQC11cursor_info2C3_ <nl> + / / CHECK30 - NEXT : _T0SQy11cursor_info2C3CGSi1x_tcD <nl> / / CHECK30 - NEXT : < Declaration > init ! ( x : < Type usr = " s : Si " > Int < / Type > ) < / Declaration > <nl> / / CHECK30 - NEXT : < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ! ( < decl . var . parameter > < decl . var . parameter . argument_label > x < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > <nl> <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK31 - NEXT : init ( y : ) <nl> / / CHECK31 - NEXT : s : 11cursor_info2C3CACSgSi1y_tcfc <nl> / / CHECK31 - NEXT : ( C3 . Type ) - > ( Int ) - > C3 ? <nl> - / / CHECK31 - NEXT : _TtFT1ySi_GSqC11cursor_info2C3_ <nl> + / / CHECK31 - NEXT : _T011cursor_info2C3CSgSi1y_tcD <nl> / / CHECK31 - NEXT : < Declaration > init ? ( y : < Type usr = " s : Si " > Int < / Type > ) < / Declaration > <nl> / / CHECK31 - NEXT : < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ? ( < decl . var . parameter > < decl . var . parameter . argument_label > y < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < / decl . function . constructor > <nl> <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK32 - NEXT : init ( z : ) <nl> / / CHECK32 - NEXT : s : 11cursor_info2C3CACSi1z_tKcfc <nl> / / CHECK32 - NEXT : ( C3 . Type ) - > ( Int ) throws - > C3 <nl> - / / CHECK32 - NEXT : _TtFzT1zSi_C11cursor_info2C3 <nl> + / / CHECK32 - NEXT : _T011cursor_info2C3CSi1z_tKcD <nl> / / CHECK32 - NEXT : < Declaration > init ( z : < Type usr = " s : Si " > Int < / Type > ) throws < / Declaration > <nl> / / CHECK32 - NEXT : < decl . function . constructor > < syntaxtype . keyword > init < / syntaxtype . keyword > ( < decl . var . parameter > < decl . var . parameter . argument_label > z < / decl . var . parameter . argument_label > : < decl . var . parameter . type > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . var . parameter . type > < / decl . var . parameter > ) < syntaxtype . keyword > throws < / syntaxtype . keyword > < / decl . function . constructor > <nl> <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK87 - NEXT : HasLocalizationKey <nl> / / CHECK87 - NEXT : s : 11cursor_info18HasLocalizationKeyV <nl> / / CHECK87 - NEXT : HasLocalizationKey . Type <nl> - / / CHECK87 - NEXT : _Tt <nl> + / / CHECK87 - NEXT : _T0 <nl> / / CHECK87 - NEXT : < Declaration > struct HasLocalizationKey < / Declaration > <nl> / / CHECK87 - NEXT : < decl . struct > < syntaxtype . keyword > struct < / syntaxtype . keyword > < decl . name > HasLocalizationKey < / decl . name > < / decl . struct > <nl> / / CHECK87 - NEXT : < Class file = " { { [ ^ " ] + } } cursor_info . swift " line = " 212 " column = " 8 " > < Name > HasLocalizationKey < / Name > < USR > s : 11cursor_info18HasLocalizationKeyV < / USR > < Declaration > struct HasLocalizationKey < / Declaration > < Abstract > < Para > Brief . < / Para > < / Abstract > < / Class > <nl> func hasLocalizationKey2 ( ) { } <nl> / / CHECK88 - NEXT : hasLocalizationKey2 <nl> / / CHECK88 - NEXT : s : 11cursor_info19hasLocalizationKey2yyF <nl> / / CHECK88 - NEXT : ( ) - > ( ) <nl> - / / CHECK88 - NEXT : _Tt <nl> + / / CHECK88 - NEXT : _T0 <nl> / / CHECK88 - NEXT : < Declaration > func hasLocalizationKey2 ( ) < / Declaration > <nl> / / CHECK88 - NEXT : < decl . function . free > < syntaxtype . keyword > func < / syntaxtype . keyword > < decl . name > hasLocalizationKey2 < / decl . name > ( ) < / decl . function . free > <nl> / / CHECK88 - NEXT : < Function file = " { { [ ^ " ] + } } cursor_info . swift " line = " 215 " column = " 6 " > < Name > hasLocalizationKey2 ( ) < / Name > < USR > s : 11cursor_info19hasLocalizationKey2yyF < / USR > < Declaration > func hasLocalizationKey2 ( ) < / Declaration > < / Function <nl> mmm a / test / SourceKit / CursorInfo / cursor_stdlib . swift <nl> ppp b / test / SourceKit / CursorInfo / cursor_stdlib . swift <nl> func foo3 ( a : Float , b : Bool ) { } <nl> / / CHECK - OVERLAY - NEXT : NSUTF8StringEncoding <nl> / / CHECK - OVERLAY - NEXT : s : 10Foundation20NSUTF8StringEncodingSuv <nl> / / CHECK - OVERLAY - NEXT : UInt <nl> - / / CHECK - OVERLAY - NEXT : _TtSu <nl> + / / CHECK - OVERLAY - NEXT : _T0SuD <nl> / / CHECK - OVERLAY - NEXT : < Declaration > public let NSUTF8StringEncoding : < Type usr = " s : Su " > UInt < / Type > < / Declaration > <nl> <nl> / / RUN : % sourcekitd - test - req = cursor - pos = 5 : 13 % s - - % s % mcp_opt % clang - importer - sdk | % FileCheck - check - prefix = CHECK - ITERATOR % s <nl> mmm a / test / SourceKit / CursorInfo / cursor_usr . swift <nl> ppp b / test / SourceKit / CursorInfo / cursor_usr . swift <nl> func foo ( x : FooStruct1 ) - > S1 { } <nl> / / CHECK_SANITY1 - NEXT : global <nl> / / CHECK_SANITY1 - NEXT : s : 10cursor_usr6globalSiv <nl> / / CHECK_SANITY1 - NEXT : Int <nl> - / / CHECK_SANITY1 - NEXT : _TtSi <nl> + / / CHECK_SANITY1 - NEXT : _T0SiD <nl> / / CHECK_SANITY1 - NEXT : < Declaration > var global : < Type usr = " s : Si " > Int < / Type > < / Declaration > <nl> / / CHECK_SANITY1 - NEXT : < decl . var . global > < syntaxtype . keyword > var < / syntaxtype . keyword > < decl . name > global < / decl . name > : < decl . var . type > < ref . struct usr = " s : Si " > Int < / ref . struct > < / decl . var . type > < / decl . var . global > <nl> <nl> mmm a / test / SourceKit / InterfaceGen / gen_stdlib . swift <nl> ppp b / test / SourceKit / InterfaceGen / gen_stdlib . swift <nl> var x : Int <nl> / / CHECK1 - NEXT : Int <nl> / / CHECK1 - NEXT : s : Si <nl> / / CHECK1 - NEXT : Int . Type <nl> - / / CHECK1 - NEXT : _Tt <nl> + / / CHECK1 - NEXT : _T0 <nl> / / CHECK1 - NEXT : Swift { { $ } } <nl> / / CHECK1 - NEXT : < Group > Math / Integers < / Group > <nl> / / CHECK1 - NEXT : / < interface - gen > { { $ } } <nl>
|
Merge remote - tracking branch ' origin / master ' into master - next
|
apple/swift
|
9f33ffdbb84d1257d2d2bb80432c10ea0100488f
|
2017-03-17T03:48:43Z
|
mmm a / include / osquery / core . h <nl> ppp b / include / osquery / core . h <nl> inline bool isPlatform ( PlatformType a , const PlatformType & t = kPlatformType ) { <nl> return ( static_cast < int > ( t ) & static_cast < int > ( a ) ) ! = 0 ; <nl> } <nl> <nl> - / / / Helper alias for defining mutexes throughout the codebase . <nl> + / / / Helper alias for defining mutexes . <nl> using Mutex = std : : mutex ; <nl> <nl> / / / Helper alias for write locking a mutex . <nl> using WriteLock = std : : lock_guard < Mutex > ; <nl> + <nl> + / / / Helper alias for defining recursive mutexes . <nl> + using RecursiveMutex = std : : recursive_mutex ; <nl> + <nl> + / / / Helper alias for write locking a recursive mutex . <nl> + using RecursiveLock = std : : lock_guard < std : : recursive_mutex > ; <nl> } <nl> mmm a / osquery / config / config . cpp <nl> ppp b / osquery / config / config . cpp <nl> const std : : string kFailedQueries = " failed_queries " ; <nl> Mutex config_hash_mutex_ ; <nl> Mutex config_valid_mutex_ ; <nl> <nl> - using RecursiveMutex = std : : recursive_mutex ; <nl> - using RecursiveLock = std : : lock_guard < std : : recursive_mutex > ; <nl> - <nl> / / / Several config methods require enumeration via predicate lambdas . <nl> RecursiveMutex config_schedule_mutex_ ; <nl> RecursiveMutex config_files_mutex_ ; <nl> mmm a / osquery / devtools / shell . cpp <nl> ppp b / osquery / devtools / shell . cpp <nl> static int shell_exec ( <nl> } <nl> <nl> while ( zSql [ 0 ] & & ( SQLITE_OK = = rc ) ) { <nl> + / * A lock for attaching virtual tables , but also the SQL object states . * / <nl> + osquery : : RecursiveLock lock ( osquery : : kAttachMutex ) ; <nl> + <nl> rc = sqlite3_prepare_v2 ( db , zSql , - 1 , & pStmt , & zLeftover ) ; <nl> if ( SQLITE_OK ! = rc ) { <nl> if ( pzErrMsg ) { <nl> int launchIntoShell ( int argc , char * * argv ) { <nl> int rc = shell_exec ( query , shell_callback , & data , & error ) ; <nl> if ( error ! = 0 ) { <nl> fprintf ( stderr , " Error : % s \ n " , error ) ; <nl> - return ( rc ! = 0 ) ? rc : 1 ; <nl> + rc = ( rc = = 0 ) ? 1 : rc ; <nl> } else if ( rc ! = 0 ) { <nl> fprintf ( stderr , " Error : unable to process SQL \ " % s \ " \ n " , query ) ; <nl> } <nl> int launchIntoShell ( int argc , char * * argv ) { <nl> } <nl> } <nl> } ) ; <nl> - if ( rc ! = 0 ) { <nl> - return rc ; <nl> - } <nl> } else if ( argc > 1 & & argv [ 1 ] ! = nullptr ) { <nl> / / Run a command or statement from CLI <nl> char * query = argv [ 1 ] ; <nl> mmm a / osquery / sql / virtual_table . cpp <nl> ppp b / osquery / sql / virtual_table . cpp <nl> SHELL_FLAG ( bool , planner , false , " Enable osquery runtime planner output " ) ; <nl> <nl> DECLARE_bool ( disable_events ) ; <nl> <nl> - / * * <nl> - * @ brief A protection around concurrent table attach requests . <nl> - * <nl> - * Table attaching is not concurrent . Attaching is the only unprotected SQLite <nl> - * operation from osquery ' s usage perspective . The extensions API allows for <nl> - * concurrent access of non - thread - safe database resources for attaching table <nl> - * schema and filter routing instructions . <nl> - * / <nl> - Mutex kAttachMutex ; <nl> - <nl> - / * * <nl> - * A generated foreign amalgamation file includes schema for all tables . <nl> - * <nl> - * When the build system generates TablePlugin % s from the . table spec files , it <nl> - * reads the foreign - platform tables and generates an associated schema plugin . <nl> - * These plugins are amalgamated into ' foreign_amalgamation ' and do not call <nl> - * their filter generation functions . <nl> - * / <nl> - void registerForeignTables ( ) ; <nl> + RecursiveMutex kAttachMutex ; <nl> <nl> namespace tables { <nl> namespace sqlite { <nl> Status attachTableInternal ( const std : : string & name , <nl> <nl> / / Note , if the clientData API is used then this will save a registry call <nl> / / within xCreate . <nl> - WriteLock lock ( kAttachMutex ) ; <nl> + RecursiveLock lock ( kAttachMutex ) ; <nl> int rc = sqlite3_create_module ( <nl> instance - > db ( ) , name . c_str ( ) , & module , ( void * ) & ( * instance ) ) ; <nl> if ( rc = = SQLITE_OK | | rc = = SQLITE_MISUSE ) { <nl> Status attachTableInternal ( const std : : string & name , <nl> } <nl> <nl> Status detachTableInternal ( const std : : string & name , sqlite3 * db ) { <nl> - WriteLock lock ( kAttachMutex ) ; <nl> + RecursiveLock lock ( kAttachMutex ) ; <nl> auto format = " DROP TABLE IF EXISTS temp . " + name ; <nl> int rc = sqlite3_exec ( db , format . c_str ( ) , nullptr , nullptr , 0 ) ; <nl> if ( rc ! = SQLITE_OK ) { <nl> Status attachFunctionInternal ( <nl> / / Hold the manager connection instance again in callbacks . <nl> auto dbc = SQLiteDBManager : : get ( ) ; <nl> / / Add some shell - specific functions to the instance . <nl> - WriteLock lock ( kAttachMutex ) ; <nl> + RecursiveLock lock ( kAttachMutex ) ; <nl> int rc = sqlite3_create_function ( <nl> dbc - > db ( ) , <nl> name . c_str ( ) , <nl> mmm a / osquery / sql / virtual_table . h <nl> ppp b / osquery / sql / virtual_table . h <nl> <nl> <nl> namespace osquery { <nl> <nl> + / * * <nl> + * @ brief A protection around concurrent table attach requests . <nl> + * <nl> + * Table attaching is not concurrent . Attaching is the only unprotected SQLite <nl> + * operation from osquery ' s usage perspective . The extensions API allows for <nl> + * concurrent access of non - thread - safe database resources for attaching table <nl> + * schema and filter routing instructions . <nl> + * / <nl> + extern RecursiveMutex kAttachMutex ; <nl> + <nl> / * * <nl> * @ brief osquery cursor object . <nl> * <nl> Status attachFunctionInternal ( <nl> std : : function < <nl> void ( sqlite3_context * context , int argc , sqlite3_value * * argv ) > func ) ; <nl> <nl> + / * * <nl> + * A generated foreign amalgamation file includes schema for all tables . <nl> + * <nl> + * When the build system generates TablePlugin % s from the . table spec files , it <nl> + * reads the foreign - platform tables and generates an associated schema plugin . <nl> + * These plugins are amalgamated into ' foreign_amalgamation ' and do not call <nl> + * their filter generation functions . <nl> + * / <nl> + void registerForeignTables ( ) ; <nl> + <nl> / / / Attach all table plugins to an in - memory SQLite database . <nl> void attachVirtualTables ( const SQLiteDBInstanceRef & instance ) ; <nl> } <nl>
|
[ Fix ] Add SQLite prepare lock to shell_exec ( )
|
osquery/osquery
|
b814fd54dcaca9dfc93c35304a8f238b853d416f
|
2016-10-24T15:25:38Z
|
mmm a / vendor / clink . lua <nl> ppp b / vendor / clink . lua <nl> end <nl> - - @ return { false | mercurial branch name } <nl> mmm <nl> local function get_hg_branch ( ) <nl> - for line in io . popen ( " hg branch 2 > nul " ) : lines ( ) do <nl> + local file = io . popen ( " hg branch 2 > nul " ) <nl> + for line in file : lines ( ) do <nl> local m = line : match ( " ( . + ) $ " ) <nl> if m then <nl> + file : close ( ) <nl> return m <nl> end <nl> end <nl> + file : close ( ) <nl> <nl> return false <nl> end <nl> end <nl> - - @ return { false | svn branch name } <nl> mmm <nl> local function get_svn_branch ( svn_dir ) <nl> - for line in io . popen ( " svn info 2 > nul " ) : lines ( ) do <nl> + local file = io . popen ( " svn info 2 > nul " ) <nl> + for line in file : lines ( ) do <nl> local m = line : match ( " ^ Relative URL : " ) <nl> if m then <nl> + file : close ( ) <nl> return line : sub ( line : find ( " / " ) + 1 , line : len ( ) ) <nl> end <nl> end <nl> + file : close ( ) <nl> <nl> return false <nl> end <nl>
|
Merge pull request from JoshuaWebb / master
|
cmderdev/cmder
|
0bd847e69581afb7fda492104d4aa44dd2b2cb34
|
2019-05-05T21:13:57Z
|
mmm a / ports / libwebsockets / CONTROL <nl> ppp b / ports / libwebsockets / CONTROL <nl> <nl> Source : libwebsockets <nl> - Version : 3 . 2 . 2 - 1 <nl> + Version : 4 . 0 . 1 <nl> Build - Depends : zlib , openssl , libuv <nl> Homepage : https : / / github . com / warmcat / libwebsockets <nl> Description : Libwebsockets is a lightweight pure C library built to use minimal CPU and memory resources , and provide fast throughput in both directions as client or server . <nl> + Supports : ! ( arm | uwp ) <nl> \ No newline at end of file <nl> mmm a / ports / libwebsockets / portfile . cmake <nl> ppp b / ports / libwebsockets / portfile . cmake <nl> <nl> + vcpkg_fail_port_install ( ON_ARCH " arm " ON_TARGET " uwp " ) <nl> + <nl> vcpkg_from_github ( <nl> OUT_SOURCE_PATH SOURCE_PATH <nl> REPO warmcat / libwebsockets <nl> - REF v3 . 2 . 2 <nl> - SHA512 be6cd57ae1d15de059c277ce56e9ccc87f7918811b40a427c96978397f2b1d446e1b5ed6ae62a6aa82c6d775871d6a15885d283d74d7887e98205ab61d206fc0 <nl> + REF 6eb39388f43f6e2a27f0efcbf8cb2391e38824e9 # v4 . 0 . 1 <nl> + SHA512 2317ab66cd642280dc5cc7c47b8efa562731cc5b4a4eda83f34b6a7b60f02df6444a818c36e84f5cf118c79d6d62a9aa2e486d18f434199abd9812e7b88941e4 <nl> HEAD_REF master <nl> PATCHES <nl> CMakeLists . patch <nl> vcpkg_configure_cmake ( <nl> OPTIONS <nl> - DLWS_WITH_STATIC = $ { LWS_WITH_STATIC } <nl> - DLWS_WITH_SHARED = $ { LWS_WITH_SHARED } <nl> - - DLWS_USE_BUNDLED_ZLIB = OFF <nl> + - DLWS_WITH_BUNDLED_ZLIB = OFF <nl> - DLWS_WITHOUT_TESTAPPS = ON <nl> - DLWS_IPV6 = ON <nl> - - DLWS_HTTP2 = ON <nl> + - DLWS_WITH_HTTP2 = ON <nl> - DLWS_WITH_HTTP_STREAM_COMPRESSION = ON # Since zlib is already a dependency <nl> - DLWS_WITH_LIBUV = ON <nl> # OPTIONS_RELEASE - DOPTIMIZE = 1 <nl> file ( WRITE $ { CURRENT_PACKAGES_DIR } / share / libwebsockets / LibwebsocketsTargets - debu <nl> file ( READ $ { CURRENT_PACKAGES_DIR } / share / libwebsockets / LibwebsocketsTargets - release . cmake LIBWEBSOCKETSTARGETSRELEASE_CMAKE ) <nl> string ( REPLACE " websockets_static . lib " " websockets . lib " LIBWEBSOCKETSTARGETSRELEASE_CMAKE " $ { LIBWEBSOCKETSTARGETSRELEASE_CMAKE } " ) <nl> file ( WRITE $ { CURRENT_PACKAGES_DIR } / share / libwebsockets / LibwebsocketsTargets - release . cmake " $ { LIBWEBSOCKETSTARGETSRELEASE_CMAKE } " ) <nl> - file ( COPY $ { SOURCE_PATH } / LICENSE DESTINATION $ { CURRENT_PACKAGES_DIR } / share / libwebsockets ) <nl> - file ( RENAME $ { CURRENT_PACKAGES_DIR } / share / libwebsockets / LICENSE $ { CURRENT_PACKAGES_DIR } / share / libwebsockets / copyright ) <nl> + file ( INSTALL $ { SOURCE_PATH } / LICENSE DESTINATION $ { CURRENT_PACKAGES_DIR } / share / $ { PORT } RENAME copyright ) <nl> if ( VCPKG_LIBRARY_LINKAGE STREQUAL static ) <nl> - if ( NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL " windows " OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL " WindowsStore " ) <nl> + if ( VCPKG_TARGET_IS_WINDOWS ) <nl> file ( RENAME $ { CURRENT_PACKAGES_DIR } / debug / lib / websockets_static . lib $ { CURRENT_PACKAGES_DIR } / debug / lib / websockets . lib ) <nl> file ( RENAME $ { CURRENT_PACKAGES_DIR } / lib / websockets_static . lib $ { CURRENT_PACKAGES_DIR } / lib / websockets . lib ) <nl> endif ( ) <nl>
|
[ libwebsockets ] Update to 4 . 0 . 1 ( )
|
microsoft/vcpkg
|
c1be61854214e408952246ce39caaf614f55f88f
|
2020-04-03T17:14:40Z
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.